/// <summary> /// Called when checking if we can process the specified input. /// </summary> /// <param name="input">The input.</param> /// <returns>True if we can process the input, or false if we need to skip it.</returns> private bool OnCheckProcess(string input) { var handler = CheckProcess; // if we have an event handler, we should delegate this check to // someone else who can make the decision for us. if (handler != null) { var args = new CheckProcessEventArgs(input); handler.Invoke(this, args); return(!args.Skip); } // nobody to handle this, so let's assume we're not skipping it. return(true); }
/// <summary> /// Called when checking if we can process the specified input. /// </summary> /// <param name="input">The input.</param> /// <returns>True if we can process the input, or false if we need to skip it.</returns> private bool OnCheckProcess(string input) { var handler = CheckProcess; // if we have an event handler, we should delegate this check to // someone else who can make the decision for us. if (handler != null) { var args = new CheckProcessEventArgs(input); handler.Invoke(this, args); return !args.Skip; } // nobody to handle this, so let's assume we're not skipping it. return true; }