当前位置: 首页>>代码示例>>C#>>正文


C# ISettingsService.GetOrCreateSection方法代码示例

本文整理汇总了C#中ISettingsService.GetOrCreateSection方法的典型用法代码示例。如果您正苦于以下问题:C# ISettingsService.GetOrCreateSection方法的具体用法?C# ISettingsService.GetOrCreateSection怎么用?C# ISettingsService.GetOrCreateSection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ISettingsService的用法示例。


在下文中一共展示了ISettingsService.GetOrCreateSection方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BackgroundImageSettingsService

		BackgroundImageSettingsService(ISettingsService settingsService, IBackgroundImageOptionDefinitionService backgroundImageOptionDefinitionService) {
			this.settingsService = settingsService;
			settingsInfos = new Dictionary<string, SettingsInfo>(backgroundImageOptionDefinitionService.AllSettings.Length, StringComparer.Ordinal);

			foreach (var lazy in backgroundImageOptionDefinitionService.AllSettings) {
				if (settingsInfos.ContainsKey(lazy.Value.Id))
					continue;
				settingsInfos[lazy.Value.Id] = new SettingsInfo(lazy);
			}

			var allSettingsIds = new HashSet<string>(backgroundImageOptionDefinitionService.AllSettings.Select(a => a.Value.Id), StringComparer.Ordinal);
			var rootSection = settingsService.GetOrCreateSection(SETTINGS_GUID);
			foreach (var section in rootSection.SectionsWithName(SettingsName)) {
				var rawSettings = new RawSettings(section);
				if (!rawSettings.IsValid)
					continue;
				SettingsInfo info;
				if (!settingsInfos.TryGetValue(rawSettings.Id, out info))
					continue;
				if (!allSettingsIds.Contains(rawSettings.Id))
					continue;
				allSettingsIds.Remove(rawSettings.Id);
				if (info.Lazy.Value.UserVisible) {
					info.SettingsSection = section;
					info.RawSettings.CopyFrom(rawSettings);
				}
			}
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:28,代码来源:BackgroundImageSettingsService.cs

示例2: Load

		public IEnumerable<object> Load(ISettingsService settingsService, IAppCommandLineArgs args) {
			var section = settingsService.GetOrCreateSection(SETTINGS_GUID);

			foreach (var o in documentListLoader.Load(section.GetOrCreateSection(DOCUMENT_LISTS_SECTION), args.LoadFiles))
				yield return o;

			if (args.LoadFiles) {
				var tgws = new List<SerializedTabGroupWindow>();
				var tgwsHash = new HashSet<string>(StringComparer.Ordinal);
				foreach (var tgwSection in section.SectionsWithName(TABGROUPWINDOW_SECTION)) {
					var tgw = SerializedTabGroupWindow.Load(tgwSection);
					yield return null;
					if (tgwsHash.Contains(tgw.Name))
						continue;
					tgws.Add(tgw);
				}

				// The documents are added to the treeview with a slight delay. Make sure the documents
				// have been added to the TV or the node lookup code will fail to find the nodes it needs.
				yield return LoaderConstants.Delay;

				foreach (var o in documentTabSerializer.Restore(tgws))
					yield return o;
			}

			documentTabService.OnTabsLoaded();
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:27,代码来源:DocumentTabServiceLoader.cs

示例3: DecompilerServiceSettingsImpl

		DecompilerServiceSettingsImpl(ISettingsService settingsService) {
			this.settingsService = settingsService;

			disableSave = true;
			var sect = settingsService.GetOrCreateSection(SETTINGS_GUID);
			LanguageGuid = sect.Attribute<Guid?>(nameof(LanguageGuid)) ?? LanguageGuid;
			disableSave = false;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:8,代码来源:DecompilerServiceSettings.cs

示例4: OutputServiceSettingsImpl

		OutputServiceSettingsImpl(ISettingsService settingsService) {
			this.settingsService = settingsService;

			disableSave = true;
			var sect = settingsService.GetOrCreateSection(SETTINGS_GUID);
			SelectedGuid = sect.Attribute<Guid?>(nameof(SelectedGuid)) ?? SelectedGuid;
			disableSave = false;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:8,代码来源:OutputServiceSettings.cs

示例5: CodeToolTipSettingsImpl

		CodeToolTipSettingsImpl(ISettingsService settingsService) {
			this.settingsService = settingsService;

			disableSave = true;
			var sect = settingsService.GetOrCreateSection(SETTINGS_GUID);
			SyntaxHighlight = sect.Attribute<bool?>(nameof(SyntaxHighlight)) ?? SyntaxHighlight;
			disableSave = false;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:8,代码来源:CodeToolTipSettings.cs

示例6: DsDocumentServiceSettingsImpl

		DsDocumentServiceSettingsImpl(ISettingsService settingsService) {
			this.settingsService = settingsService;

			disableSave = true;
			var sect = settingsService.GetOrCreateSection(SETTINGS_GUID);
			UseMemoryMappedIO = sect.Attribute<bool?>(nameof(UseMemoryMappedIO)) ?? UseMemoryMappedIO;
			disableSave = false;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:8,代码来源:DsDocumentServiceSettings.cs

示例7: ExportToProjectSettingsImpl

		ExportToProjectSettingsImpl(ISettingsService settingsService) {
			this.settingsService = settingsService;

			disableSave = true;
			var sect = settingsService.GetOrCreateSection(SETTINGS_GUID);
			ProjectVersion = sect.Attribute<ProjectVersion?>(nameof(ProjectVersion)) ?? ProjectVersion;
			disableSave = false;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:8,代码来源:ExportToProjectSettings.cs

示例8: ThemeSettings

		ThemeSettings(ISettingsService settingsService) {
			this.settingsService = settingsService;

			disableSave = true;
			var sect = settingsService.GetOrCreateSection(SETTINGS_GUID);
			ThemeGuid = sect.Attribute<Guid?>(nameof(ThemeGuid));
			ShowAllThemes = sect.Attribute<bool?>(nameof(ShowAllThemes)) ?? ShowAllThemes;
			disableSave = false;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:9,代码来源:ThemeSettings.cs

示例9: DocumentTabServiceSettingsImpl

		DocumentTabServiceSettingsImpl(ISettingsService settingsService) {
			this.settingsService = settingsService;

			disableSave = true;
			var sect = settingsService.GetOrCreateSection(SETTINGS_GUID);
			RestoreTabs = sect.Attribute<bool?>(nameof(RestoreTabs)) ?? RestoreTabs;
			DecompileFullType = sect.Attribute<bool?>(nameof(DecompileFullType)) ?? DecompileFullType;
			disableSave = false;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:9,代码来源:DocumentTabServiceSettings.cs

示例10: ReplSettingsImplBase

		protected ReplSettingsImplBase(Guid guid, ISettingsService settingsService) {
			this.settingsService = settingsService;
			this.guid = guid;

			disableSave = true;
			var sect = settingsService.GetOrCreateSection(guid);
			WordWrapStyle = sect.Attribute<WordWrapStyles?>(nameof(WordWrapStyle)) ?? WordWrapStyle;
			ShowLineNumbers = sect.Attribute<bool?>(nameof(ShowLineNumbers)) ?? ShowLineNumbers;
			disableSave = false;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:10,代码来源:ReplSettings.cs

示例11: LocalsSettingsImpl

		LocalsSettingsImpl(ISettingsService settingsService) {
			this.settingsService = settingsService;

			disableSave = true;
			var sect = settingsService.GetOrCreateSection(SETTINGS_GUID);
			ShowNamespaces = sect.Attribute<bool?>(nameof(ShowNamespaces)) ?? ShowNamespaces;
			ShowTypeKeywords = sect.Attribute<bool?>(nameof(ShowTypeKeywords)) ?? ShowTypeKeywords;
			ShowTokens = sect.Attribute<bool?>(nameof(ShowTokens)) ?? ShowTokens;
			disableSave = false;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:10,代码来源:LocalsSettings.cs

示例12: ILSettingsImpl

		ILSettingsImpl(ISettingsService settingsService) {
			this.settingsService = settingsService;

			disableSave = true;
			var sect = settingsService.GetOrCreateSection(SETTINGS_GUID);
			ShowILComments = sect.Attribute<bool?>(nameof(ShowILComments)) ?? ShowILComments;
			ShowXmlDocumentation = sect.Attribute<bool?>(nameof(ShowXmlDocumentation)) ?? ShowXmlDocumentation;
			ShowTokenAndRvaComments = sect.Attribute<bool?>(nameof(ShowTokenAndRvaComments)) ?? ShowTokenAndRvaComments;
			ShowILBytes = sect.Attribute<bool?>(nameof(ShowILBytes)) ?? ShowILBytes;
			SortMembers = sect.Attribute<bool?>(nameof(SortMembers)) ?? SortMembers;
			disableSave = false;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:12,代码来源:ILSettingsImpl.cs

示例13: MySettingsImpl

		MySettingsImpl(ISettingsService settingsService) {
			this.settingsService = settingsService;

			// Read the settings from the file or use the default values if our settings haven't
			// been saved to it yet.

			disableSave = true;
			var sect = settingsService.GetOrCreateSection(SETTINGS_GUID);
			BoolOption1 = sect.Attribute<bool?>(nameof(BoolOption1)) ?? BoolOption1;
			BoolOption2 = sect.Attribute<bool?>(nameof(BoolOption2)) ?? BoolOption2;
			StringOption3 = sect.Attribute<string>(nameof(StringOption3)) ?? StringOption3;
			disableSave = false;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:13,代码来源:MySettings.cs

示例14: DecompilerSettingsImpl

		DecompilerSettingsImpl(ISettingsService settingsService) {
			this.settingsService = settingsService;

			disableSave = true;
			var sect = settingsService.GetOrCreateSection(SETTINGS_GUID);
			// Only read those settings that can be changed in the dialog box
			DecompilationObject0 = sect.Attribute<DecompilationObject?>(nameof(DecompilationObject0)) ?? DecompilationObject0;
			DecompilationObject1 = sect.Attribute<DecompilationObject?>(nameof(DecompilationObject1)) ?? DecompilationObject1;
			DecompilationObject2 = sect.Attribute<DecompilationObject?>(nameof(DecompilationObject2)) ?? DecompilationObject2;
			DecompilationObject3 = sect.Attribute<DecompilationObject?>(nameof(DecompilationObject3)) ?? DecompilationObject3;
			DecompilationObject4 = sect.Attribute<DecompilationObject?>(nameof(DecompilationObject4)) ?? DecompilationObject4;
			AnonymousMethods = sect.Attribute<bool?>(nameof(AnonymousMethods)) ?? AnonymousMethods;
			ExpressionTrees = sect.Attribute<bool?>(nameof(ExpressionTrees)) ?? ExpressionTrees;
			YieldReturn = sect.Attribute<bool?>(nameof(YieldReturn)) ?? YieldReturn;
			AsyncAwait = sect.Attribute<bool?>(nameof(AsyncAwait)) ?? AsyncAwait;
			//this.AutomaticProperties = sect.Attribute<bool?>(nameof(AutomaticProperties)) ?? this.AutomaticProperties;
			//this.AutomaticEvents = sect.Attribute<bool?>(nameof(AutomaticEvents)) ?? this.AutomaticEvents;
			//this.UsingStatement = sect.Attribute<bool?>(nameof(UsingStatement)) ?? this.UsingStatement;
			//this.ForEachStatement = sect.Attribute<bool?>(nameof(ForEachStatement)) ?? this.ForEachStatement;
			//this.LockStatement = sect.Attribute<bool?>(nameof(LockStatement)) ?? this.LockStatement;
			//this.SwitchStatementOnString = sect.Attribute<bool?>(nameof(SwitchStatementOnString)) ?? this.SwitchStatementOnString;
			//this.UsingDeclarations = sect.Attribute<bool?>(nameof(UsingDeclarations)) ?? this.UsingDeclarations;
			QueryExpressions = sect.Attribute<bool?>(nameof(QueryExpressions)) ?? QueryExpressions;
			//this.FullyQualifyAmbiguousTypeNames = sect.Attribute<bool?>(nameof(FullyQualifyAmbiguousTypeNames)) ?? this.FullyQualifyAmbiguousTypeNames;
			//this.FullyQualifyAllTypes = sect.Attribute<bool?>(nameof(FullyQualifyAllTypes)) ?? this.FullyQualifyAllTypes;
			UseDebugSymbols = sect.Attribute<bool?>(nameof(UseDebugSymbols)) ?? UseDebugSymbols;
			//this.ObjectOrCollectionInitializers = sect.Attribute<bool?>(nameof(ObjectOrCollectionInitializers)) ?? this.ObjectOrCollectionInitializers;
			ShowXmlDocumentation = sect.Attribute<bool?>(nameof(ShowXmlDocumentation)) ?? ShowXmlDocumentation;
			RemoveEmptyDefaultConstructors = sect.Attribute<bool?>(nameof(RemoveEmptyDefaultConstructors)) ?? RemoveEmptyDefaultConstructors;
			//this.IntroduceIncrementAndDecrement = sect.Attribute<bool?>(nameof(IntroduceIncrementAndDecrement)) ?? this.IntroduceIncrementAndDecrement;
			//this.MakeAssignmentExpressions = sect.Attribute<bool?>(nameof(MakeAssignmentExpressions)) ?? this.MakeAssignmentExpressions;
			//this.AlwaysGenerateExceptionVariableForCatchBlocksUnlessTypeIsObject = sect.Attribute<bool?>(nameof(AlwaysGenerateExceptionVariableForCatchBlocksUnlessTypeIsObject)) ?? this.AlwaysGenerateExceptionVariableForCatchBlocksUnlessTypeIsObject;
			ShowTokenAndRvaComments = sect.Attribute<bool?>(nameof(ShowTokenAndRvaComments)) ?? ShowTokenAndRvaComments;
			SortMembers = sect.Attribute<bool?>(nameof(SortMembers)) ?? SortMembers;
			ForceShowAllMembers = sect.Attribute<bool?>(nameof(ForceShowAllMembers)) ?? ForceShowAllMembers;
			SortSystemUsingStatementsFirst = sect.Attribute<bool?>(nameof(SortSystemUsingStatementsFirst)) ?? SortSystemUsingStatementsFirst;
			//this.MaxArrayElements = sect.Attribute<int?>(nameof(MaxArrayElements)) ?? this.MaxArrayElements;
			SortCustomAttributes = sect.Attribute<bool?>(nameof(SortCustomAttributes)) ?? SortCustomAttributes;
			UseSourceCodeOrder = sect.Attribute<bool?>(nameof(UseSourceCodeOrder)) ?? UseSourceCodeOrder;
			//this.AllowFieldInitializers = sect.Attribute<bool?>(nameof(AllowFieldInitializers)) ?? this.AllowFieldInitializers;
			//TODO: CSharpFormattingOptions
			disableSave = false;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:43,代码来源:DecompilerSettingsImpl.cs

示例15: BamlSettingsImpl

		BamlSettingsImpl(ISettingsService settingsService) {
			this.settingsService = settingsService;

			disableSave = true;
			var sect = settingsService.GetOrCreateSection(SETTINGS_GUID);
			DisassembleBaml = sect.Attribute<bool?>(nameof(DisassembleBaml)) ?? DisassembleBaml;
			UseTabs = sect.Attribute<bool?>(nameof(UseTabs)) ?? UseTabs;
			NewLineOnAttributes = sect.Attribute<bool?>(nameof(NewLineOnAttributes)) ?? NewLineOnAttributes;
			disableSave = false;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:10,代码来源:BamlSettings.cs


注:本文中的ISettingsService.GetOrCreateSection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。