Changeset 2547 for trunk/sources/HeuristicLab.Core.Views/3.3
- Timestamp:
- 12/08/09 02:35:40 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Core.Views/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core.Views/3.3/IItemView.cs
r2546 r2547 40 40 /// </summary> 41 41 event EventHandler ItemChanged; 42 43 event EventHandler Closed; 42 44 } 43 45 } -
trunk/sources/HeuristicLab.Core.Views/3.3/ItemViewBase.cs
r2546 r2547 56 56 } 57 57 } 58 private string myCaption;59 /// <summary>60 /// Gets or sets the caption of the current instance.61 /// </summary>62 /// <remarks>Call <see cref="OnCaptionChanged"/> in the setter if a new item is set.</remarks>63 public string Caption {64 get { return myCaption; }65 set {66 if (value != myCaption) {67 myCaption = value;68 OnCaptionChanged();69 }70 }71 }72 58 73 59 /// <summary> … … 97 83 public override void Refresh() { 98 84 if (InvokeRequired) { 99 Invoke(new MethodInvoker(Refresh));85 Invoke(new Action(Refresh)); 100 86 } else { 101 87 UpdateControls(); … … 110 96 Caption = "View"; 111 97 else 112 Caption = "View (" + Item.GetType().Name + ")";98 Caption = Item.Name; 113 99 114 100 } … … 125 111 ItemChanged(this, new EventArgs()); 126 112 } 127 /// <summary> 128 /// Occurs when the current caption was changed. 129 /// </summary> 130 public event EventHandler CaptionChanged; 131 /// <summary> 132 /// Fires a new <c>CaptionChanged</c> event. 133 /// </summary> 134 protected virtual void OnCaptionChanged() { 135 if (CaptionChanged != null) 136 CaptionChanged(this, new EventArgs()); 113 114 public event EventHandler Closed; 115 public override void OnClosed(object sender, EventArgs e) { 116 base.OnClosed(sender, e); 117 if (Closed != null) 118 Closed(this, e); 137 119 } 138 120
Note: See TracChangeset
for help on using the changeset viewer.