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


C# ISettingsSection.Attribute方法代码示例

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


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

示例1: TryLoad

		public static DsDocumentInfo? TryLoad(ISettingsSection section) {
			var name = section.Attribute<string>(DOCUMENTINFO_NAME_ATTR);
			var type = section.Attribute<Guid?>(DOCUMENTINFO_TYPE_ATTR) ?? DocumentConstants.DOCUMENTTYPE_FILE;
			if (string.IsNullOrEmpty(name))
				return null;
			return new DsDocumentInfo(name, type);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:7,代码来源:DsDocumentInfoSerializer.cs

示例2: Write

 public SavedWindowState Write(ISettingsSection section)
 {
     section.Attribute("Bounds", Bounds);
     section.Attribute("IsFullScreen", IsFullScreen);
     section.Attribute("WindowState", WindowState);
     return this;
 }
开发者ID:lovebanyi,项目名称:dnSpy,代码行数:7,代码来源:SavedWindowState.cs

示例3: Read

 public SavedWindowState Read(ISettingsSection section)
 {
     Bounds = section.Attribute<Rect?>("Bounds") ?? Rect.Empty;
     IsFullScreen = section.Attribute<bool?>("IsFullScreen") ?? false;
     WindowState = section.Attribute<WindowState?>("WindowState") ?? WindowState.Normal;
     return this;
 }
开发者ID:lovebanyi,项目名称:dnSpy,代码行数:7,代码来源:SavedWindowState.cs

示例4: TryLoad

 public static DnSpyFileInfo? TryLoad(ISettingsSection section)
 {
     var name = section.Attribute<string>(FILEINFO_NAME_ATTR);
     var type = section.Attribute<Guid?>(FILEINFO_TYPE_ATTR) ?? FileConstants.FILETYPE_FILE;
     if (string.IsNullOrEmpty(name))
         return null;
     return new DnSpyFileInfo(name, type);
 }
开发者ID:lovebanyi,项目名称:dnSpy,代码行数:8,代码来源:DnSpyFileInfoSerializer.cs

示例5: Save

		public void Save(ISettingsSection section) {
			section.Attribute(NAME_ATTR, Name);
			section.Attribute(INDEX_ATTR, Index);
			section.Attribute(ISHORIZONTAL_ATTR, IsHorizontal);

			if (StackedContentState != null)
				StackedContentStateSerializer.Serialize(section.GetOrCreateSection(STACKEDCONTENTSTATE_SECTION), StackedContentState);

			foreach (var stg in TabGroups)
				stg.Save(section.CreateSection(TABGROUP_SECTION));
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:11,代码来源:SerializedTabs.cs

示例6: Load

		public static SerializedTabGroupWindow Load(ISettingsSection section) {
			var name = section.Attribute<string>(NAME_ATTR) ?? MAIN_NAME;
			int index = section.Attribute<int?>(INDEX_ATTR) ?? -1;
			bool isHorizontal = section.Attribute<bool?>(ISHORIZONTAL_ATTR) ?? false;
			var stackedContentState = StackedContentStateSerializer.TryDeserialize(section.GetOrCreateSection(STACKEDCONTENTSTATE_SECTION));
			var tgw = new SerializedTabGroupWindow(name, index, isHorizontal, stackedContentState);

			foreach (var tgSection in section.SectionsWithName(TABGROUP_SECTION))
				tgw.TabGroups.Add(SerializedTabGroup.Load(tgSection));

			return tgw;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:12,代码来源:SerializedTabs.cs

示例7: Serialize

		public static void Serialize(ISettingsSection section, StackedContentState state) {
			section.Attribute(ISHORIZONTAL_ATTR, state.IsHorizontal);
			foreach (var length in state.RowsCols) {
				var lengthSect = section.CreateSection(LENGTH_SECTION);
				lengthSect.Attribute(LENGTH_ATTR, length);
			}
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:7,代码来源:StackedContentState.cs

示例8: Deserialize

		public DocumentTabContent Deserialize(Guid guid, ISettingsSection section, IDocumentTabContentFactoryContext context) {
			if (guid != GUID_SerializedContent)
				return null;

			var filename = section.Attribute<string>("filename");
			return hexViewDocumentTabContentCreator.Value.TryCreate(filename);
		}
开发者ID:0xd4d,项目名称:dnSpy,代码行数:7,代码来源:HexBoxDocumentTabContent.cs

示例9: Serialize

		public Guid? Serialize(DocumentTabContent content, ISettingsSection section) {
			var dc = content as DecompileDocumentTabContent;
			if (dc == null)
				return null;

			section.Attribute("Language", dc.Decompiler.UniqueGuid);
			return GUID_SerializedContent;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:8,代码来源:DecompileDocumentTabContent.cs

示例10: Serialize

		public Guid? Serialize(DocumentTabContent content, ISettingsSection section) {
			var hb = content as HexViewDocumentTabContent;
			if (hb == null)
				return null;

			section.Attribute("filename", hb.Filename);
			return GUID_SerializedContent;
		}
开发者ID:0xd4d,项目名称:dnSpy,代码行数:8,代码来源:HexBoxDocumentTabContent.cs

示例11: Deserialize

		public DocumentTabContent Deserialize(Guid guid, ISettingsSection section, IDocumentTabContentFactoryContext context) {
			if (guid != GUID_SerializedContent)
				return null;

			var langGuid = section.Attribute<Guid?>("Language") ?? DecompilerConstants.LANGUAGE_CSHARP;
			var language = DecompilerService.FindOrDefault(langGuid);
			return new DecompileDocumentTabContent(this, context.Nodes, language);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:8,代码来源:DecompileDocumentTabContent.cs

示例12: Create

 public static FileList Create(ISettingsSection section)
 {
     var fileList = new FileList(section.Attribute<string>(FILELIST_NAME_ATTR));
     foreach (var fileSect in section.SectionsWithName(FILE_SECTION)) {
         var info = DnSpyFileInfoSerializer.TryLoad(fileSect);
         if (info != null)
             fileList.Files.Add(info.Value);
     }
     return fileList;
 }
开发者ID:GreenDamTan,项目名称:dnSpy,代码行数:10,代码来源:FileList.cs

示例13: Load

		public void Load(ISettingsSection section) {
			var listName = section.Attribute<string>(CURRENT_LIST_ATTR);
			var names = new HashSet<string>(StringComparer.Ordinal);
			foreach (var listSection in section.SectionsWithName(DOCUMENT_LIST_SECTION)) {
				var documentList = DocumentList.Create(listSection);
				if (names.Contains(documentList.Name))
					continue;
				documentsList.Add(documentList);
			}
			hasLoaded = true;

			SelectList(listName);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:13,代码来源:DocumentListService.cs

示例14: TryDeserialize

		public static StackedContentState TryDeserialize(ISettingsSection section) {
			var state = new StackedContentState();
			bool? b = section.Attribute<bool?>(ISHORIZONTAL_ATTR);
			if (b == null)
				return null;
			state.IsHorizontal = b.Value;
			foreach (var lengthSect in section.SectionsWithName(LENGTH_SECTION)) {
				var length = lengthSect.Attribute<GridLength?>(LENGTH_ATTR);
				if (length == null)
					return null;
				state.RowsCols.Add(length.Value);
			}
			return state;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:14,代码来源:StackedContentState.cs

示例15: ReadSection

		void ReadSection(XElement xml, ISettingsSection section, int recursionCounter) {
			if (recursionCounter >= XmlSettingsConstants.MAX_CHILD_DEPTH)
				return;

			foreach (var xmlAttr in xml.Attributes()) {
				var attrName = xmlAttr.Name.LocalName;
				if (attrName == XmlSettingsConstants.SECTION_ATTRIBUTE_NAME)
					continue;
				section.Attribute(attrName, XmlUtils.UnescapeAttributeValue(xmlAttr.Value));
			}

			foreach (var xmlSect in xml.Elements(XmlSettingsConstants.SECTION_NAME)) {
				var name = XmlUtils.UnescapeAttributeValue((string)xmlSect.Attribute(XmlSettingsConstants.SECTION_ATTRIBUTE_NAME));
				if (name == null)
					continue;
				var childSection = section.CreateSection(name);
				ReadSection(xmlSect, childSection, recursionCounter + 1);
			}
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:19,代码来源:XmlSettingsReader.cs


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