Beispiel #1
0
        public SessionSettings(ILSpySettings spySettings)
        {
            XElement doc = spySettings["SessionSettings"];

            XElement filterSettings = doc.Element("FilterSettings");

            if (filterSettings == null)
            {
                filterSettings = new XElement("FilterSettings");
            }

            this.FilterSettings = new FilterSettings(filterSettings);

            this.ActiveAssemblyList = Unescape((string)doc.Element("ActiveAssemblyList"));

            this.WindowState  = FromString((string)doc.Element("WindowState"), WindowState.Normal);
            this.IsFullScreen = FromString((string)doc.Element("IsFullScreen"), false);
            var winBoundsString = (string)doc.Element("WindowBounds");

            if (winBoundsString != null)
            {
                this.WindowBounds = FromString(winBoundsString, DefaultWindowBounds);
            }
            this.LeftColumnWidth           = FromString((string)doc.Element("LeftColumnWidth"), 0.0);
            this.WordWrap                  = FromString((string)doc.Element("WordWrap"), false);
            this.HighlightCurrentLine      = FromString((string)doc.Element("HighlightCurrentLine"), true);
            this.TopPaneSettings.Name      = FromString((string)doc.Element("TopPaneName"), string.Empty);
            this.TopPaneSettings.Height    = FromString((string)doc.Element("TopPaneHeight"), 200.0);
            this.BottomPaneSettings.Name   = FromString((string)doc.Element("BottomPaneName"), string.Empty);
            this.BottomPaneSettings.Height = FromString((string)doc.Element("BottomPaneHeight"), 200.0);
            this.ThemeName                 = (string)doc.Element("ThemeName") ?? dnSpy.dntheme.Themes.DefaultThemeName;

            var ignoreXml = doc.Element("IgnoredWarnings");

            if (ignoreXml != null)
            {
                foreach (var child in ignoreXml.Elements("Warning"))
                {
                    var id = Unescape((string)child);
                    if (id != null)
                    {
                        IgnoredWarnings.Add(id);
                    }
                }
            }

            var groups = doc.Element("TabGroups");

            if (groups == null)
            {
                this.TabsFound           = false;
                this.SavedTabGroupsState = new SavedTabGroupsState();
            }
            else
            {
                this.TabsFound           = true;
                this.SavedTabGroupsState = SavedTabGroupsState.FromXml(groups);
            }
        }