Esempio n. 1
0
 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);
     }
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 public static void Serialize(ISettingsSection section, ToolWindowContentState state)
 {
     section.Attribute(GUID_ATTR, state.Guid);
 }
Esempio n. 4
0
 public static void Serialize(ISettingsSection section, ToolWindowContentState state)
 {
     section.Attribute(GUID_ATTR, state.Guid);
 }