private static void Release(GeneralOption option) { GeneralChangingService.SetGeneralOptions(option); var settings = OptionService.ToSettings(option); SettingsManager.SaveSettings(settings, Paths.CoCoGeneralSettingsFile); }
/// <summary> /// テストで使用する HierarchyFilter を作成します。 /// </summary> private Func <string, bool> CreateHierarchyFilter(bool excludeGeneratedT4) { var option = new GeneralOption { ExcludeGeneratedT4 = excludeGeneratedT4 }; return(option.CreateHierarchyFilter()); }
/// <summary> /// テストで使用する FileFilter を作成します。 /// </summary> private Func <string, bool> CreateFileFilter(string inclusionPattern, string exclusionPattern) { var option = new GeneralOption { InclusionFilePattern = inclusionPattern, ExclusionFilePattern = exclusionPattern }; return(option.CreateFileFilter()); }
public GeneralOptionViewModel(GeneralOption option) { foreach (var language in option.Languages) { _languages.Add(new GeneralLanguageViewModel(language)); } Languages = CollectionViewSource.GetDefaultView(_languages); Languages.SortDescriptions.Add(new SortDescription(nameof(GeneralLanguageViewModel.Language), ListSortDirection.Ascending)); }
public static void SetGeneralOptions(GeneralOption option) { var changes = new Dictionary <string, GeneralInfo>(option.Languages.Count); var editorChanges = new Dictionary <string, bool>(option.Languages.Count); foreach (var item in option.Languages) { changes[item.Name] = new GeneralInfo((EditorState)item.EditorState, (QuickInfoState)item.QuickInfoState); editorChanges[item.Name] = (EditorState)item.EditorState == EditorState.Enable; } Instance.GeneralChanged?.Invoke(new GeneralChangedEventArgs(changes)); Instance.EditorOptionsChanged?.Invoke(new EditorChangedEventArgs(editorChanges)); }