Changeset 9697 for branches/HeuristicLab.Data Path DataTypes/HeuristicLab.Data.Views/3.3/Path Views/TextFileView.cs
- Timestamp:
- 07/05/13 10:50:47 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Data Path DataTypes/HeuristicLab.Data.Views/3.3/Path Views/TextFileView.cs
r9680 r9697 68 68 saveButton.Enabled = !Locked && !ReadOnly && Content != null && ChangedFileContent; 69 69 70 if (Content != null && File.Exists(Content.Value)) {70 if (Content != null && Content.Exists()) { 71 71 fileSystemWatcher.Filter = Path.GetFileName(Content.Value); 72 72 fileSystemWatcher.Path = Path.GetDirectoryName(Content.Value); … … 77 77 protected override void OnVisibleChanged(EventArgs e) { 78 78 //mkommend: necessary to update the textbox to detect intermediate file changes. 79 if (Visible ) UpdateTextBox();79 if (Visible && Content != null) UpdateTextBox(); 80 80 base.OnVisibleChanged(e); 81 81 } … … 228 228 public static string ReadFile(string path) { 229 229 if (!File.Exists(path)) return null; 230 //TODO handle IO Exceptions231 230 string fileContent; 232 231 using (FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read)) { … … 239 238 240 239 public static void WriteFile(string path, string fileContent) { 241 //TODO handle IO Exceptions242 240 using (FileStream fileStream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.Write)) { 243 241 using (StreamWriter streamWriter = new StreamWriter(fileStream)) {
Note: See TracChangeset
for help on using the changeset viewer.