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();
}