diff --git a/ILSpy/GuessFileType.cs b/ILSpy/GuessFileType.cs index 596634b56..b27597337 100644 --- a/ILSpy/GuessFileType.cs +++ b/ILSpy/GuessFileType.cs @@ -48,7 +48,7 @@ namespace ICSharpCode.ILSpy // Now we got a StreamReader with the correct encoding // Check for XML now try { - XmlTextReader xmlReader = new XmlTextReader(stream); + XmlTextReader xmlReader = new XmlTextReader(reader); xmlReader.XmlResolver = null; xmlReader.MoveToContent(); return FileType.Xml; diff --git a/ILSpy/MainWindow.xaml b/ILSpy/MainWindow.xaml index 4924db31c..89c1cf31b 100644 --- a/ILSpy/MainWindow.xaml +++ b/ILSpy/MainWindow.xaml @@ -97,11 +97,13 @@ diff --git a/ILSpy/MainWindow.xaml.cs b/ILSpy/MainWindow.xaml.cs index 73c8b0019..be18a41cc 100644 --- a/ILSpy/MainWindow.xaml.cs +++ b/ILSpy/MainWindow.xaml.cs @@ -57,12 +57,16 @@ namespace ICSharpCode.ILSpy this.Top = sessionSettings.WindowBounds.Top; this.Width = sessionSettings.WindowBounds.Width; this.Height = sessionSettings.WindowBounds.Height; - // TODO: validate bounds (maybe a screen was removed...) + // TODO: validate bounds (maybe a monitor was removed...) this.WindowState = sessionSettings.WindowState; InitializeComponent(); decompilerTextView.mainWindow = this; + if (sessionSettings.SplitterPosition > 0 && sessionSettings.SplitterPosition < 1) { + leftColumn.Width = new GridLength(sessionSettings.SplitterPosition, GridUnitType.Star); + rightColumn.Width = new GridLength(1 - sessionSettings.SplitterPosition, GridUnitType.Star); + } sessionSettings.FilterSettings.PropertyChanged += filterSettings_PropertyChanged; #if DEBUG @@ -347,6 +351,7 @@ namespace ICSharpCode.ILSpy sessionSettings.ActiveAssemblyList = assemblyList.ListName; sessionSettings.ActiveTreeViewPath = GetPathForNode(treeView.SelectedItem as SharpTreeNode); sessionSettings.WindowBounds = this.RestoreBounds; + sessionSettings.SplitterPosition = leftColumn.Width.Value / (leftColumn.Width.Value + rightColumn.Width.Value); sessionSettings.Save(); } } diff --git a/ILSpy/SessionSettings.cs b/ILSpy/SessionSettings.cs index e419e12fe..f3c50e2c0 100644 --- a/ILSpy/SessionSettings.cs +++ b/ILSpy/SessionSettings.cs @@ -48,6 +48,7 @@ namespace ICSharpCode.ILSpy this.WindowState = FromString((string)doc.Element("WindowState"), WindowState.Normal); this.WindowBounds = FromString((string)doc.Element("WindowBounds"), new Rect(10, 10, 750, 550)); + this.SplitterPosition = FromString((string)doc.Element("SplitterPosition"), 0.4); } public event PropertyChangedEventHandler PropertyChanged; @@ -66,6 +67,7 @@ namespace ICSharpCode.ILSpy public WindowState WindowState = WindowState.Normal; public Rect WindowBounds; + public double SplitterPosition; public void Save() { @@ -79,6 +81,7 @@ namespace ICSharpCode.ILSpy } doc.Add(new XElement("WindowState", ToString(this.WindowState))); doc.Add(new XElement("WindowBounds", ToString(this.WindowBounds))); + doc.Add(new XElement("SplitterPosition", ToString(this.SplitterPosition))); ILSpySettings.SaveSettings(doc); }