Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
		public void Save(ISettingsSection section) {
			Debug.Assert(Content.Attribute<Guid?>(CONTENT_GUID_ATTR) != null);
			section.CreateSection(CONTENT_SECTION).CopyFrom(Content);
			section.CreateSection(UI_SECTION).CopyFrom(UI);
			section.CreateSection(TAB_UI_SECTION).CopyFrom(TabUI);
			foreach (var path in Paths)
				path.Save(section.CreateSection(PATH_SECTION));
			foreach (var f in AutoLoadedFiles)
				DnSpyFileInfoSerializer.Save(section.CreateSection(AUTOLOADED_SECTION), f);
		}
Exemplo n.º 3
0
		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);
			}
		}
Exemplo n.º 4
0
        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);
            }
        }
Exemplo n.º 5
0
 public void Save(ISettingsSection section)
 {
     foreach (var name in Names)
     {
         NodePathNameSerializer.Save(section.CreateSection(NAME_SECTION), name);
     }
 }
Exemplo n.º 6
0
 public void Save(ISettingsSection section)
 {
     section.Attribute(CURRENT_LIST_ATTR, SelectedDocumentList.Name);
     foreach (var documentList in documentsList)
     {
         documentList.Save(section.CreateSection(DOCUMENT_LIST_SECTION));
     }
 }
Exemplo n.º 7
0
 public void Save(ISettingsSection section)
 {
     section.Attribute(CURRENT_LIST_ATTR, SelectedFileList.Name);
     foreach (var fileList in fileLists)
     {
         fileList.Save(section.CreateSection(FILE_LIST_SECTION));
     }
 }
Exemplo n.º 8
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);
     }
 }
Exemplo n.º 9
0
 public void Save(ISettingsSection section)
 {
     section.Attribute(FILELIST_NAME_ATTR, Name);
     foreach (var info in files)
     {
         DnSpyFileInfoSerializer.Save(section.CreateSection(FILE_SECTION), info);
     }
 }
Exemplo n.º 10
0
 public void Save(ISettingsSection section)
 {
     section.Attribute(DOCUMENTLIST_NAME_ATTR, Name);
     foreach (var info in Documents)
     {
         DsDocumentInfoSerializer.Save(section.CreateSection(DOCUMENT_SECTION), info);
     }
 }
Exemplo n.º 11
0
 void Save()
 {
     fileSection.RemoveSection(filenameSectionName);
     foreach (var file in fileList)
     {
         var fileSect = fileSection.CreateSection(filenameSectionName);
         fileSect.Attribute <string>(filenameAttributeName, file);
     }
 }
Exemplo n.º 12
0
 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);
     }
 }
Exemplo n.º 13
0
        public void Save(ISettingsSection section)
        {
            section.Attribute(INDEX_ATTR, Index);

            foreach (var st in Tabs)
            {
                st.Save(section.CreateSection(TAB_SECTION));
            }
        }
Exemplo n.º 14
0
 static void AddSettings(ISettingsSection section, DbgExceptionSettings settings)
 {
     section.Attribute("Flags", settings.Flags);
     foreach (var cond in settings.Conditions)
     {
         var condSect = section.CreateSection("Conditions");
         condSect.Attribute("Type", cond.ConditionType);
         condSect.Attribute("Condition", cond.Condition);
     }
 }
Exemplo n.º 15
0
		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));
		}
Exemplo n.º 16
0
 ISettingsSection GetOrCreateGroupSection(string groupName)
 {
     if (toGroupSection.TryGetValue(groupName, out var sect))
     {
         return(sect);
     }
     sect = settingsSection.CreateSection(GroupName);
     toGroupSection.Add(groupName, sect);
     sect.Attribute(GroupNameAttr, groupName);
     return(sect);
 }
Exemplo n.º 17
0
		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));
		}
        ISettingsSection GetThemeFontSettingsSection(string name)
        {
            var section = TryGetThemeFontSettingsSection(name);

            if (!(section is null))
            {
                return(section);
            }
            section = rootSection.CreateSection(ThemeFontSettingsSection);
            section.Attribute(ThemeFontSettingsAttrName, name);
            toThemeFontSettingsSection.Add(name, section);
            return(section);
        }
Exemplo n.º 19
0
        void Save(WatchInfo info)
        {
            if (info.Section != null)
            {
                watchSection.RemoveSection(info.Section);
            }
            var sect = info.Section = watchSection.CreateSection("Watch");

            sect.Attribute("Index", info.WindowIndex);
            foreach (var expr in info.Expressions)
            {
                var exprSect = sect.CreateSection("Expression");
                exprSect.Attribute("Value", expr);
            }
        }
