本文整理汇总了C#中ISettingsSection.SectionsWithName方法的典型用法代码示例。如果您正苦于以下问题:C# ISettingsSection.SectionsWithName方法的具体用法?C# ISettingsSection.SectionsWithName怎么用?C# ISettingsSection.SectionsWithName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISettingsSection
的用法示例。
在下文中一共展示了ISettingsSection.SectionsWithName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Read
public MainWindowControlState Read(ISettingsSection section) {
HorizontalContentState = StackedContentStateSerializer.TryDeserialize(section.GetOrCreateSection(HORIZONTALCONTENT_SECT));
VerticalContentState = StackedContentStateSerializer.TryDeserialize(section.GetOrCreateSection(VERTICALCONTENT_SECT));
foreach (var twSect in section.SectionsWithName(TOOLWINDOWUI_SECT)) {
var state = ToolWindowUIState.TryDeserialize(twSect);
if (state == null)
continue;
switch (state.Location) {
case AppToolWindowLocation.Left: LeftState = state; break;
case AppToolWindowLocation.Right: RightState = state; break;
case AppToolWindowLocation.Top: TopState = state; break;
case AppToolWindowLocation.Bottom: BottomState = state; break;
}
}
foreach (var locSect in section.SectionsWithName(LOCATION_SECT)) {
var guid = locSect.Attribute<Guid?>(LOCATION_GUID_ATTR);
var loc = locSect.Attribute<AppToolWindowLocation?>(LOCATION_ATTR);
if (guid == null || loc == null)
continue;
if (!IsValid(loc.Value))
continue;
SavedLocations[guid.Value] = loc.Value;
}
return this;
}
示例2: 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;
}
示例3: 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;
}
示例4: 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);
}
示例5: 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;
}
示例6: TryDeserialize
public static ToolWindowUIState TryDeserialize(ISettingsSection section)
{
var location = section.Attribute<AppToolWindowLocation?>(LOCATION_ATTR);
int? index = section.Attribute<int?>(INDEX_ATTR);
bool? isHorizontal = section.Attribute<bool?>(ISHORIZONTAL_ATTR);
if (location == null || index == null || isHorizontal == null)
return null;
var state = new ToolWindowUIState();
state.Location = location.Value;
state.Index = index.Value;
state.IsHorizontal = isHorizontal.Value;
foreach (var sect in section.SectionsWithName(GROUP_SECT)) {
var content = ToolWindowGroupState.TryDeserialize(sect);
if (content == null)
return null;
state.Groups.Add(content);
}
state.StackedContentState = StackedContentStateSerializer.TryDeserialize(section.GetOrCreateSection(STACKEDCONTENTSTATE_SECTION));
if (state.StackedContentState == null)
return null;
return state;
}
示例7: TryLoad
public static SerializedTab TryLoad(ISettingsSection section) {
var contentSect = section.TryGetSection(CONTENT_SECTION);
if (contentSect == null || contentSect.Attribute<Guid?>(CONTENT_GUID_ATTR) == null)
return null;
var uiSect = section.TryGetSection(UI_SECTION);
if (uiSect == null)
return null;
var tabUISect = section.TryGetSection(TAB_UI_SECTION);
if (tabUISect == null)
return null;
var paths = new List<SerializedPath>();
foreach (var pathSection in section.SectionsWithName(PATH_SECTION))
paths.Add(SerializedPath.Load(pathSection));
var autoLoadedDocuments = new List<DsDocumentInfo>();
foreach (var sect in section.SectionsWithName(AUTOLOADED_SECTION)) {
var info = DsDocumentInfoSerializer.TryLoad(sect);
if (info != null)
autoLoadedDocuments.Add(info.Value);
}
return new SerializedTab(contentSect, tabUISect, uiSect, paths, autoLoadedDocuments);
}
示例8: 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(FILE_LIST_SECTION)) {
var fileList = FileList.Create(listSection);
if (names.Contains(fileList.Name))
continue;
fileLists.Add(fileList);
}
this.hasLoaded = true;
SelectList(listName);
}