Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/20/10 02:02:39 (14 years ago)
Author:
swagner
Message:

Added ReadOnly property to all items of HeuristicLab.Data (#969)

Location:
trunk/sources/HeuristicLab.Data.Views/3.3
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Data.Views/3.3/BoolValueView.cs

    r3362 r3430  
    3232      get { return (BoolValue)base.Content; }
    3333      set { base.Content = value; }
     34    }
     35
     36    public override bool ReadOnly {
     37      get {
     38        if ((Content != null) && Content.ReadOnly) return true;
     39        return base.ReadOnly;
     40      }
     41      set { base.ReadOnly = value; }
    3442    }
    3543
     
    8290
    8391    private void valueCheckBox_CheckedChanged(object sender, EventArgs e) {
    84       Content.Value = valueCheckBox.Checked;
     92      if (!Content.ReadOnly) Content.Value = valueCheckBox.Checked;
    8593    }
    8694  }
  • trunk/sources/HeuristicLab.Data.Views/3.3/ComparisonView.cs

    r3362 r3430  
    3232      get { return (Comparison)base.Content; }
    3333      set { base.Content = value; }
     34    }
     35
     36    public override bool ReadOnly {
     37      get {
     38        if ((Content != null) && Content.ReadOnly) return true;
     39        return base.ReadOnly;
     40      }
     41      set { base.ReadOnly = value; }
    3442    }
    3543
     
    8290
    8391    private void valueComboBox_SelectedIndexChanged(object sender, EventArgs e) {
    84       if (Content != null) Content.Value = (ComparisonType)valueComboBox.SelectedItem;
     92      if ((Content != null) && !Content.ReadOnly) Content.Value = (ComparisonType)valueComboBox.SelectedItem;
    8593    }
    8694  }
  • trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleArrayView.cs

    r3362 r3430  
    3535      get { return (IStringConvertibleArray)base.Content; }
    3636      set { base.Content = value; }
     37    }
     38
     39    public override bool ReadOnly {
     40      get {
     41        if ((Content != null) && Content.ReadOnly) return true;
     42        return base.ReadOnly;
     43      }
     44      set { base.ReadOnly = value; }
    3745    }
    3846
     
    133141    }
    134142    private void lengthTextBox_Validated(object sender, EventArgs e) {
    135       Content.Length = int.Parse(lengthTextBox.Text);
     143      if (!Content.ReadOnly) Content.Length = int.Parse(lengthTextBox.Text);
    136144      errorProvider.SetError(lengthTextBox, string.Empty);
    137145    }
  • trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixView.cs

    r3362 r3430  
    3434  [Content(typeof(IStringConvertibleMatrix), true)]
    3535  public partial class StringConvertibleMatrixView : AsynchronousContentView {
     36    private int[] virtualRowIndizes;
     37    private List<KeyValuePair<int, SortOrder>> sortedColumnIndizes;
     38    private RowComparer rowComparer;
     39
    3640    public new IStringConvertibleMatrix Content {
    3741      get { return (IStringConvertibleMatrix)base.Content; }
     
    3943    }
    4044
    41     private int[] virtualRowIndizes;
    42     private List<KeyValuePair<int, SortOrder>> sortedColumnIndizes;
    43     RowComparer rowComparer;
     45    public override bool ReadOnly {
     46      get {
     47        if ((Content != null) && Content.ReadOnly) return true;
     48        return base.ReadOnly;
     49      }
     50      set { base.ReadOnly = value; }
     51    }
    4452
    4553    public StringConvertibleMatrixView() {
     
    6674      base.DeregisterContentEvents();
    6775    }
    68 
    6976    protected override void RegisterContentEvents() {
    7077      base.RegisterContentEvents();
     
    7582      Content.ReadOnlyViewChanged += new EventHandler(Content_ReadOnlyViewChanged);
    7683    }
    77 
    7884
    7985    protected override void OnContentChanged() {
     
    204210    }
    205211    private void rowsTextBox_Validated(object sender, EventArgs e) {
    206       int textBoxValue = int.Parse(rowsTextBox.Text);
    207       if (textBoxValue != Content.Rows)
    208         Content.Rows = textBoxValue;
     212      if (!Content.ReadOnly) Content.Rows = int.Parse(rowsTextBox.Text);
    209213      errorProvider.SetError(rowsTextBox, string.Empty);
    210214    }
     
    226230    }
    227231    private void columnsTextBox_Validated(object sender, EventArgs e) {
    228       int textBoxValue = int.Parse(columnsTextBox.Text);
    229       if (textBoxValue != Content.Columns)
    230         Content.Columns = textBoxValue;
     232      if (!Content.ReadOnly) Content.Columns = int.Parse(columnsTextBox.Text);
    231233      errorProvider.SetError(columnsTextBox, string.Empty);
    232234    }
  • trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleValueView.cs

    r3402 r3430  
    3333      get { return (IStringConvertibleValue)base.Content; }
    3434      set { base.Content = value; }
     35    }
     36
     37    public override bool ReadOnly {
     38      get {
     39        if ((Content != null) && Content.ReadOnly) return true;
     40        return base.ReadOnly;
     41      }
     42      set { base.ReadOnly = value; }
    3543    }
    3644
     
    103111    }
    104112    private void valueTextBox_Validated(object sender, EventArgs e) {
    105       Content.SetValue(valueTextBox.Text);
     113      if (!Content.ReadOnly) Content.SetValue(valueTextBox.Text);
    106114      errorProvider.SetError(valueTextBox, string.Empty);
    107115      valueTextBox.Text = Content.GetValue();
Note: See TracChangeset for help on using the changeset viewer.