Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/15/10 01:34:27 (15 years ago)
Author:
mkommend
Message:

implemented first version of View.ReadOnly and adapted some views to the new mechanism (ticket #973)

Location:
trunk/sources/HeuristicLab.MainForm/3.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.MainForm/3.2/Interfaces/IView.cs

    r2790 r3350  
    3030    bool IsShown { get; }
    3131    string Caption { get; set; }
     32    bool ReadOnly { get; set; }
     33    event EventHandler ReadOnlyChanged;
    3234    event EventHandler CaptionChanged;
    3335    event EventHandler Changed;
  • trunk/sources/HeuristicLab.MainForm/3.2/MainFormManager.cs

    r3278 r3350  
    148148      return (IView)Activator.CreateInstance(t, content);
    149149    }
     150    public static IView CreateDefaultView(object content, bool readOnly) {
     151      IView view = CreateDefaultView(content);
     152      if (view != null)
     153        view.ReadOnly = readOnly;
     154      return null;
     155    }
    150156
    151157    public static IView CreateView(Type viewType) {
     
    156162
    157163      return (IView)Activator.CreateInstance(viewType);
     164    }
     165    public static IView CreateView(Type viewType, bool readOnly) {
     166      IView view = CreateView(viewType);
     167      view.ReadOnly = readOnly;
     168      return view;
    158169    }
    159170
     
    166177
    167178      return (IView)Activator.CreateInstance(view, content);
     179    }
     180    public static IView CreateView(Type viewType, object content, bool readOnly) {
     181      IView view = CreateView(viewType, content);
     182      view.ReadOnly = readOnly;
     183      return view;
    168184    }
    169185
Note: See TracChangeset for help on using the changeset viewer.