Example #1
0
        /// <summary>
        /// Validate Command Line Arguments
        /// </summary>
        /// <returns>true if arguments are valid</returns>
        private static bool ValidateArgs()
        {
            bool valid = true;

            // get the esri product code:
            try
            {
                int productCode = 0;

                if (ArgParser.Contains("-a"))
                {
                    string licenseProductCode = ArgParser.GetValue("-a");
                    productCode            = Convert.ToInt32(licenseProductCode);
                    ESRILicenseProductCode = (esriLicenseProductCode)productCode;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                valid = false;
            }

            if (ArgParser.Contains("-n"))
            {
                DomainName = ArgParser.GetValue("-n");
            }
            else
            {
                valid = false;
            }

            // verbose argument:
            try
            {
                Verbose = ArgParser.Contains("-v");
            }
            catch
            {
                Verbose = false;
            }

            return(valid);
        }