Exemplo n.º 20
0
 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);
     }
 }
Exemplo n.º 21
0
		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);
			}
		}
        private void OnPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            ISettingsSection sect = settingsService.RecreateSection(Constants.SettingsGuid);

            sect.Attribute(nameof(CopyInjectedDLLToTemp), CopyInjectedDLLToTemp);

            ISettingsSection sectInjections = sect.GetOrCreateSection(SectionRecentInjections);

            foreach (var injection in RecentInjections)
            {
                ISettingsSection sectInjection = sectInjections.CreateSection(SectionRecentInjectionsInjection);
                sectInjection.Attribute(nameof(injection.Path), injection.Path);
                sectInjection.Attribute(nameof(injection.Type), injection.Type);
                sectInjection.Attribute(nameof(injection.Method), injection.Method);
                if (injection.Argument != null)
                {
                    sectInjection.Attribute(nameof(injection.Argument), injection.Argument);
                }
            }
        }
Exemplo n.º 23
0
        private void OnPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            ISettingsSection sect = settingsService.RecreateSection(Constants.SettingsGuid);

            sect.Attribute(nameof(UnderlineManagedAssemblies), UnderlineManagedAssemblies);
            sect.Attribute(nameof(CopyInjectedDllToTemp), CopyInjectedDllToTemp);
            sect.Attribute(nameof(AutoMapDllImports), AutoMapDllImports);
            sect.Attribute(nameof(AutoMapOverrides), AutoMapOverrides);

            ISettingsSection sectInjections = sect.GetOrCreateSection(SectionRecentInjections);

            foreach (var injection in RecentInjections)
            {
                ISettingsSection sectInjection = sectInjections.CreateSection(SectionRecentInjectionsInjection);
                sectInjection.Attribute(nameof(injection.Path), injection.Path);
                sectInjection.Attribute(nameof(injection.Namespace), injection.Namespace);
                sectInjection.Attribute(nameof(injection.Type), injection.Type);
                sectInjection.Attribute(nameof(injection.Method), injection.Method);
                if (injection.Argument != null)
                {
                    sectInjection.Attribute(nameof(injection.Argument), injection.Argument);
                }
            }
        }
Exemplo n.º 24
0
 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);
     }
 }
Exemplo n.º 25
0
 public void Save(ISettingsSection section)
 {
     section.Attribute(FILELIST_NAME_ATTR, Name);
     foreach (var info in files)
         DnSpyFileInfoSerializer.Save(section.CreateSection(FILE_SECTION), info);
 }
Exemplo n.º 26
0
		public void Save(ISettingsSection section) {
			foreach (var name in Names)
				NodePathNameSerializer.Save(section.CreateSection(NAME_SECTION), name);
		}
Exemplo n.º 27
0
 public void Save(ISettingsSection section)
 {
     section.Attribute(CURRENT_LIST_ATTR, SelectedFileList.Name);
     foreach (var fileList in fileLists)
         fileList.Save(section.CreateSection(FILE_LIST_SECTION));
 }
Exemplo n.º 28
0
		public void Save(ISettingsSection section) {
			Debug.Assert(Content.Attribute<Guid?>(CONTENT_GUID_ATTR) != null);
			section.CreateSection(CONTENT_SECTION).CopyFrom(Content);
			section.CreateSection(UI_SECTION).CopyFrom(UI);
			section.CreateSection(TAB_UI_SECTION).CopyFrom(TabUI);
			foreach (var path in Paths)
				path.Save(section.CreateSection(PATH_SECTION));
			foreach (var f in AutoLoadedDocuments)
				DsDocumentInfoSerializer.Save(section.CreateSection(AUTOLOADED_SECTION), f);
		}
Exemplo n.º 29
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);
 }
Exemplo n.º 30
0
 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);
 }
Exemplo n.º 31
0
		public void Save(ISettingsSection section) {
			section.Attribute(CURRENT_LIST_ATTR, SelectedDocumentList.Name);
			foreach (var documentList in documentsList)
				documentList.Save(section.CreateSection(DOCUMENT_LIST_SECTION));
		}
Exemplo n.º 32
0
		public void Save(ISettingsSection section) {
			section.Attribute(INDEX_ATTR, Index);

			foreach (var st in Tabs)
				st.Save(section.CreateSection(TAB_SECTION));
		}