Пример #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            txtName.Enabled            = true;
            txtName.Text               = string.Empty;
            txtPullFolder.Text         = string.Empty;
            txtRemoteServer1.Text      = string.Empty;
            txtRemoteServer2.Text      = string.Empty;
            txtRemoteServer3.Text      = string.Empty;
            txtRemoteServer4.Text      = string.Empty;
            txtRootFolder.Text         = string.Empty;
            lblInstance1.Visible       = false;
            txtRemoteServer1.Visible   = false;
            lblInstance2.Visible       = false;
            txtRemoteServer2.Visible   = false;
            lblInstance3.Visible       = false;
            txtRemoteServer3.Visible   = false;
            lblInstance4.Visible       = false;
            txtRemoteServer4.Visible   = false;
            btnEnsureInstances.Visible = false;

            SreEnvironment env = new SreEnvironment();

            env.LoadDefaultConfigs();
            env.Name = "new";
            Envs.Add(env);
            Bind(env, Envs);
            txtName.Focus();
        }
Пример #2
0
 private void DeployArtifacts(SreEnvironment toEnv, SreEnvironmentConfig config)
 {
     try
     {
         if (Dispatcher.DeployArtifacts(config) == Constants.success)
         {
             Log("Artifacts deployed on " + toEnv.Name + "! The service was restarted.");
             DisableServiceStatus();
         }
         else
         {
             Log("Artifacts deployment failed!", true, Color.DarkRed);
         }
     }
     catch (System.ServiceModel.CommunicationException) { }
 }
Пример #3
0
 private void Bind(SreEnvironment selected, SreEnvironments envs = null)
 {
     lbEnvs.DataSource    = null;
     lbEnvs.SelectionMode = SelectionMode.None;
     lbEnvs.DisplayMember = "Name";
     Envs = (envs == null) ? EnvironmentServiceDispatcherFactory.GetEnvironments() : envs;
     lbEnvs.DataSource    = Envs;
     lbEnvs.SelectionMode = SelectionMode.One;
     if ((selected == null) && lbEnvs.Items.Count > 0)
     {
         lbEnvs.SelectedIndex = 0;
     }
     else if (selected != null)
     {
         lbEnvs.SelectedItem = selected;
     }
 }
Пример #4
0
        public void runTestToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            if (m_dm_Property.propertyGrid.SelectedObject is SreDataSourceProperty)
            {
                SreDataSourceProperty dsProp = m_dm_Property.propertyGrid.SelectedObject as SreDataSourceProperty;
                if (string.IsNullOrEmpty(dsProp.TestFileName))
                {
                    MessageBox.Show("Cannot start test bed, please set a test file on property window!",
                                    "IDPE - Test Bed", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    {
                        this.Cursor = Cursors.Default;
                        return;
                    }
                }

                if (!File.Exists(dsProp.TestFileName))
                {
                    MessageBox.Show("Cannot start test bed, " + dsProp.TestFileName + "  does not exist!",
                                    "IDPE - Test Bed", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    {
                        this.Cursor = Cursors.Default;
                        return;
                    }
                }
                string traceFileName = string.Empty;
                bool   useWcf        = false; //todo
                if (useWcf)
                {
                    traceFileName = EnvironmentFiles.StartTestBed(true);
                    SreEnvironment local  = EnvironmentServiceDispatcherFactory.GetEnvironmentLocal();
                    string         result = EnvironmentServiceDispatcherFactory.GetInstance(true).ProcessFile(local.EnvironmentConfigsInstancesOnly[0],
                                                                                                              dsProp.DataSource.Id, dsProp.TestFileName);
                }
                else
                {
                    string pullFolder = DataSource.GetPullFolder(dsProp.DataSource.Id, dsProp.DataSourceKeys);
                    traceFileName = EnvironmentFiles.ProcessTestFile(pullFolder, dsProp.TestFileName);
                }

                if (!string.IsNullOrEmpty(traceFileName))
                {
                    System.Threading.Thread.Sleep(1000);//service needs time to start
                    if (Application.OpenForms.OfType <Log>().Count() == 1)
                    {
                        Application.OpenForms.OfType <Log>().First().Focus();
                    }
                    else
                    {
                        Log log = new Log("IDPE - Test Bed", traceFileName);
                        log.Show();
                    }
                }
                else
                {
                    MessageBox.Show("Cannot start test bed, please contact support or reinstall IDPE!",
                                    "IDPE - Test Bed", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                }
            }
            this.Cursor = Cursors.Default;
        }