Fixed Issue 125.
authormoel.mich
Tue, 05 Oct 2010 19:27:51 +0000
changeset 2127e98c9e1a4f4
parent 211 88131b86378b
child 213 d93c927e4fd6
Fixed Issue 125.
GUI/MainForm.cs
     1.1 --- a/GUI/MainForm.cs	Tue Oct 05 18:59:13 2010 +0000
     1.2 +++ b/GUI/MainForm.cs	Tue Oct 05 19:27:51 2010 +0000
     1.3 @@ -350,8 +350,15 @@
     1.4          settings.SetValue("treeView.Columns." + column.Header + ".Width",
     1.5            column.Width);
     1.6  
     1.7 -      settings.Save(Path.ChangeExtension(
     1.8 -        System.Windows.Forms.Application.ExecutablePath, ".config"));
     1.9 +      string fileName = Path.ChangeExtension(
    1.10 +          System.Windows.Forms.Application.ExecutablePath, ".config");
    1.11 +      try {
    1.12 +        settings.Save(fileName);
    1.13 +      } catch (UnauthorizedAccessException) {
    1.14 +        MessageBox.Show("Access to the path '" + fileName + "' is denied. " + 
    1.15 +          "The current seetings could not be saved.", 
    1.16 +          "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
    1.17 +      }
    1.18      }
    1.19  
    1.20     private void MainForm_FormClosed(object sender, FormClosedEventArgs e) {