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.

Location:
branches/HeuristicLab.Data Path DataTypes/HeuristicLab.Data.Views/3.3
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Data Path DataTypes/HeuristicLab.Data.Views/3.3/HeuristicLab.Data.Views-3.3.csproj

    r9689 r9697  
    242242  </ItemGroup>
    243243  <ItemGroup>
    244     <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
    245       <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>
    246       <Name>HeuristicLab.Data-3.3</Name>
    247       <Private>False</Private>
    248     </ProjectReference>
    249   </ItemGroup>
    250   <ItemGroup>
    251244    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
    252245      <Visible>False</Visible>
     
    264257      <Install>true</Install>
    265258    </BootstrapperPackage>
     259  </ItemGroup>
     260  <ItemGroup>
     261    <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
     262      <Project>{bbab9df5-5ef3-4ba8-ade9-b36e82114937}</Project>
     263      <Name>HeuristicLab.Data-3.3</Name>
     264    </ProjectReference>
    266265  </ItemGroup>
    267266  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  • branches/HeuristicLab.Data Path DataTypes/HeuristicLab.Data.Views/3.3/Path Views/DirectoryValueView.cs

    r9680 r9697  
    4747    protected override void SetEnabledStateOfControls() {
    4848      base.SetEnabledStateOfControls();
    49       valueTextBox.ReadOnly = Locked || ReadOnly || Content == null || Content.CheckExistence;
     49      valueTextBox.Enabled = !Locked && !ReadOnly && Content != null;
     50      valueTextBox.ReadOnly = Locked || ReadOnly || Content == null;
    5051      openButton.Enabled = !Locked && !ReadOnly && Content != null;
    5152    }
     
    6465    protected virtual void openButton_Click(object sender, EventArgs e) {
    6566      if (folderBrowserDialog.ShowDialog(this) != DialogResult.OK) return;
    66 
    67       valueTextBox.Text = folderBrowserDialog.SelectedPath;
    68       valueTextBox.Focus();
    69       Validate();
     67      Content.Value = folderBrowserDialog.SelectedPath;
    7068    }
    7169  }
  • branches/HeuristicLab.Data Path DataTypes/HeuristicLab.Data.Views/3.3/Path Views/FileValueView.cs

    r9680 r9697  
    2222using System;
    2323using System.Windows.Forms;
    24 using HeuristicLab.Data.Views;
    2524using HeuristicLab.MainForm;
    2625
     
    5655    protected override void SetEnabledStateOfControls() {
    5756      base.SetEnabledStateOfControls();
    58       valueTextBox.Enabled = !Locked && !ReadOnly && Content != null && !Content.CheckExistence;
    59       valueTextBox.ReadOnly = Locked || ReadOnly || Content == null || Content.CheckExistence;
     57      valueTextBox.Enabled = !Locked && !ReadOnly && Content != null;
     58      valueTextBox.ReadOnly = Locked || ReadOnly || Content == null;
    6059      openButton.Enabled = !Locked && !ReadOnly && Content != null;
    6160    }
  • 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)) {
  • branches/HeuristicLab.Data Path DataTypes/HeuristicLab.Data.Views/3.3/StringConvertibleArrayView.cs

    r9657 r9697  
    2323using System.ComponentModel;
    2424using System.Drawing;
    25 using System.Linq;
    2625using System.Text;
    2726using System.Windows.Forms;
     
    105104
    106105    protected virtual void UpdateRowHeaders() {
    107       for (int i = 0; i < dataGridView.RowCount; i++) {
    108         if (i < Content.ElementNames.Count())
    109           dataGridView.Rows[i].HeaderCell.Value = Content.ElementNames.ElementAt(i);
    110         else
    111           dataGridView.Rows[i].HeaderCell.Value = string.Empty;
     106      int i = 0;
     107      foreach (string elementName in Content.ElementNames) {
     108        dataGridView.Rows[i].HeaderCell.Value = elementName;
     109        i++;
     110      }
     111      for (; i < dataGridView.RowCount; i++) {
     112        dataGridView.Rows[i].HeaderCell.Value = string.Empty;
    112113      }
    113114    }
     
    124125        Invoke(new EventHandler<EventArgs<int>>(Content_ItemChanged), sender, e);
    125126      else {
     127        // if a resize of the array occurs and some other class handles the event and provides default values
     128        //then the itemChanged will occur before the reset event. hence the check was added
     129        if (dataGridView.RowCount <= e.Value) return;
    126130        dataGridView.Rows[e.Value].Cells[0].Value = Content.GetValue(e.Value);
    127131        Size size = dataGridView.Rows[e.Value].Cells[0].PreferredSize;
Note: See TracChangeset for help on using the changeset viewer.