Exemplo n.º 1
0
        public static string ShowMsgbox(string Title, string Description, String Btn1, String Btn2, String Btn3)
        {
            Msgbox MBox = new Msgbox();
            MBox.ReturnValue = "";
            //MBox.Opacity = 0.4;

            MBox.Text = Title;
            MBox.lblMain.Text = Description;
            if (Btn1 != "")
                MBox.button1.Text = Btn1;
            else
                MBox.button1.Visible = false;

            if (Btn2 != "")
                MBox.Button2.Text = Btn2;
            else
                MBox.Button2.Visible = false;

            if (Btn3 != "")
                MBox.Button3.Text = Btn3;
            else
                MBox.Button3.Visible = false;
            MBox.ShowDialog();
            string retval = MBox.ReturnValue;
            MBox.Dispose();

            return retval;
        }
Exemplo n.º 2
0
        private void btn_Manager_Start_Click(object sender, EventArgs e)
        {
            //assumes the manager is not started...otherwise start button would be disabled.
            btn_Manager_Start.Enabled = false;
            btn_Manager_Stop.Enabled  = false;
            btn_Manager_Reset.Enabled = false;

            inspect_Manager.ValuesSecondary.Description = "Starting Manager...";
            PBar.Value = 0;
            PBar.Show();

            if (CurrentSelectedManagerWrapper._container == null)
            {
                //this is also done in the constructor of the wrapper
                CurrentSelectedManagerWrapper._container = new Alchemi.Manager.ManagerContainer();
                CurrentSelectedManagerWrapper._container.RemotingConfigFile = "eduGRID_ManagerApp.exe.config";
                CurrentSelectedManagerWrapper._container.ReadConfig(false, AppDomain.CurrentDomain.BaseDirectory, "eduGRIDManager.config.xml");
                CurrentSelectedManagerWrapper.Config = CurrentSelectedManagerWrapper._container.Config;
            }
            {
                //note that dbtype is not being displayed...its type is retained as default
                CurrentSelectedManagerWrapper.Config.DbServer   = txDbServer.Text;
                CurrentSelectedManagerWrapper.Config.DbUsername = txDbUsername.Text;
                CurrentSelectedManagerWrapper.Config.DbPassword = txDbPassword.Text;
                CurrentSelectedManagerWrapper.Config.DbName     = txDbName.Text;
                CurrentSelectedManagerWrapper.Config.OwnPort    = int.Parse(txOwnPort.Text);
                //todo: more to be added for intermediate level manager

                CurrentSelectedManagerWrapper.ManagerName = txtInstanceName.Text;
            }
            CurrentSelectedManagerWrapper._container.Config = CurrentSelectedManagerWrapper.Config;
            try
            {
                CurrentSelectedManagerWrapper._container.Start();
                inspect_Manager.ValuesSecondary.Description = "Manager Started";

                btn_Manager_Stop.Enabled = true;
                txDbServer.Enabled       = false;
                txDbUsername.Enabled     = false;
                txDbPassword.Enabled     = false;
                txDbName.Enabled         = false;
                txOwnPort.Enabled        = false;
                PBar.Visible             = false;
            }
            catch (Exception ex)
            {
                btn_Manager_Start.Enabled = true;
                btn_Manager_Reset.Enabled = true;
                Msgbox.ShowMsgbox("Could not start Manager!", ex.ToString(), "", "", "OK");
                inspect_Manager.ValuesSecondary.Description = "Could not start manager!";
            }
        }
Exemplo n.º 3
0
        public static string ShowMsgbox(string Title, string Description, String Btn1, String Btn2, String Btn3)
        {
            Msgbox MBox = new Msgbox();

            MBox.ReturnValue = "";
            //MBox.Opacity = 0.4;

            MBox.Text         = Title;
            MBox.lblMain.Text = Description;
            if (Btn1 != "")
            {
                MBox.button1.Text = Btn1;
            }
            else
            {
                MBox.button1.Visible = false;
            }

            if (Btn2 != "")
            {
                MBox.Button2.Text = Btn2;
            }
            else
            {
                MBox.Button2.Visible = false;
            }

            if (Btn3 != "")
            {
                MBox.Button3.Text = Btn3;
            }
            else
            {
                MBox.Button3.Visible = false;
            }
            MBox.ShowDialog();
            string retval = MBox.ReturnValue;

            MBox.Dispose();

            return(retval);
        }
Exemplo n.º 4
0
        private void btn_Manager_Stop_Click(object sender, EventArgs e)
        {
            btn_Manager_Stop.Enabled = false;
            try
            {
                CurrentSelectedManagerWrapper._container.Stop();

                CurrentSelectedManagerWrapper._container = null;
                btn_Manager_Start.Enabled = true;
                btn_Manager_Reset.Enabled = true;

                txDbServer.Enabled   = true;
                txDbUsername.Enabled = true;
                txDbPassword.Enabled = true;
                txDbName.Enabled     = true;
                txOwnPort.Enabled    = true;
            }
            catch (Exception ex)
            {
                btn_Manager_Stop.Enabled = true;
                Msgbox.ShowMsgbox("Error stopping manager", ex.ToString(), "", "", "OK :(");
            }
        }
Exemplo n.º 5
0
        private void DisplayManager()
        {
            //function assumes that currentselectedmanagerwrapper is set properly
            if (CurrentSelectedManagerWrapper != null)
            {
                if ((CurrentSelectedManagerWrapper._container != null) && (CurrentSelectedManagerWrapper._container.Started))
                {
                    inspect_Manager.ValuesSecondary.Description = "Manager Started";

                    btn_Manager_Start.Enabled = false;
                    btn_Manager_Reset.Enabled = false;

                    btn_Manager_Stop.Enabled = true;
                    txDbServer.Enabled       = false;
                    txDbServer.Text          = CurrentSelectedManagerWrapper.Config.DbServer;

                    txDbUsername.Enabled = false;
                    txDbUsername.Text    = CurrentSelectedManagerWrapper.Config.DbUsername;

                    txDbPassword.Enabled = false;
                    txDbPassword.Text    = CurrentSelectedManagerWrapper.Config.DbPassword;

                    txDbName.Enabled = false;
                    txDbName.Text    = CurrentSelectedManagerWrapper.Config.DbName;

                    txOwnPort.Enabled = false;
                    txOwnPort.Text    = CurrentSelectedManagerWrapper.Config.OwnPort.ToString();

                    PBar.Visible = false;
                }
                else
                {
                    btn_Manager_Start.Enabled = true;
                    btn_Manager_Stop.Enabled  = false;
                    btn_Manager_Reset.Enabled = true;

                    txDbServer.Enabled = true;
                    txDbServer.Text    = CurrentSelectedManagerWrapper.Config.DbServer;

                    txDbUsername.Enabled = true;
                    txDbUsername.Text    = CurrentSelectedManagerWrapper.Config.DbUsername;

                    txDbPassword.Enabled = true;
                    txDbPassword.Text    = CurrentSelectedManagerWrapper.Config.DbPassword;

                    txDbName.Enabled = true;
                    txDbName.Text    = CurrentSelectedManagerWrapper.Config.DbName;

                    txOwnPort.Enabled = true;
                    txOwnPort.Text    = CurrentSelectedManagerWrapper.Config.OwnPort.ToString();

                    PBar.Visible = false;
                }
                inspect_Manager.BringToFront();
                inspect_Manager.Visible = true;
            }
            else
            {
                Msgbox.ShowMsgbox("Uninitialized!", "This Manager Instance is not initialized, or was closed for an unknown reason. Would you like to start the instance?", "", "", "&OK");
            }
        }