Ejemplo n.º 1
0
        private void SaveANDexitButtonClick(object sender, EventArgs e)
        {
            SettingsModel newSettings = (SettingsModel)settings.Clone();

            newSettings.HideBorderMenu      = ConvertStringVariantsToBoolean(showBorderMenu.SelectedItem.ToString(), Yes, No);
            newSettings.ShowAdditionalInfo  = ConvertStringVariantsToBoolean(showAdditionalInfo.SelectedItem.ToString(), Yes, No);
            newSettings.ShowOnlyOwnRequests = ConvertStringVariantsToBoolean(showOnlyOwnRequests.SelectedItem.ToString(), Yes, No);
            newSettings.RestoreBorderMenu   = ConvertStringVariantsToBoolean(restoreBorderMenu.SelectedItem.ToString(), Yes, No);

            newSettings.CloseViewButtonPosition = ConvertStringToIntEnum(
                closeViewButtonPosition.SelectedItem.ToString(),
                (int)DockStyle.Left,
                (int)DockStyle.Right,
                typeof(DockStyle));

            newSettings.FullScreenAtStart = ConvertStringToIntEnum(
                fullScreenAtStart.SelectedItem.ToString(),
                (int)FormWindowState.Normal,
                (int)FormWindowState.Maximized,
                typeof(FormWindowState));

            newSettings.FileFolderPath = fileFolderPath.Text;

            SettingsMethods.SetConfig(newSettings);
            parentForm.UpdateSettings();
            closeView.PerformClick();
        }
Ejemplo n.º 2
0
        //todo:доработать сохранение настроек
        private void SaveANDexitButtonClick(object sender, EventArgs e)
        {
            CompareRolePermissionsAndUpdateDatabase(dbRolePermissionPair, RolePermissionPair);
            SettingsModel model = (SettingsModel)settings.Clone();

            model.RolePositionsDictionary = RolePositionPair;
            SettingsMethods.SetConfig(model);
            closeView.PerformClick();
        }
Ejemplo n.º 3
0
 public SettingsModel GetApplicationSettings()
 {
     return(_settings.Clone());
 }