public override void WriteUsage() { System.Console.WriteLine(this.Name + ": " + base.Description); System.Console.WriteLine(string.Empty); System.Console.WriteLine(CommandResources.GetString(CommandResources.ResourceID.Label_Usage)); System.Console.WriteLine(" " + CommandResources.GetString(CommandResources.ResourceID.ProgramUsage)); System.Console.WriteLine(string.Empty); NameValueCollection nameValueArgs = new NameValueCollection(); List <Command> list = new List <Command>(); list.Add(new BTSDeployAppCommand(nameValueArgs)); list.Add(new BTSDeployCommand(nameValueArgs)); StringBuilder builder = new StringBuilder(); string str4 = CommandResources.GetString(CommandResources.ResourceID.Label_Commands); builder.Append(str4); foreach (Command command in list) { builder.Append(Environment.NewLine); builder.Append(command.GetSummary()); } System.Console.WriteLine(builder.ToString()); System.Console.WriteLine(string.Empty); System.Console.WriteLine(this.Example); System.Console.WriteLine(string.Empty); System.Console.WriteLine(ConsoleHelper.Wrap(this.Notes, 2, System.Console.BufferWidth, -2)); System.Console.WriteLine(string.Empty); }
public override void Execute() { try { #if DEBUG System.Diagnostics.Debugger.Launch(); #endif this.Validate(); string app = base.Args["Application"]; string formattedString = CommandResources.GetFormattedString(CommandResources.ResourceID.DeployApp, new object[] { string.IsNullOrEmpty(app) ? "Adapter" : "Application", string.IsNullOrEmpty(app) ? base.Args["Adapter"] : base.Args["Application"], base.Args["Action"] }); base.WriteLogEntry(LogEntryType.Information, formattedString); // Deploy the BizTalk application GUIBTSDeployPSHost.Run(base.Args); formattedString = CommandResources.GetFormattedString(CommandResources.ResourceID.DeployAppSuccess, new object[] { string.IsNullOrEmpty(app) ? "Adapter" : "Application", string.IsNullOrEmpty(app) ? base.Args["Adapter"] : base.Args["Application"], base.Args["Action"] }); base.WriteLogEntry(LogEntryType.Information, formattedString); base.commandResult = new CommandResult(); } catch (Exception exception2) { base.ShowError(exception2); base.commandResult = new CommandResult(exception2); if (((exception2 is OutOfMemoryException) || (exception2 is StackOverflowException))) { throw; } } }
protected override CommandLineArgDescriptorList GetParameterDescriptors() { string paramDesc_Type = CommandResources.GetString(CommandResources.ResourceID.ParamDesc_Type); paramDesc_Type += "[" + ConfigurationManager.AppSettings["Type"] + "]"; string paramDesc_Action = CommandResources.GetString(CommandResources.ResourceID.ParamDesc_Action); paramDesc_Action += "[" + ConfigurationManager.AppSettings["Action"] + "]"; CommandLineArgDescriptor[] collection = new CommandLineArgDescriptor[] { new CommandLineArgDescriptor(true, "Type", paramDesc_Type, CommandLineArgDescriptor.ArgumentType.String), new CommandLineArgDescriptor(true, "Environment", CommandResources.GetString(CommandResources.ResourceID.ParamDesc_Environment), CommandLineArgDescriptor.ArgumentType.String), new CommandLineArgDescriptor(true, "Application", CommandResources.GetString(CommandResources.ResourceID.ParamDesc_Application), CommandLineArgDescriptor.ArgumentType.String), new CommandLineArgDescriptor(true, "Version", CommandResources.GetString(CommandResources.ResourceID.ParamDesc_Version), CommandLineArgDescriptor.ArgumentType.String), new CommandLineArgDescriptor(true, "Adapter", CommandResources.GetString(CommandResources.ResourceID.ParamDesc_Adapter), CommandLineArgDescriptor.ArgumentType.String), new CommandLineArgDescriptor(true, "Action", paramDesc_Action, CommandLineArgDescriptor.ArgumentType.String), new CommandLineArgDescriptor(true, "Log", CommandResources.GetString(CommandResources.ResourceID.ParamDesc_Log), CommandLineArgDescriptor.ArgumentType.Boolean) }; CommandLineArgDescriptorList list = new CommandLineArgDescriptorList(); list.AddRange(collection); return(list); }
public override void Execute() { try { string[] values = base.Args.GetValues((string)null); if ((values != null) && (values.Length > 0)) { string str = values[0]; throw new CommandLineArgumentException(CommandResources.GetFormattedString(CommandResources.ResourceID.UnknownCommand, new object[] { str }), null, TraceLevel.Error); } this.WriteUsage(); base.commandResult = new CommandResult(); } catch (Exception exception) { Trace.WriteLine(exception.ToString()); base.WriteLogEntry(LogEntryType.Error, exception.Message); base.commandResult = new CommandResult(exception); if ((exception is OutOfMemoryException) || (exception is StackOverflowException)) { throw; } } }
public override void WriteUsageHint() { System.Console.WriteLine(CommandResources.GetFormattedString(CommandResources.ResourceID.ProgramUsageHint, new object[] { this.Name })); }