mirror of
https://github.com/reactos/reactosdbg.git
synced 2025-02-17 01:49:16 +00:00
Simple settings window with directory chooser. Avoids some embarassment.
svn path=/trunk/tools/reactosdbg/; revision=760
This commit is contained in:
parent
6030ecd415
commit
4cc5cfe654
115
RosDBG/DirectoryChooser.Designer.cs
generated
Normal file
115
RosDBG/DirectoryChooser.Designer.cs
generated
Normal file
@ -0,0 +1,115 @@
|
||||
namespace RosDBG
|
||||
{
|
||||
partial class DirectoryChooser
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.DirectoryTree = new System.Windows.Forms.TreeView();
|
||||
this.OKButton = new System.Windows.Forms.Button();
|
||||
this.CancelButton = new System.Windows.Forms.Button();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
||||
this.splitContainer1.IsSplitterFixed = true;
|
||||
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer1.Name = "splitContainer1";
|
||||
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
this.splitContainer1.Panel1.Controls.Add(this.DirectoryTree);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
this.splitContainer1.Panel2.Controls.Add(this.OKButton);
|
||||
this.splitContainer1.Panel2.Controls.Add(this.CancelButton);
|
||||
this.splitContainer1.Size = new System.Drawing.Size(292, 269);
|
||||
this.splitContainer1.SplitterDistance = 235;
|
||||
this.splitContainer1.TabIndex = 0;
|
||||
//
|
||||
// DirectoryTree
|
||||
//
|
||||
this.DirectoryTree.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.DirectoryTree.Location = new System.Drawing.Point(0, 0);
|
||||
this.DirectoryTree.Name = "DirectoryTree";
|
||||
this.DirectoryTree.Size = new System.Drawing.Size(292, 235);
|
||||
this.DirectoryTree.TabIndex = 0;
|
||||
this.DirectoryTree.AfterCollapse += new System.Windows.Forms.TreeViewEventHandler(this.DirectoryTree_AfterCollapse);
|
||||
this.DirectoryTree.AfterExpand += new System.Windows.Forms.TreeViewEventHandler(this.DirectoryTree_AfterExpand);
|
||||
//
|
||||
// OKButton
|
||||
//
|
||||
this.OKButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.OKButton.Location = new System.Drawing.Point(133, 3);
|
||||
this.OKButton.Name = "OKButton";
|
||||
this.OKButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.OKButton.TabIndex = 1;
|
||||
this.OKButton.Text = "OK";
|
||||
this.OKButton.UseVisualStyleBackColor = true;
|
||||
this.OKButton.Click += new System.EventHandler(this.OKButton_Click);
|
||||
//
|
||||
// CancelButton
|
||||
//
|
||||
this.CancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.CancelButton.Location = new System.Drawing.Point(214, 3);
|
||||
this.CancelButton.Name = "CancelButton";
|
||||
this.CancelButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.CancelButton.TabIndex = 0;
|
||||
this.CancelButton.Text = "Cancel";
|
||||
this.CancelButton.UseVisualStyleBackColor = true;
|
||||
this.CancelButton.Click += new System.EventHandler(this.CancelButton_Click);
|
||||
//
|
||||
// DirectoryChooser
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(292, 269);
|
||||
this.Controls.Add(this.splitContainer1);
|
||||
this.Name = "DirectoryChooser";
|
||||
this.Text = "DirectoryChooser";
|
||||
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||
private System.Windows.Forms.TreeView DirectoryTree;
|
||||
private System.Windows.Forms.Button OKButton;
|
||||
private System.Windows.Forms.Button CancelButton;
|
||||
}
|
||||
}
|
139
RosDBG/DirectoryChooser.cs
Normal file
139
RosDBG/DirectoryChooser.cs
Normal file
@ -0,0 +1,139 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.Design;
|
||||
using System.Drawing.Design;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
|
||||
namespace RosDBG
|
||||
{
|
||||
public partial class DirectoryChooser : Form
|
||||
{
|
||||
Dictionary<string, TreeNode> mDirectories = new Dictionary<string, TreeNode>();
|
||||
|
||||
public string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
TreeNode selected = DirectoryTree.SelectedNode;
|
||||
if (selected == null)
|
||||
return Path.GetDirectoryName(Application.ExecutablePath);
|
||||
else
|
||||
return (string)selected.Tag;
|
||||
}
|
||||
set
|
||||
{
|
||||
TreeNode tn = ShowNode(value);
|
||||
DirectoryTree.SelectedNode = tn;
|
||||
tn.EnsureVisible();
|
||||
}
|
||||
}
|
||||
|
||||
public DirectoryChooser()
|
||||
{
|
||||
InitializeComponent();
|
||||
DirectoryTree.Nodes.Clear();
|
||||
foreach (DriveInfo drive in DriveInfo.GetDrives())
|
||||
{
|
||||
ShowNode(drive.RootDirectory.FullName);
|
||||
}
|
||||
}
|
||||
|
||||
private void OKButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void CancelButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
|
||||
void ExpandNode(TreeNode node, string dir)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (node.Nodes.Count == 1 && node.Nodes[0].Text == "...")
|
||||
{
|
||||
node.Nodes.Clear();
|
||||
|
||||
foreach (string subdir in Directory.GetDirectories(dir))
|
||||
{
|
||||
TreeNode newNode = new TreeNode(Path.GetFileName(subdir));
|
||||
newNode.Tag = subdir;
|
||||
newNode.Nodes.Add("...");
|
||||
mDirectories[subdir.ToLower()] = newNode;
|
||||
node.Nodes.Add(newNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
TreeNode ShowNode(string dir)
|
||||
{
|
||||
string parentDir = Path.GetDirectoryName(dir);
|
||||
TreeNode theNode;
|
||||
// We reached a root
|
||||
if (mDirectories.TryGetValue(dir.ToLower(), out theNode))
|
||||
{
|
||||
return theNode;
|
||||
}
|
||||
else if (parentDir == null)
|
||||
{
|
||||
theNode = new TreeNode(dir);
|
||||
theNode.Tag = dir;
|
||||
theNode.Nodes.Add("...");
|
||||
mDirectories[dir.ToLower()] = theNode;
|
||||
DirectoryTree.Nodes.Add(theNode);
|
||||
return theNode;
|
||||
}
|
||||
else
|
||||
{
|
||||
theNode = ShowNode(parentDir);
|
||||
ExpandNode(theNode, parentDir);
|
||||
}
|
||||
return ShowNode(dir);
|
||||
}
|
||||
|
||||
private void DirectoryTree_AfterExpand(object sender, TreeViewEventArgs e)
|
||||
{
|
||||
string dir = (string)e.Node.Tag;
|
||||
ExpandNode(e.Node, dir);
|
||||
}
|
||||
|
||||
private void DirectoryTree_AfterCollapse(object sender, TreeViewEventArgs e)
|
||||
{
|
||||
e.Node.Nodes.Clear();
|
||||
e.Node.Nodes.Add("...");
|
||||
}
|
||||
}
|
||||
|
||||
public class DirectoryEditor : UITypeEditor
|
||||
{
|
||||
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
|
||||
{
|
||||
return UITypeEditorEditStyle.Modal;
|
||||
}
|
||||
|
||||
public override object EditValue(ITypeDescriptorContext typedesc, IServiceProvider provider, object value)
|
||||
{
|
||||
DirectoryChooser chooser = new DirectoryChooser();
|
||||
chooser.Value = (string)value;
|
||||
if (chooser.ShowDialog() == DialogResult.OK)
|
||||
return chooser.Value;
|
||||
else
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
120
RosDBG/DirectoryChooser.resx
Normal file
120
RosDBG/DirectoryChooser.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
12
RosDBG/MainWindow.Designer.cs
generated
12
RosDBG/MainWindow.Designer.cs
generated
@ -32,7 +32,6 @@
|
||||
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
|
||||
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.openSourceFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.addSymbolFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.symbolDirectoryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.connectSerialToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.connectPipeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
@ -105,7 +104,6 @@
|
||||
//
|
||||
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.openSourceFileToolStripMenuItem,
|
||||
this.addSymbolFileToolStripMenuItem,
|
||||
this.symbolDirectoryToolStripMenuItem,
|
||||
this.connectSerialToolStripMenuItem,
|
||||
this.connectPipeToolStripMenuItem,
|
||||
@ -121,17 +119,12 @@
|
||||
this.openSourceFileToolStripMenuItem.Size = new System.Drawing.Size(175, 22);
|
||||
this.openSourceFileToolStripMenuItem.Text = "Open Source File ...";
|
||||
//
|
||||
// addSymbolFileToolStripMenuItem
|
||||
//
|
||||
this.addSymbolFileToolStripMenuItem.Name = "addSymbolFileToolStripMenuItem";
|
||||
this.addSymbolFileToolStripMenuItem.Size = new System.Drawing.Size(175, 22);
|
||||
this.addSymbolFileToolStripMenuItem.Text = "Add Symbol File ...";
|
||||
//
|
||||
// symbolDirectoryToolStripMenuItem
|
||||
//
|
||||
this.symbolDirectoryToolStripMenuItem.Name = "symbolDirectoryToolStripMenuItem";
|
||||
this.symbolDirectoryToolStripMenuItem.Size = new System.Drawing.Size(175, 22);
|
||||
this.symbolDirectoryToolStripMenuItem.Text = "Symbol Path ...";
|
||||
this.symbolDirectoryToolStripMenuItem.Text = "Settings ...";
|
||||
this.symbolDirectoryToolStripMenuItem.Click += new System.EventHandler(this.symbolDirectoryToolStripMenuItem_Click);
|
||||
//
|
||||
// connectSerialToolStripMenuItem
|
||||
//
|
||||
@ -360,7 +353,6 @@
|
||||
private System.Windows.Forms.ToolStripMenuItem continueToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem bugcheckToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem openSourceFileToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem addSymbolFileToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem symbolDirectoryToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem connectSerialToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem connectPipeToolStripMenuItem;
|
||||
|
@ -21,7 +21,7 @@ namespace RosDBG
|
||||
bool mRunning;
|
||||
DebugConnection.Mode mConnectionMode;
|
||||
ulong mCurrentEip;
|
||||
string mSourceRoot = ".", mCurrentFile;
|
||||
string mSourceRoot = Settings.SourceDirectory, mCurrentFile;
|
||||
int mCurrentLine;
|
||||
DebugConnection mConnection = new DebugConnection();
|
||||
SymbolContext mSymbolContext;
|
||||
@ -90,7 +90,7 @@ namespace RosDBG
|
||||
mConnection.DebugRegisterChangeEvent += DebugRegisterChangeEvent;
|
||||
mConnection.DebugModuleChangedEvent += DebugModuleChangedEvent;
|
||||
ComposeTitleString();
|
||||
mSymbolContext.ReactosOutputPath = ".\\output-i386";
|
||||
mSymbolContext.ReactosOutputPath = Settings.OutputDirectory;
|
||||
}
|
||||
|
||||
void DebugModuleChangedEvent(object sender, DebugModuleChangedEventArgs args)
|
||||
@ -244,6 +244,13 @@ namespace RosDBG
|
||||
{
|
||||
mConnection.Go();
|
||||
}
|
||||
|
||||
private void symbolDirectoryToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Settings.ShowSettings();
|
||||
mSourceRoot = Settings.SourceDirectory;
|
||||
mSymbolContext.ReactosOutputPath = Settings.OutputDirectory;
|
||||
}
|
||||
}
|
||||
|
||||
public class InteractiveInputEventArgs : EventArgs
|
||||
|
@ -73,6 +73,12 @@
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DebugInfoFile.cs" />
|
||||
<Compile Include="DirectoryChooser.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DirectoryChooser.Designer.cs">
|
||||
<DependentUpon>DirectoryChooser.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="HighLevelInteraction.cs" />
|
||||
<Compile Include="HostWindow.cs">
|
||||
<SubType>Form</SubType>
|
||||
@ -115,6 +121,10 @@
|
||||
<DependentUpon>BackTrace.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="DirectoryChooser.resx">
|
||||
<DependentUpon>DirectoryChooser.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="HostWindow.resx">
|
||||
<DependentUpon>HostWindow.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
@ -152,6 +162,10 @@
|
||||
<DependentUpon>RegisterView.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Settings.resx">
|
||||
<DependentUpon>Settings.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="SourceView.resx">
|
||||
<DependentUpon>SourceView.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
@ -192,6 +206,12 @@
|
||||
<Compile Include="RegisterView.Designer.cs">
|
||||
<DependentUpon>RegisterView.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Settings.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Settings.Designer.cs">
|
||||
<DependentUpon>Settings.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SourceView.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
|
114
RosDBG/Settings.Designer.cs
generated
Normal file
114
RosDBG/Settings.Designer.cs
generated
Normal file
@ -0,0 +1,114 @@
|
||||
namespace RosDBG
|
||||
{
|
||||
partial class Settings
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.SettingsGrid = new System.Windows.Forms.PropertyGrid();
|
||||
this.OKButton = new System.Windows.Forms.Button();
|
||||
this.CancelButton = new System.Windows.Forms.Button();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
||||
this.splitContainer1.IsSplitterFixed = true;
|
||||
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer1.Name = "splitContainer1";
|
||||
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
this.splitContainer1.Panel1.Controls.Add(this.SettingsGrid);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
this.splitContainer1.Panel2.Controls.Add(this.OKButton);
|
||||
this.splitContainer1.Panel2.Controls.Add(this.CancelButton);
|
||||
this.splitContainer1.Size = new System.Drawing.Size(415, 317);
|
||||
this.splitContainer1.SplitterDistance = 284;
|
||||
this.splitContainer1.TabIndex = 0;
|
||||
//
|
||||
// SettingsGrid
|
||||
//
|
||||
this.SettingsGrid.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.SettingsGrid.Location = new System.Drawing.Point(0, 0);
|
||||
this.SettingsGrid.Name = "SettingsGrid";
|
||||
this.SettingsGrid.Size = new System.Drawing.Size(415, 284);
|
||||
this.SettingsGrid.TabIndex = 0;
|
||||
//
|
||||
// OKButton
|
||||
//
|
||||
this.OKButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.OKButton.Location = new System.Drawing.Point(256, 3);
|
||||
this.OKButton.Name = "OKButton";
|
||||
this.OKButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.OKButton.TabIndex = 1;
|
||||
this.OKButton.Text = "OK";
|
||||
this.OKButton.UseVisualStyleBackColor = true;
|
||||
this.OKButton.Click += new System.EventHandler(this.OKButton_Click);
|
||||
//
|
||||
// CancelButton
|
||||
//
|
||||
this.CancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.CancelButton.Location = new System.Drawing.Point(337, 3);
|
||||
this.CancelButton.Name = "CancelButton";
|
||||
this.CancelButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.CancelButton.TabIndex = 0;
|
||||
this.CancelButton.Text = "Cancel";
|
||||
this.CancelButton.UseVisualStyleBackColor = true;
|
||||
this.CancelButton.Click += new System.EventHandler(this.CancelButton_Click);
|
||||
//
|
||||
// Settings
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(415, 317);
|
||||
this.Controls.Add(this.splitContainer1);
|
||||
this.Name = "Settings";
|
||||
this.Text = "Settings";
|
||||
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||
private System.Windows.Forms.PropertyGrid SettingsGrid;
|
||||
private System.Windows.Forms.Button OKButton;
|
||||
private System.Windows.Forms.Button CancelButton;
|
||||
|
||||
}
|
||||
}
|
72
RosDBG/Settings.cs
Normal file
72
RosDBG/Settings.cs
Normal file
@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Configuration;
|
||||
using System.Windows.Forms;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing.Design;
|
||||
|
||||
namespace RosDBG
|
||||
{
|
||||
public partial class Settings : Form
|
||||
{
|
||||
public class SettingsPropertyValues : ApplicationSettingsBase
|
||||
{
|
||||
[UserScopedSetting, DefaultSettingValue("."), Editor(typeof(DirectoryEditor), typeof(UITypeEditor))]
|
||||
public string SourceDirectory
|
||||
{
|
||||
get { return this["SourceDirectory"].ToString(); }
|
||||
set { this["SourceDirectory"] = value; }
|
||||
}
|
||||
|
||||
[UserScopedSetting,DefaultSettingValue(".\\output-i386"),Editor(typeof(DirectoryEditor), typeof(UITypeEditor))]
|
||||
public string OutputDirectory
|
||||
{
|
||||
get { return this["OutputDirectory"].ToString(); }
|
||||
set { this["OutputDirectory"] = value; }
|
||||
}
|
||||
|
||||
public SettingsPropertyValues()
|
||||
{
|
||||
Reload();
|
||||
}
|
||||
}
|
||||
|
||||
static SettingsPropertyValues mProperties = new SettingsPropertyValues();
|
||||
|
||||
public static string SourceDirectory { get { return mProperties.SourceDirectory; } }
|
||||
public static string OutputDirectory { get { return mProperties.OutputDirectory; } }
|
||||
|
||||
Settings()
|
||||
{
|
||||
InitializeComponent();
|
||||
mProperties.Reload();
|
||||
SettingsGrid.SelectedObject = mProperties;
|
||||
}
|
||||
|
||||
public static void ShowSettings()
|
||||
{
|
||||
Settings s = new Settings();
|
||||
if (s.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
mProperties.Save();
|
||||
}
|
||||
}
|
||||
|
||||
private void OKButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void CancelButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
120
RosDBG/Settings.resx
Normal file
120
RosDBG/Settings.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
Loading…
x
Reference in New Issue
Block a user