Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ServerOptionBuilder"/> class
 /// </summary>
 /// <param name="commandLine">Options provided on the command line.</param>
 /// <param name="options">Options for configuring validation.</param>
 private ServerOptionBuilder(
     ServerCommandLine commandLine,
     ServerOptionBuilderOptions options)
 {
     _commandLine = commandLine;
     _options     = options;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Build an instance of <see cref="ServerOptions"/> from the information supplied on the
        /// command line by the user
        /// </summary>
        /// <param name="commandLine">Command line parameters supplied by the user.</param>
        /// <param name="options">Options for configuring validation.</param>
        /// <returns>Either a usable (and completely valid) <see cref="ServerOptions"/> or a set
        /// of errors.</returns>
        public static Errorable <ServerOptions> Build(
            ServerCommandLine commandLine,
            ServerOptionBuilderOptions options = ServerOptionBuilderOptions.None)
        {
            var builder = new ServerOptionBuilder(commandLine, options);

            return(builder.Build());
        }