public static void Serialize(ISettingsSection section, ToolWindowGroupState state) { section.Attribute(INDEX_ATTR, state.Index); foreach (var content in state.Contents) { ToolWindowContentState.Serialize(section.CreateSection(CONTENT_SECT), content); } }
public static ToolWindowGroupState TryDeserialize(ISettingsSection section) { int?index = section.Attribute <int?>(INDEX_ATTR); if (index == null) { return(null); } var state = new ToolWindowGroupState(); state.Index = index.Value; foreach (var sect in section.SectionsWithName(CONTENT_SECT)) { var content = ToolWindowContentState.TryDeserialize(sect); if (content == null) { return(null); } state.Contents.Add(content); } return(state); }
public static void Serialize(ISettingsSection section, ToolWindowContentState state) { section.Attribute(GUID_ATTR, state.Guid); }