Require() public static method

Parameter is required (may not be null).
If contract fails.
public static Require ( object value, string messageOrParamName ) : void
value object parameter value.
messageOrParamName string parameter name, or a error message.
return void
        /// <summary>
        /// Initializes a new instance of the <see cref="RequestEventArgs"/> class.
        /// </summary>
        /// <param name="request">The request.</param>
        public RequestEventArgs(IHttpRequest request)
        {
            Check.Require(request, "request");

            Request = request;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="DisconnectedEventArgs"/> class.
        /// </summary>
        /// <param name="error">Reason to disconnection.</param>
        public DisconnectedEventArgs(SocketError error)
        {
            Check.Require(error, "error");

            Error = error;
        }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HttpServer"/> class.
 /// </summary>
 /// <param name="logWriter">The log writer.</param>
 /// <seealso cref="LogWriter"/>
 public HttpServer(ILogWriter logWriter)
 {
     Check.Require(logWriter, "logWriter");
     _components = new ComponentFactory();
     _components.AddInstance <ILogWriter>(logWriter);
 }
Beispiel #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HttpServer"/> class.
 /// </summary>
 /// <param name="decoderProvider">Form decoders are used to convert different types of posted data to the <see cref="HttpInput"/> object types.</param>
 /// <seealso cref="IFormDecoder"/>
 /// <seealso cref="FormDecoderProviders"/>
 public HttpServer(FormDecoderProvider decoderProvider)
 {
     Check.Require(decoderProvider, "decoderProvider");
     _components = new ComponentFactory();
     _components.AddInstance <FormDecoderProvider>(decoderProvider);
 }
Beispiel #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HttpServer"/> class.
 /// </summary>
 /// <param name="sessionStore">A session store is used to save and retrieve sessions</param>
 /// <seealso cref="IHttpSessionStore"/>
 public HttpServer(IHttpSessionStore sessionStore)
 {
     Check.Require(sessionStore, "sessionStore");
     _components = new ComponentFactory();
     _components.AddInstance <IHttpSessionStore>(sessionStore);
 }