1
2
3
4
5
6
    private EventHandler<StateChangedEventArgs> _stateChanged;
    public event EventHandler<StateChangedEventArgs> StateChanged
    {
        add { lock (this._stateChanged) { this._stateChanged += value; } }
        remove { lock (this._stateChanged) { this._stateChanged -= value; } }
    }