protected virtual void Dispose( bool disposing ) { DEBUG.IndentLine( "\n-- KCommand.Dispose( Disposing={0} ) - This={1}", disposing, this ); if( _Parameters != null ) { _Parameters.Dispose(); _Parameters = null; } if( _Parser != null ) { _Parser.Dispose(); _Parser = null; } _Link = null; DEBUG.Unindent(); }
/// <summary> /// Creates a new <see cref="KCommand"/> associated with the given link. /// </summary> /// <param name="link">The link this command is associated with.</param> protected KCommand( IKLink link ) { DEBUG.IndentLine( "\n-- KCommand( Link={0} )", link == null ? "null" : link.ToString() ); if( ( _Link = link ) == null ) throw new ArgumentNullException( "link", "Link cannot be null." ); if( ( _Parameters = _Link.Factory.CreateParameterList() ) == null ) throw new InvalidOperationException( "Cannot create a List of Parameters." ); if( ( _Parser = _Link.Factory.CreateParser() ) == null ) throw new InvalidOperationException( "Cannot create a Parser." ); DEBUG.Unindent(); }