- Timestamp:
- 07/05/13 10:50:47 (11 years ago)
- 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 242 242 </ItemGroup> 243 243 <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>251 244 <BootstrapperPackage Include="Microsoft.Net.Client.3.5"> 252 245 <Visible>False</Visible> … … 264 257 <Install>true</Install> 265 258 </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> 266 265 </ItemGroup> 267 266 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -
branches/HeuristicLab.Data Path DataTypes/HeuristicLab.Data.Views/3.3/Path Views/DirectoryValueView.cs
r9680 r9697 47 47 protected override void SetEnabledStateOfControls() { 48 48 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; 50 51 openButton.Enabled = !Locked && !ReadOnly && Content != null; 51 52 } … … 64 65 protected virtual void openButton_Click(object sender, EventArgs e) { 65 66 if (folderBrowserDialog.ShowDialog(this) != DialogResult.OK) return; 66 67 valueTextBox.Text = folderBrowserDialog.SelectedPath; 68 valueTextBox.Focus(); 69 Validate(); 67 Content.Value = folderBrowserDialog.SelectedPath; 70 68 } 71 69 } -
branches/HeuristicLab.Data Path DataTypes/HeuristicLab.Data.Views/3.3/Path Views/FileValueView.cs
r9680 r9697 22 22 using System; 23 23 using System.Windows.Forms; 24 using HeuristicLab.Data.Views;25 24 using HeuristicLab.MainForm; 26 25 … … 56 55 protected override void SetEnabledStateOfControls() { 57 56 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; 60 59 openButton.Enabled = !Locked && !ReadOnly && Content != null; 61 60 } -
branches/HeuristicLab.Data Path DataTypes/HeuristicLab.Data.Views/3.3/Path Views/TextFileView.cs
r9680 r9697 68 68 saveButton.Enabled = !Locked && !ReadOnly && Content != null && ChangedFileContent; 69 69 70 if (Content != null && File.Exists(Content.Value)) {70 if (Content != null && Content.Exists()) { 71 71 fileSystemWatcher.Filter = Path.GetFileName(Content.Value); 72 72 fileSystemWatcher.Path = Path.GetDirectoryName(Content.Value); … … 77 77 protected override void OnVisibleChanged(EventArgs e) { 78 78 //mkommend: necessary to update the textbox to detect intermediate file changes. 79 if (Visible ) UpdateTextBox();79 if (Visible && Content != null) UpdateTextBox(); 80 80 base.OnVisibleChanged(e); 81 81 } … … 228 228 public static string ReadFile(string path) { 229 229 if (!File.Exists(path)) return null; 230 //TODO handle IO Exceptions231 230 string fileContent; 232 231 using (FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read)) { … … 239 238 240 239 public static void WriteFile(string path, string fileContent) { 241 //TODO handle IO Exceptions242 240 using (FileStream fileStream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.Write)) { 243 241 using (StreamWriter streamWriter = new StreamWriter(fileStream)) { -
branches/HeuristicLab.Data Path DataTypes/HeuristicLab.Data.Views/3.3/StringConvertibleArrayView.cs
r9657 r9697 23 23 using System.ComponentModel; 24 24 using System.Drawing; 25 using System.Linq;26 25 using System.Text; 27 26 using System.Windows.Forms; … … 105 104 106 105 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; 112 113 } 113 114 } … … 124 125 Invoke(new EventHandler<EventArgs<int>>(Content_ItemChanged), sender, e); 125 126 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; 126 130 dataGridView.Rows[e.Value].Cells[0].Value = Content.GetValue(e.Value); 127 131 Size size = dataGridView.Rows[e.Value].Cells[0].PreferredSize;
Note: See TracChangeset
for help on using the changeset viewer.