/// <summary> /// Detaches the specified observer from this <see cref="MessageBoard"/> so that it will no /// longer receive notification updates. /// </summary> /// <param name="observer">The observer to detach from this <see cref="MessageBoard"/>. /// </param> /// <exception cref="ArgumentNullException"><paramref name="observer"/> is /// <see langword="null"/>.</exception> public void Detach(IMessageBoardObserver observer) { ParameterValidation.IsNotNull(observer, nameof(observer)); this.observers.Remove(observer); }
public void TestNullValidationPass() { var testObject = new List <string>(); ParameterValidation.IsNotNull(testObject, nameof(testObject)); }
/// <inheritdoc/> public int GetValue(Orange input) { ParameterValidation.IsNotNull(input, nameof(input)); return(input.Quality); }
/// <summary> /// Initializes a new instance of the <see cref="ExitCommand"/> class. /// </summary> /// <param name="commandLoop">The <see cref="CommandLoop"/> that this /// <see cref="ExitCommand"/> will cause to exit.</param> /// <exception cref="ArgumentNullException"><paramref name="commandLoop"/> is /// <see langword="null"/>.</exception> public ExitCommand(CommandLoop commandLoop) { ParameterValidation.IsNotNull(commandLoop, nameof(commandLoop)); this.commandLoop = commandLoop; }
/// <summary> /// Initializes a new instance of the <see cref="SortStrategyResolver{T}"/> class. /// </summary> /// <param name="sortStrategies">The keyed collection of available /// <see cref="ISortStrategy{T}"/> types.</param> /// <exception cref="ArgumentNullException"><paramref name="sortStrategies"/> is /// <see langword="null"/>.</exception> public SortStrategyResolver(IIndex <SortType, ISortStrategy <T> > sortStrategies) { ParameterValidation.IsNotNull(sortStrategies, nameof(sortStrategies)); this.sortStrategies = sortStrategies; }
/// <summary> /// Initializes a new instance of the <see cref="ImplicitArgumentConverter"/> class. /// </summary> /// <param name="implicitOperator">The <see cref="MethodInfo"/> which describes the implicit /// operator to use to convert an argument.</param> /// <exception cref="ArgumentNullException"><paramref name="implicitOperator"/> is /// <see langword="null"/>.</exception> public ImplicitArgumentConverter(MethodInfo implicitOperator) { ParameterValidation.IsNotNull(implicitOperator, nameof(implicitOperator)); this.implicitOperator = implicitOperator; }
/// <summary> /// Initializes a new instance of the <see cref="RobotCommand"/> class. /// </summary> /// <param name="robot">The <see cref="IRobot"/> that this <see cref="RobotCommand"/> will /// execute on.</param> /// <exception cref="ArgumentNullException"><paramref name="robot"/> is /// <see langword="null"/>.</exception> protected RobotCommand(IRobot robot) { ParameterValidation.IsNotNull(robot, nameof(robot)); this.Robot = robot; }
/// <summary> /// Initializes a new instance of the <see cref="CommandResolver"/> class. /// </summary> /// <param name="commandFactory">The <see cref="CommandFactory"/> to use to create /// instances of <see cref="ICommand"/>.</param> /// <exception cref="ArgumentNullException"><paramref name="commandFactory"/> is /// <see langword="null"/>.</exception> public CommandResolver(CommandFactory commandFactory) { ParameterValidation.IsNotNull(commandFactory, nameof(commandFactory)); this.commandFactory = commandFactory; }
/// <summary> /// Initializes a new instance of the <see cref="ParameterTypeFavoringConstructorQuery"/> /// class. /// </summary> /// <param name="parameterTypes">An array of <see cref="Type"/> objects representing the /// number, order, and type of the parameters for the desired constructor.</param> /// <exception cref="ArgumentNullException"><paramref name="parameterTypes"/> is /// <see langword="null"/>.</exception> public ParameterTypeFavoringConstructorQuery(params Type[] parameterTypes) { ParameterValidation.IsNotNull(parameterTypes, nameof(parameterTypes)); this.parameterTypes = parameterTypes; }
/// <summary> /// Initializes a new instance of the <see cref="ConnectionStringDbContextFactory" /> class /// which will use the specified connection string factory. /// </summary> /// <param name="connectionStringFactory">The factory to create a connection string from. /// </param> /// <exception cref="ArgumentNullException"><paramref name="connectionStringFactory"/> is /// <see langword="null"/>.</exception> public ConnectionStringDbContextFactory(Func <string> connectionStringFactory) { ParameterValidation.IsNotNull(connectionStringFactory, nameof(connectionStringFactory)); this.connectionStringFactory = connectionStringFactory; }
/// <summary> /// Initializes a new instance of the <see cref="FacadeExample"/> class. /// </summary> /// <param name="goldMine">The <see cref="GoldMine"/> to use in this example.</param> public FacadeExample(GoldMine goldMine) { ParameterValidation.IsNotNull(goldMine, nameof(goldMine)); this.goldMine = goldMine; }
/// <summary> /// Initializes a new instance of the <see cref="DataModule"/> class which will use /// the specified connection string factory. /// </summary> /// <param name="connectionStringFactory">The connection string factory.</param> /// <exception cref="ArgumentNullException"><paramref name="connectionStringFactory"/> is /// <see langword="null"/>.</exception> public DataModule(IConnectionStringFactory connectionStringFactory) { ParameterValidation.IsNotNull(connectionStringFactory, nameof(connectionStringFactory)); this.connectionStringFactory = connectionStringFactory.CreateConnectionString; }
/// <summary> /// Initializes a new instance of the <see cref="DataModule"/> class which will use /// the specified connection string factory. /// </summary> /// <param name="connectionStringFactory">The connection string factory.</param> /// <exception cref="ArgumentNullException"><paramref name="connectionStringFactory"/> is /// <see langword="null"/>.</exception> public DataModule(Func <string> connectionStringFactory) { ParameterValidation.IsNotNull(connectionStringFactory, nameof(connectionStringFactory)); this.connectionStringFactory = connectionStringFactory; }