Browse Source

Check if the file exits when checking for attributes.

4.1
Eusebiu Marcu 15 years ago
parent
commit
e3ee633cb9
  1. 7
      src/Main/Base/Project/Src/Services/File/FileChangeWatcher.cs

7
src/Main/Base/Project/Src/Services/File/FileChangeWatcher.cs

@ -6,8 +6,9 @@ using System.Collections.Generic; @@ -6,8 +6,9 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Windows.Forms;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.SharpDevelop
{
@ -89,7 +90,9 @@ namespace ICSharpCode.SharpDevelop @@ -89,7 +90,9 @@ namespace ICSharpCode.SharpDevelop
activeWatchers.Add(this);
SetWatcher();
isFileReadOnly = (System.IO.File.GetAttributes(this.file.FileName) & FileAttributes.ReadOnly) == FileAttributes.ReadOnly;
if (System.IO.File.Exists(this.file.FileName)) {
isFileReadOnly = (System.IO.File.GetAttributes(this.file.FileName) & FileAttributes.ReadOnly) == FileAttributes.ReadOnly;
}
}
void file_FileNameChanged(object sender, EventArgs e)

Loading…
Cancel
Save