- Timestamp:
- 01/28/10 16:15:21 (15 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.MainForm/3.2/ActionUserInterfaceItem.cs
r2687 r2696 26 26 27 27 namespace HeuristicLab.MainForm { 28 public abstract class UserInterfaceItemBase : IUserInterfaceItem{ 29 protected UserInterfaceItemBase() { 28 public abstract class ActionUserInterfaceItem : PositionableUserInterfaceItem, IActionUserInterfaceItem { 29 protected ActionUserInterfaceItem() { 30 MainFormManager.MainForm.ActiveViewChanged += this.OnActiveViewChanged; 31 MainFormManager.MainForm.Changed += this.OnMainFormChanged; 32 MainFormManager.MainForm.ViewShown += this.OnViewShown; 33 MainFormManager.MainForm.ViewClosed += this.OnViewClosed; 30 34 } 31 35 32 36 public abstract string Name { get; } 33 public abstract int Position { get; }34 37 35 38 public virtual System.Drawing.Image Image { … … 43 46 public abstract void Execute(); 44 47 45 p ublic virtual voidActiveViewChanged(object sender, EventArgs e) {48 protected virtual void OnActiveViewChanged(object sender, EventArgs e) { 46 49 } 47 50 48 p ublic virtual void ViewChanged(object sender, EventArgs e) {51 protected virtual void OnMainFormChanged(object sender, EventArgs e) { 49 52 } 50 53 51 p ublic virtual void MainFormChanged(object sender, EventArgs e) {54 protected virtual void OnViewChanged(object sender, EventArgs e) { 52 55 } 53 56 54 public virtual void MainFormInitialized(object sender, EventArgs e) { 57 private void OnViewShown(object sender, ViewShownEventArgs e) { 58 if (e.FirstTimeShown) 59 e.View.Changed += this.OnViewChanged; 60 } 61 62 private void OnViewClosed(object sender, ViewEventArgs e) { 63 e.View.Changed -= this.OnViewChanged; 55 64 } 56 65 }
Note: See TracChangeset
for help on using the changeset viewer.