/// <summary>
        /// Delete tab page from tab control and remove item from Combobox (via delegate method)
        /// </summary>
        /// <param name="o"></param>
        /// <param name="e"></param>
        private void DeleteEnvironment(Object o, MyWorkingEnvironmentEventArgs e)
        {
            var localKey = e.Value.environmentName;

            tabControlEnvironments.TabPages.RemoveByKey(localKey);

            comboBoxEnvironments.Items.Remove(new KeyValuePair <TeamWorkingEnvironment, string>(e.Value, e.Value.environmentKey));
        }
Example #2
0
        /// <summary>
        /// Local function to update the main form details.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void UpdateEnvironmentLabel(object sender, MyWorkingEnvironmentEventArgs e)
        {
            var localEnvironment  = e.Value;
            var localTextForLabel = localEnvironment.environmentKey;

            if (labelWorkingEnvironment.InvokeRequired)
            {
                labelWorkingEnvironment.BeginInvoke((MethodInvoker) delegate { labelWorkingEnvironment.Text = localTextForLabel; });
            }
            else
            {
                labelWorkingEnvironment.Text = localTextForLabel;
            }

            LocalTeamEnvironmentConfiguration.InitialiseEnvironmentPaths();
        }