private void SaveDefaultSettings()
        {
            _configManager.AddValue(ConfigKeys.SELECTED_PROJECT_NAME, SelectedProjectName);
            _configManager.AddValue(ConfigKeys.SOURCE_BRANCH, SelectedSourceBranch);
            _configManager.AddValue(ConfigKeys.TARGET_BRANCH, SelectedTargetBranch);

            _configManager.SaveDictionary();
        }
예제 #2
0
        public void SaveDefaultMergeSettingsForCurrentSolution(DefaultMergeSettings defaultMergeSettings)
        {
            var saveSelectedBranchSettingsBySolution = _configManager.GetValue <bool>(ConfigKeys.SAVE_BRANCH_PERSOLUTION);

            if (saveSelectedBranchSettingsBySolution)
            {
                var currentSolutionName = GetActiveSolution()?.FullName;
                defaultMergeSettings.Solution = currentSolutionName;

                if (!string.IsNullOrWhiteSpace(currentSolutionName))
                {
                    var currentSettings        = _configManager.GetValue <List <DefaultMergeSettings> >(ConfigKeys.SOLUTIONWIDE_SELECTEDMERGE_SETTINGS) ?? new List <DefaultMergeSettings>();
                    var currentSolutionSetting = currentSettings.SingleOrDefault(c => c.Solution == currentSolutionName);
                    if (currentSolutionSetting != null)
                    {
                        currentSolutionSetting.SourceBranch = defaultMergeSettings.SourceBranch;
                        currentSolutionSetting.TargetBranch = defaultMergeSettings.TargetBranch;
                        currentSolutionSetting.ProjectName  = defaultMergeSettings.ProjectName;
                    }
                    else
                    {
                        currentSettings.Add(defaultMergeSettings);
                    }

                    _configManager.AddValue(ConfigKeys.SOLUTIONWIDE_SELECTEDMERGE_SETTINGS, currentSettings);
                    _configManager.SaveDictionary();
                }
            }
        }
예제 #3
0
        public void Save()
        {
            _configManager.AddValue(ConfigKeys.ENABLE_AUTO_SELECT_ALL_CHANGESETS, Model.EnableAutoSelectAllChangesets);
            _configManager.AddValue(ConfigKeys.ENABLE_WARNING_WHEN_PENDING_CHANGES, Model.EnablePendingChangesWarning);
            _configManager.AddValue(ConfigKeys.LATEST_VERSION_FOR_BRANCH, Model.LatestVersionBranch);
            _configManager.AddValue(ConfigKeys.SHOULD_RESOLVE_CONFLICTS, Model.ShouldResolveConflicts);
            _configManager.AddValue(ConfigKeys.SAVE_BRANCH_PERSOLUTION, Model.SaveSelectedBranchPerSolution);
            _configManager.AddValue(ConfigKeys.WORK_ITEM_TYPES_TO_EXCLUDE, Model.WorkItemTypesToExclude);
            _configManager.AddValue(ConfigKeys.CHECK_IN_COMMENT_OPTION, Model.CheckInComment);
            _configManager.AddValue(ConfigKeys.COMMENT_FORMAT, Model.CommenFormat);
            _configManager.AddValue(ConfigKeys.EXCLUDE_WORK_ITEMS_FOR_MERGE, Model.ExcludeWorkItemsForMerge);
            _configManager.AddValue(ConfigKeys.SHOULD_SHOW_LATEST_VERSION_IN_COMMENT, Model.ShouldShowLatestVersionMerge);

            _configManager.SaveDictionary();

            IsDirty = false;
        }