Exemplo n.º 1
0
 public GUIBTSDeployPSHost(BTSDeployForm.DeployForm form)
     : base()
 {
     gui = form;
     gui.InvokeButton.Click  += new EventHandler(InvokeButton_Click);
     gui.RemoveButton.Click  += new EventHandler(RemoveButton_Click);
     gui.StopButton.Click    += new EventHandler(StopButton_Click);
     gui.StartButton.Click   += new EventHandler(StartButton_Click);
     gui.RecycleButton.Click += new EventHandler(RecycleButton_Click);
     Logging.Log             += new Logging.LogEventHandler(Logging_Log);
     instanceId = Guid.NewGuid();
     version    = new Version("1.0.0.0");
 }
Exemplo n.º 2
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!");
            }
        }
Exemplo n.º 3
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!");
            }
        }
Exemplo n.º 4
0
 public HostUI(BTSDeployForm.DeployForm gui)
 {
     _gui = gui;
 }