Theme File Write Access
Posted: Fri Mar 13, 2009 12:27 pm
Hi,
We have a problem with loading the custom theme file into the TeeChart.
The exception we get is
System.UnauthorizedAccessException: Access to the path 'TestTheme.xml' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode)
at Steema.TeeChart.Themes.ThemeProperties.ReadTheme(Object FileOrStream)
at Steema.TeeChart.Themes.Theme.ApplyChartTheme(String ThemeFile, Chart CustomChart)
at TeeChartThemeTest.Form1.button1_Click(Object sender, EventArgs e) in C:\Data\code\cs\TeeChartThemeTest\TeeChartThemeTest\Form1.cs:line 20
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
The problem actually is tee chart is trying to open the file in write mode whereas the file is a read only file.
The call with which we are trying to load theme file is :
Steema.TeeChart.Themes.Theme.ApplyChartTheme(@"../../TestTheme.xml", tChart1.Chart);
Can you please help me out in reading and applying theme from a read only file?
We have a problem with loading the custom theme file into the TeeChart.
The exception we get is
System.UnauthorizedAccessException: Access to the path 'TestTheme.xml' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode)
at Steema.TeeChart.Themes.ThemeProperties.ReadTheme(Object FileOrStream)
at Steema.TeeChart.Themes.Theme.ApplyChartTheme(String ThemeFile, Chart CustomChart)
at TeeChartThemeTest.Form1.button1_Click(Object sender, EventArgs e) in C:\Data\code\cs\TeeChartThemeTest\TeeChartThemeTest\Form1.cs:line 20
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
The problem actually is tee chart is trying to open the file in write mode whereas the file is a read only file.
The call with which we are trying to load theme file is :
Steema.TeeChart.Themes.Theme.ApplyChartTheme(@"../../TestTheme.xml", tChart1.Chart);
Can you please help me out in reading and applying theme from a read only file?