mirror of https://github.com/icsharpcode/ILSpy.git
Browse Source
Remove the Attach button from toolbar. Add Debugger options panel + move all options panels in Options folder.pull/191/merge
12 changed files with 191 additions and 72 deletions
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
|
||||
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
|
||||
namespace ILSpy.Debugger |
||||
{ |
||||
public class DebuggerSettings : INotifyPropertyChanged |
||||
{ |
||||
bool showWarnings = true; |
||||
|
||||
/// <summary>
|
||||
/// Show warnings messages.
|
||||
/// </summary>
|
||||
public bool ShowWarnings { |
||||
get { return showWarnings; } |
||||
set { |
||||
if (showWarnings != value) { |
||||
showWarnings = value; |
||||
OnPropertyChanged("ShowWarnings"); |
||||
} |
||||
} |
||||
} |
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged; |
||||
|
||||
protected virtual void OnPropertyChanged(string propertyName) |
||||
{ |
||||
if (PropertyChanged != null) { |
||||
PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); |
||||
} |
||||
} |
||||
} |
||||
} |
Before Width: | Height: | Size: 827 B |
@ -0,0 +1,10 @@
@@ -0,0 +1,10 @@
|
||||
<UserControl x:Class="ICSharpCode.ILSpy.Options.DebuggerSettingsPanel" |
||||
x:ClassModifier="internal" |
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
||||
<Grid> |
||||
<StackPanel Margin="10"> |
||||
<CheckBox IsChecked="{Binding ShowWarnings}">Show warning messages</CheckBox> |
||||
</StackPanel> |
||||
</Grid> |
||||
</UserControl> |
@ -0,0 +1,63 @@
@@ -0,0 +1,63 @@
|
||||
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
|
||||
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
using System.Windows; |
||||
using System.Windows.Controls; |
||||
using System.Windows.Data; |
||||
using System.Windows.Documents; |
||||
using System.Windows.Input; |
||||
using System.Windows.Media; |
||||
using System.Xml.Linq; |
||||
|
||||
using ILSpy.Debugger; |
||||
|
||||
namespace ICSharpCode.ILSpy.Options |
||||
{ |
||||
[ExportOptionPage(Title = "Debugger", Order = 1)] |
||||
partial class DebuggerSettingsPanel : UserControl, IOptionPage |
||||
{ |
||||
public DebuggerSettingsPanel() |
||||
{ |
||||
InitializeComponent(); |
||||
} |
||||
|
||||
public void Load(ILSpySettings settings) |
||||
{ |
||||
this.DataContext = LoadDebuggerSettings(settings); |
||||
} |
||||
|
||||
static DebuggerSettings currentDebuggerSettings; |
||||
|
||||
public static DebuggerSettings CurrentDebuggerSettings { |
||||
get { |
||||
return currentDebuggerSettings ?? (currentDebuggerSettings = LoadDebuggerSettings(ILSpySettings.Load())); |
||||
} |
||||
} |
||||
|
||||
public static DebuggerSettings LoadDebuggerSettings(ILSpySettings settings) |
||||
{ |
||||
XElement e = settings["DebuggerSettings"]; |
||||
DebuggerSettings s = new DebuggerSettings(); |
||||
s.ShowWarnings = (bool?)e.Attribute("showWarnings") ?? s.ShowWarnings; |
||||
return s; |
||||
} |
||||
|
||||
public void Save(XElement root) |
||||
{ |
||||
var s = (DebuggerSettings)this.DataContext; |
||||
XElement section = new XElement("DebuggerSettings"); |
||||
section.SetAttributeValue("showWarnings", s.ShowWarnings); |
||||
|
||||
XElement existingElement = root.Element("DebuggerSettings"); |
||||
if (existingElement != null) |
||||
existingElement.ReplaceWith(section); |
||||
else |
||||
root.Add(section); |
||||
|
||||
currentDebuggerSettings = null; // invalidate cached settings
|
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue