Free cookie consent management tool by TermsFeed Policy Generator

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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.