1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using System;
- namespace Microsoft.Windows.Forms
- {
- public partial class Sprite
- {
-
-
-
- private static readonly object EVENT_STATE_CHANGED = new object();
- private State m_State = State.Normal;
-
-
-
- public State State
- {
- get
- {
- return this.m_State;
- }
- set
- {
- if (value != this.m_State)
- {
- this.m_State = value;
- this.Feedback();
- this.OnStateChanged(EventArgs.Empty);
- }
- }
- }
-
-
-
- public event EventHandler StateChanged
- {
- add { this.Events.AddHandler(EVENT_STATE_CHANGED, value); }
- remove { this.Events.RemoveHandler(EVENT_STATE_CHANGED, value); }
- }
-
-
-
-
- protected virtual void OnStateChanged(EventArgs e)
- {
- EventHandler handler = this.Events[EVENT_STATE_CHANGED] as EventHandler;
- if (handler != null)
- handler(this, e);
- }
- }
- }
|