本文整理汇总了C#中ISettingsSection.CreateSection方法的典型用法代码示例。如果您正苦于以下问题:C# ISettingsSection.CreateSection方法的具体用法?C# ISettingsSection.CreateSection怎么用?C# ISettingsSection.CreateSection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISettingsSection
的用法示例。
在下文中一共展示了ISettingsSection.CreateSection方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
}
示例2: 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));
}
示例3: 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);
}
}
示例4: Serialize
public static void Serialize(ISettingsSection section, ToolWindowUIState state)
{
section.Attribute(LOCATION_ATTR, state.Location);
section.Attribute(INDEX_ATTR, state.Index);
section.Attribute(ISHORIZONTAL_ATTR, state.IsHorizontal);
foreach (var content in state.Groups)
ToolWindowGroupState.Serialize(section.CreateSection(GROUP_SECT), content);
Debug.Assert(state.StackedContentState != null);
if (state.StackedContentState != null)
StackedContentStateSerializer.Serialize(section.GetOrCreateSection(STACKEDCONTENTSTATE_SECTION), state.StackedContentState);
}
示例5: Write
public void Write(ISettingsSection section)
{
Debug.Assert(HorizontalContentState != null && VerticalContentState != null);
if (HorizontalContentState != null)
StackedContentStateSerializer.Serialize(section.GetOrCreateSection(HORIZONTALCONTENT_SECT), HorizontalContentState);
if (VerticalContentState != null)
StackedContentStateSerializer.Serialize(section.GetOrCreateSection(VERTICALCONTENT_SECT), VerticalContentState);
Debug.Assert(LeftState != null && RightState != null && TopState != null && BottomState != null);
if (LeftState != null)
ToolWindowUIState.Serialize(section.CreateSection(TOOLWINDOWUI_SECT), LeftState);
if (RightState != null)
ToolWindowUIState.Serialize(section.CreateSection(TOOLWINDOWUI_SECT), RightState);
if (TopState != null)
ToolWindowUIState.Serialize(section.CreateSection(TOOLWINDOWUI_SECT), TopState);
if (BottomState != null)
ToolWindowUIState.Serialize(section.CreateSection(TOOLWINDOWUI_SECT), BottomState);
foreach (var kv in SavedLocations) {
var sect = section.CreateSection(LOCATION_SECT);
sect.Attribute(LOCATION_GUID_ATTR, kv.Key);
sect.Attribute(LOCATION_ATTR, kv.Value);
}
}
示例6: Save
public void Save(ISettingsSection section)
{
section.Attribute(CURRENT_LIST_ATTR, SelectedFileList.Name);
foreach (var fileList in fileLists)
fileList.Save(section.CreateSection(FILE_LIST_SECTION));
}
示例7: Save
public void Save(ISettingsSection section)
{
section.Attribute(FILELIST_NAME_ATTR, Name);
foreach (var info in files)
DnSpyFileInfoSerializer.Save(section.CreateSection(FILE_SECTION), info);
}
示例8: Save
public void Save(ISettingsSection section) {
section.Attribute(CURRENT_LIST_ATTR, SelectedDocumentList.Name);
foreach (var documentList in documentsList)
documentList.Save(section.CreateSection(DOCUMENT_LIST_SECTION));
}