Пример #1
0
        private void buttonDelete_Click(object sender, RoutedEventArgs e)
        {
            StackHashContextSettings settings = listBoxProfiles.SelectedItem as StackHashContextSettings;

            if (settings != null)
            {
                if (StackHashMessageBox.Show(this,
                                             string.Format(CultureInfo.CurrentCulture,
                                                           Properties.Resources.ProfileManager_DeleteProfileMBMessage,
                                                           settings.WinQualSettings.CompanyName,
                                                           settings.ErrorIndexSettings.Folder),
                                             Properties.Resources.ProfileManager_DeleteProfileMBTitle,
                                             StackHashMessageBoxType.YesNo,
                                             StackHashMessageBoxIcon.Question) == StackHashDialogResult.Yes)
                {
                    // if the current context is deleted then go back to the invalid state
                    if (UserSettings.Settings.CurrentContextId == settings.Id)
                    {
                        UserSettings.Settings.CurrentContextId = UserSettings.InvalidContextId;
                    }

                    // remove the context
                    _clientLogic.AdminRemoveContext(settings.Id);
                }
            }
        }
Пример #2
0
        private void DeleteContextCore(int contextId)
        {
            // if the current context is deleted then go back to the invalid state
            if (UserSettings.Settings.CurrentContextId == contextId)
            {
                UserSettings.Settings.CurrentContextId = UserSettings.InvalidContextId;
            }

            // remove the context
            _clientLogic.AdminRemoveContext(contextId);
        }