Esempio n. 1
0
        public override void WriteUsage()
        {
            Console.WriteLine(this.Name + ": " + base.Description);
            Console.WriteLine(string.Empty);
            Console.WriteLine(CommandResources.GetString(CommandResources.ResourceID.Label_Usage));
            Console.WriteLine("  " + CommandResources.GetString(CommandResources.ResourceID.ProgramUsage));
            Console.WriteLine(string.Empty);
            NameValueCollection nameValueArgs = new NameValueCollection();
            List <Command>      list          = new List <Command>();

            list.Add(new DeployCommand(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());
            }
            Console.WriteLine(builder.ToString());
            Console.WriteLine(string.Empty);
            Console.WriteLine(this.Example);
            Console.WriteLine(string.Empty);
            Console.WriteLine(ConsoleHelper.Wrap(this.Notes, 2, Console.BufferWidth, -2));
            Console.WriteLine(string.Empty);
        }
Esempio n. 2
0
        protected override CommandLineArgDescriptorList GetParameterDescriptors()
        {
            CommandLineArgDescriptor[] collection = new CommandLineArgDescriptor[] {
                new CommandLineArgDescriptor(true, "NonEncryptedFile", CommandResources.GetString(CommandResources.ResourceID.ParamDesc_NonEncryptedFile), CommandLineArgDescriptor.ArgumentType.String),
                new CommandLineArgDescriptor(true, "CompanyName", CommandResources.GetString(CommandResources.ResourceID.ParamDesc_CompanyName), CommandLineArgDescriptor.ArgumentType.String),
                new CommandLineArgDescriptor(true, "Server", CommandResources.GetString(CommandResources.ResourceID.ParamDesc_Server), CommandLineArgDescriptor.ArgumentType.String),
                new CommandLineArgDescriptor(true, "Database", CommandResources.GetString(CommandResources.ResourceID.ParamDesc_Database), CommandLineArgDescriptor.ArgumentType.String),
                new CommandLineArgDescriptor(true, "Timeout", CommandResources.GetString(CommandResources.ResourceID.ParamDesc_Timeout), CommandLineArgDescriptor.ArgumentType.String)
            };
            CommandLineArgDescriptorList list = new CommandLineArgDescriptorList();

            list.AddRange(collection);
            return(list);
        }
Esempio n. 3
0
 public static void ValidateEncryptedFile(NameValueCollection nameValueArgs)
 {
     if ((nameValueArgs["NonEncryptedFile"] != null) && (nameValueArgs["NonEncryptedFile"].Length > 0))
     {
         System.IO.FileInfo fi = new System.IO.FileInfo(nameValueArgs["NonEncryptedFile"]);
         if (!fi.Exists)
         {
             throw new CommandLineArgumentException(CommandResources.GetFormattedString(CommandResources.ResourceID.NonEncryptedFileNotFound, new object[] { fi.FullName }), "NonEncryptedFile", System.Diagnostics.TraceLevel.Error);
         }
     }
     else
     {
         throw new CommandLineArgumentException(CommandResources.GetString(CommandResources.ResourceID.NonEncryptedFileNotSpecified), "NonEncryptedFile", System.Diagnostics.TraceLevel.Error);
     }
 }
Esempio n. 4
0
 public static void ValidateServerDatabase(NameValueCollection nameValueArgs)
 {
     Trace.WriteLine("Validating Server and Database parameters...");
     if ((nameValueArgs["Server"] != null) && (nameValueArgs["Server"].Length > 0))
     {
         if ((nameValueArgs["Database"] == null) || (nameValueArgs["Database"].Length == 0))
         {
             throw new CommandLineArgumentException(CommandResources.GetString(CommandResources.ResourceID.DatabaseNotSpecified), "Database", System.Diagnostics.TraceLevel.Error);
         }
     }
     else
     {
         bizilante.SSO.Helper.SSO sso = new bizilante.SSO.Helper.SSO();
         sso.GetSecretServerName();
         nameValueArgs.Set("Server", sso.DBServer);
         if ((nameValueArgs["Database"] == null) || (nameValueArgs["Database"].Length == 0))
         {
             nameValueArgs.Set("Database", sso.DB);
         }
     }
     ValidateServer(nameValueArgs["Server"]);
     ValidateDatabase(nameValueArgs["Database"]);
 }