Crabwise.CommandWrap.SyntaxBuilder.BuildSyntax C# (CSharp) Méthode

BuildSyntax() private méthode

Checks to make sure the provided Command has a CommandSyntaxAttribute and then calls SyntaxBuilder.BuildCommandFromType
private BuildSyntax ( ) : void
Résultat void
        private void BuildSyntax()
        {
            this.arguments = new StringBuilder(32, 32767);
            var commandType = this.command.GetType();
            var syntaxAttribute = this.GetSyntaxAttribute(commandType);
            if (syntaxAttribute == null || !(syntaxAttribute is CommandSyntaxAttribute))
            {
                const string MESSAGE = "The provided command doesn't have a CommandSyntaxAttribute.";
                throw new SyntaxException(MESSAGE, null);
            }

            try
            {
                this.BuildCommandFromType(commandType, this.command);
            }
            catch (ArgumentOutOfRangeException e)
            {
                const string MESSAGE = "The length of this command is too long. Process start strings are limited to " +
                    "32767 characters.";
                throw new SyntaxException(MESSAGE, e);
            }

            this.Arguments = this.arguments.ToString().Trim();
        }