示例#1
0
        public static void Run()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            BTSDeployForm.DeployForm form = new BTSDeployForm.DeployForm();
            form.SetLogging(true, LogsFolder); // by default we enable logging
            GUIBTSDeployPSHost host = new GUIBTSDeployPSHost(form);

            host.Initialize();
            Application.Run(form);
            if (host.Failed)
            {
                throw new Exception(host.ErrorMessage);
            }
            if (!host._workDone)
            {
                throw new Exception("Nothing done!");
            }
        }
示例#2
0
        public static void Run(NameValueCollection nameValueArgs)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            BTSDeployForm.DeployForm form = new BTSDeployForm.DeployForm();
            // We need to pass the info
            form.SetType(nameValueArgs["Type"]);
            form.SetInstallOn(nameValueArgs["Environment"]);
            form.SetApplication(nameValueArgs["Application"]);
            form.SetAdapter(nameValueArgs["Adapter"]);
            form.SetVersion(nameValueArgs["Version"]);
            if (!string.IsNullOrEmpty(nameValueArgs["Log"]))
            {
                form.SetLogging(Convert.ToBoolean(nameValueArgs["Log"]), LogsFolder);
            }
            else
            {
                form.SetLogging(true, LogsFolder); // by default we enable logging
            }
            // We need to set the action as last operation on the form.
            form.SetAction(nameValueArgs["Action"]);

            // Initialize the Powershell host
            GUIBTSDeployPSHost host = new GUIBTSDeployPSHost(form);

            host.Initialize();
            Application.Run(form);
            if (host.Failed)
            {
                throw new Exception(host.ErrorMessage);
            }
            if (!host._workDone)
            {
                throw new Exception("Nothing done!");
            }
        }