public ApplicationGeneralPropertyPageUI( ApplicationGeneralPropertyPage page ) { InitializeComponent(); this.Page = page; // If values change mark this as dirty. foreach( var tb in this.Controls.OfType<TextBox>() ) tb.TextChanged += ( s, a ) => this.IsDirty = true; foreach( var cb in this.Controls.OfType<CheckBox>() ) cb.CheckedChanged += ( s, a ) => this.IsDirty = true; }
public ApplicationGeneralPropertyPageUI(ApplicationGeneralPropertyPage page) { InitializeComponent(); this.Page = page; // If values change mark this as dirty. foreach (var tb in this.Controls.OfType <TextBox>()) { tb.TextChanged += (s, a) => this.IsDirty = true; } foreach (var cb in this.Controls.OfType <CheckBox>()) { cb.CheckedChanged += (s, a) => this.IsDirty = true; } }