示例#1
0
        private void ui_Rename_button_Click(object sender, EventArgs e)
        {
            if (ui_Profiles_comboBox.SelectedIndex < 0)
            {
                ToastNotification.Show(this, @"Please select a profile.", 2000, eToastPosition.TopCenter);
                return;
            }

            var profileAdd = new FormNewProfile
            {
                Location = PointToScreen(new Point(Width / 2 - 122, 40))
            };

            profileAdd.ui_textBoxX_ProfileName.Text = ProfilesManager.CurrentProfile.Parameters.ProfileName;

            var dr = profileAdd.ShowDialog();
            if (dr == DialogResult.OK)
            {
                _exportJobs.ClearJobs(ProfilesManager.CurrentProfile.Parameters.ProfileName);

                var profile = profileAdd.ui_textBoxX_ProfileName.Text;
                if (ProfilesManager.RenameCurrentProfile(profile))
                {
                    RefreshProfiles();
                    RefreshJobList(ProfilesManager.CurrentProfile.Parameters.SheduleJobs);

                    foreach (var item in ui_Profiles_comboBox.Items)
                    {
                        if (item.ToString() == profile)
                            ui_Profiles_comboBox.SelectedItem = item;
                    }
                }
                else { ToastNotification.Show(this, @"Can't add symbol. This symbol already exists.", 2000, eToastPosition.TopCenter); }
            }
        }
示例#2
0
        private void ui_NewProfile_button_Click(object sender, EventArgs e)
        {
            ui_ProfileQueries_listBox.Items.Clear();

            ui_SelectedColumns_chListBox.Items.Clear();
            ui_TickTables_radioButton.Checked = false;
            ui_BarTables_radioButton.Checked = false;
            ui_FullDTEndDate_dTInput.Value = DateTime.Now;
            ui_FullDTStartDate_dTInput.Value = DateTime.Now;
            ui_DaysBEndTime_dTInput.Value = DateTime.Now;
            ui_DaysBStartTime_dTInput.Value = DateTime.Now;
            ui_DaysBackCount_integerInput.Value = 0;

            ui_TimeSliceEndTime_dTInput.Value = DateTime.Now;
            ui_TimeSliceStartTime_dTInput.Value = DateTime.Now;
            ui_TimeSliceExtrPeriodsList_listBox.Items.Clear();

            ui_SnapShotTimeValue_dTInput.Value = DateTime.Now;
            ui_SnapShootExtrTimesList_listBox.Items.Clear();

            var profileAdd = new FormNewProfile
            {
                Location = PointToScreen(new Point(Width / 2 - 122, 40))
            };
            profileAdd.ui_textBoxX_ProfileName.Text = "";

            var dr = profileAdd.ShowDialog();
            if (dr == DialogResult.OK)
            {
                var profile = profileAdd.ui_textBoxX_ProfileName.Text;
                if (ProfilesManager.CreateNewProfile(profile))
                {
                    RefreshProfiles();

                    foreach (var item in ui_Profiles_comboBox.Items)
                    {
                        if (item.ToString() == profile)
                            ui_Profiles_comboBox.SelectedItem = item;
                    }
                }
                else {ToastNotification.Show(this, @"Can't add profile. Profile with name " + profile + " already exists.", 2000, eToastPosition.TopCenter);}
            }
        }