Changeset 9695 for trunk/sources
- Timestamp:
- 07/04/13 14:03:58 (11 years ago)
- Location:
- trunk/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleArrayView.cs
r9657 r9695 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 } -
trunk/sources/HeuristicLab.Data/3.3/StringArray.cs
r9692 r9695 51 51 if (value == null || !value.Any()) 52 52 elementNames = new List<string>(); 53 else if (value.Count() !=Length)54 throw new ArgumentException(" An element name must be specified for each element.");53 else if (value.Count() > Length) 54 throw new ArgumentException("The number of element names must not exceed the array length."); 55 55 else 56 56 elementNames = new List<string>(value); … … 67 67 while (elementNames.Count > value) 68 68 elementNames.RemoveAt(elementNames.Count - 1); 69 if (elementNames.Any()) {70 while (elementNames.Count < value)71 elementNames.Add("Element " + elementNames.Count);72 }73 69 OnElementNamesChanged(); 74 70 OnReset(); -
trunk/sources/HeuristicLab.Data/3.3/ValueTypeArray.cs
r9692 r9695 51 51 if (value == null || !value.Any()) 52 52 elementNames = new List<string>(); 53 else if (value.Count() !=Length)54 throw new ArgumentException(" An element name must be specified for each element.");53 else if (value.Count() > Length) 54 throw new ArgumentException("The number of element names must not exceed the array length."); 55 55 else 56 56 elementNames = new List<string>(value); … … 69 69 while (elementNames.Count > value) 70 70 elementNames.RemoveAt(elementNames.Count - 1); 71 if (elementNames.Any()) {72 while (elementNames.Count < value)73 elementNames.Add("Element " + elementNames.Count);74 }75 71 OnElementNamesChanged(); 76 72 OnReset();
Note: See TracChangeset
for help on using the changeset viewer.