Ejemplo n.º 1
0
        private static void PrintUsage()
        {
            string helpText = GetResource("CloudCopy.Help");

            helpText = helpText.Replace("~~CONFIGFILE~~", ConfigFileHandler.GetDefaultConfigFilePath());

            Console.Write(helpText);
        }
Ejemplo n.º 2
0
        private static C4CHttpClient CreateCloudClient(TargetDescription targetDescription)
        {
            IClientFactory factory = new ClientFactory();

            C4CHttpClient cloudClient;

            if (targetDescription.Hostname != string.Empty && targetDescription.Username != string.Empty)
            {
                cloudClient = factory.CreateC4CHttpClient(targetDescription.Hostname, new ConsoleCredentialHandler(targetDescription.Username));
            }
            else if (targetDescription.Hostname == string.Empty && targetDescription.Username == string.Empty)
            {
                ConfigFileHandler configFileHandler = new ConfigFileHandler();

                cloudClient = factory.CreateC4CHttpClient(configFileHandler.Hostname, configFileHandler);
            }
            else
            {
                throw new Exception("Either target username or target hostname missing.");
            }

            return(cloudClient);
        }