- Timestamp:
- 05/11/10 12:03:25 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core.Views/3.3/NamedItemView.cs
r3566 r3764 41 41 public NamedItemView() { 42 42 InitializeComponent(); 43 Caption = "NamedItem";44 43 errorProvider.SetIconAlignment(nameTextBox, ErrorIconAlignment.MiddleLeft); 45 44 errorProvider.SetIconPadding(nameTextBox, 2); … … 60 59 base.OnContentChanged(); 61 60 if (Content == null) { 62 Caption = "NamedItem";63 61 nameTextBox.Text = string.Empty; 64 62 descriptionTextBox.Text = string.Empty; 65 63 toolTip.SetToolTip(descriptionTextBox, string.Empty); 64 if (ViewAttribute.HasViewAttribute(this.GetType())) 65 this.Caption = ViewAttribute.GetViewName(this.GetType()); 66 else 67 this.Caption = "NamedItem View"; 66 68 } else { 67 Caption = Content.Name + " (" + Content.GetType().Name + ")";68 69 nameTextBox.Text = Content.Name; 69 70 descriptionTextBox.Text = Content.Description; 70 71 toolTip.SetToolTip(descriptionTextBox, Content.Description); 72 Caption = Content.Name; 71 73 } 72 74 SetEnabledStateOfControls(); … … 92 94 if (InvokeRequired) 93 95 Invoke(new EventHandler(Content_NameChanged), sender, e); 94 else 96 else { 95 97 nameTextBox.Text = Content.Name; 98 Caption = Content.Name; 99 } 96 100 } 97 101 protected virtual void Content_DescriptionChanged(object sender, EventArgs e) { … … 106 110 protected virtual void nameTextBox_Validating(object sender, CancelEventArgs e) { 107 111 if ((Content != null) && (Content.CanChangeName)) { 112 if (string.IsNullOrEmpty(nameTextBox.Text)) { 113 e.Cancel = true; 114 errorProvider.SetError(nameTextBox, "Name cannot be empty"); 115 nameTextBox.SelectAll(); 116 return; 117 } 108 118 Content.Name = nameTextBox.Text; 109 110 119 // check if variable name was set successfully 111 120 if (!Content.Name.Equals(nameTextBox.Text)) {
Note: See TracChangeset
for help on using the changeset viewer.