Exemplo n.º 1
0
        internal Commands()
        {
            Add(new Command("diag", "", "Shows diagnostic message box", AssemblyRequired.No, null, null));

            CommandOptionDescriptions regOptions = new CommandOptionDescriptions();

            regOptions.Add(new CommandOptionDescription("RegisterArea", true, "system", true, new string[] { "system", "user" }));
            regOptions.Add(new CommandOptionDescription("RegisterCall", true, "on", true, new string[] { "off", "on" }));
            regOptions.Add(new CommandOptionDescription("CreateOfficeKeys", true, "off", true, new string[] { "off", "on" }));
            Add(new Command("reg", ":system|user:off|on:off|on", "Register Addin", AssemblyRequired.Yes, null, regOptions));

            CommandOptionDescriptions unregOptions = new CommandOptionDescriptions();

            unregOptions.Add(new CommandOptionDescription("UnRegisterArea", true, "auto", true, new string[] { "auto", "system", "user" }));
            unregOptions.Add(new CommandOptionDescription("UnRegisterCall", true, "on", true, new string[] { "off", "on" }));
            unregOptions.Add(new CommandOptionDescription("DeleteOfficeKeys", true, "off", true, new string[] { "off", "on" }));
            unregOptions.Add(new CommandOptionDescription("SuspendMissingAssemblyError", true, "true", true, new string[] { "true", "false" }));
            Add(new Command("unreg", ":system|user:off|on:off|on:true|false", "Unregister Addin", AssemblyRequired.Conditional, null, unregOptions));

            CommandOptionDescriptions regFileOptions = new CommandOptionDescriptions();

            regFileOptions.Add(new CommandOptionDescription("RegFileArea", false, "system", true, new string[] { "system", "user" }));
            regFileOptions.Add(new CommandOptionDescription("RegFileCall", false, "off", true, new string[] { "off", "on" }));
            regFileOptions.Add(new CommandOptionDescription("CreateOfficeKeys", false, "off", true, new string[] { "off", "on" }));
            regFileOptions.Add(new CommandOptionDescription("RegFilePath", false, null, false, null));
            Add(new Command("regfile", ":system|user:$path", "Generate a register(.reg)file", AssemblyRequired.Yes, null, regFileOptions));

            Add(new Command("help", ":console|window", "Show help content in console or messagebox", AssemblyRequired.No, new string[] { "?" }, null));
            Add(new Command("codebase", "", "Add or remove codebase entry in reg/unreg", AssemblyRequired.Conditional, null, null));

            CommandOptionDescriptions alertOptions = new CommandOptionDescriptions();

            alertOptions.Add(new CommandOptionDescription("AlertMode", true, "error", true, new string[] { "on", "off", "error" }));
            Add(new Command("alert", ":on|off|error", "Shows a message box at the end", AssemblyRequired.No, null, alertOptions));

            CommandOptionDescriptions signOptions = new CommandOptionDescriptions();

            signOptions.Add(new CommandOptionDescription("SignCheck", true, "off", true, new string[] { "warn", "error", "off" }));
            Add(new Command("sign", ":warn|error|off", "Throws an error or warning when the given assembly is not signed", AssemblyRequired.No, null, signOptions));

            CommandOptionDescriptions metricsOptions = new CommandOptionDescriptions();

            metricsOptions.Add(new CommandOptionDescription("MetricsOptions", true, "none", true, new string[] { "none", "con", "win" }));
            Add(new Command("metrics", ":none|con|win", "Analyze assembly", AssemblyRequired.Conditional, null, metricsOptions));

            CommandOptionDescriptions anyOptions = new CommandOptionDescriptions();

            anyOptions.Add(new CommandOptionDescription("AnyTag", false, null, false, null));
            Add(new Command("any", ":$any", "Indentity call for troubleshooting", AssemblyRequired.No, null, anyOptions));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Creates an instance of the class
 /// </summary>
 /// <param name="name">name of the command</param>
 /// <param name="argumentsSyntax">arguments description of the command</param>
 /// <param name="helpText">help text of the command</param>
 /// <param name="needAssemblyPath">the command need a path to an assembly</param>
 /// <param name="alias">additional alias names of the command</param>
 /// <param name="description">description/snytax validation of the command</param>
 internal Command(string name, string argumentsSyntax, string helpText, AssemblyRequired needAssemblyPath, IEnumerable <string> alias, CommandOptionDescriptions description)
 {
     if (null == name)
     {
         throw new ArgumentNullException("name");
     }
     if (null == helpText)
     {
         throw new ArgumentNullException("helpText");
     }
     Name             = name;
     HelpText         = helpText;
     NeedAssemblyPath = needAssemblyPath;
     Alias            = null != alias ? alias : new string[0];
     ArgumentsSyntax  = null != argumentsSyntax ? argumentsSyntax : "";
     Description      = description;
 }