Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/05/13 10:50:47 (11 years ago)
Author:
mkommend
Message:

#2081: Updated branches from trunk and implemented all review comments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Data Path DataTypes/HeuristicLab.Data.Views/3.3/Path Views/TextFileView.cs

    r9680 r9697  
    6868      saveButton.Enabled = !Locked && !ReadOnly && Content != null && ChangedFileContent;
    6969
    70       if (Content != null && File.Exists(Content.Value)) {
     70      if (Content != null && Content.Exists()) {
    7171        fileSystemWatcher.Filter = Path.GetFileName(Content.Value);
    7272        fileSystemWatcher.Path = Path.GetDirectoryName(Content.Value);
     
    7777    protected override void OnVisibleChanged(EventArgs e) {
    7878      //mkommend: necessary to update the textbox to detect intermediate file changes.
    79       if (Visible) UpdateTextBox();
     79      if (Visible && Content != null) UpdateTextBox();
    8080      base.OnVisibleChanged(e);
    8181    }
     
    228228    public static string ReadFile(string path) {
    229229      if (!File.Exists(path)) return null;
    230       //TODO handle IO Exceptions
    231230      string fileContent;
    232231      using (FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read)) {
     
    239238
    240239    public static void WriteFile(string path, string fileContent) {
    241       //TODO handle IO Exceptions
    242240      using (FileStream fileStream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.Write)) {
    243241        using (StreamWriter streamWriter = new StreamWriter(fileStream)) {
Note: See TracChangeset for help on using the changeset viewer.