public CloseEditorEventArgs( CloseEditorEventType type ) { _type = type; }
private void RaiseCloseRequested( CloseEditorEventType closeEditorEventType ) { EventHandler<CloseEditorEventArgs> closeRequested = CloseRequested; if ( closeRequested != null ) closeRequested( this, new CloseEditorEventArgs( closeEditorEventType ) ); }
private Func<PasswordEditorViewModel, bool> CloseRequestPredicate( PasswordEditorViewModel source, CloseEditorEventType type ) { switch ( type ) { case CloseEditorEventType.Self: return e => e == source; case CloseEditorEventType.All: return e => true; case CloseEditorEventType.AllButSelf: return e => e != source; case CloseEditorEventType.RightOfSelf: return e => Editors.IndexOf( e ) > Editors.IndexOf( source ); case CloseEditorEventType.Insecure: return e => e.RequiredGuidColor == e.ActualGuidColor && e.RequiredGuidColor != Colors.Transparent; default: throw new ArgumentOutOfRangeException( "type" ); } }