My first commit in a very long time. I'm releasing the source code of my C# implementation of Rbuild by popular demand :) I would have preferred to release the code under a BSD licence but there is a small portion of ancient Nant GPL code that would have been to be rewritten first.

There are two executables (SysGen.Designer) and (SysGen.Make)

SysGen.Designer is a windows forms tool that allows to generate customized reactos images, it is similar in concept to Windows CE Platfom Builder. SysGen.Make is the actual Rbuild clone, It has three main parts, the .rbuild file parser + in-memory tree representation, the backends , and the auto generated files. The Mingw backend used to work 1'5 years ago and produced a 100% valid makefile.auto but have to be updated to be able to build a recent revision. Rewriting parts of it to take advantage of C# 3.5 extension methods would probably reduce the code by 50%. The other two parts are quite stable.

This code was only a proof of concept and was never intended to be released so there is a ton of unpolished code and hacks required by the current C++ implementation that should be removed.

How to test it:

Select SysGen.Make as the Start-up Project in Visual Studio and edit Program.cs to point to the correct path to ReactOS-i386.rbuild Edit SysGenEngine.cs:639 to enable/disable specific backends, The HtmlBackend in \SysGen.BuildEngine\Backends\Html\HtmlBackend.cs is a very simple illustration of how powerful this framework is.

Happy hacking!

svn path=/trunk/; revision=46862
This commit is contained in:
Marc Piulachs
2010-04-13 21:59:21 +00:00
parent c100c972c1
commit 9032acdcf8
386 changed files with 35340 additions and 0 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@@ -0,0 +1,58 @@
using System.Reflection;
using System.Runtime.CompilerServices;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.*")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not signed.
// (*) KeyName refers to a key that has been installed in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that key is used.
// (2) If the KeyName does not exist and the KeyFile does exist, the key
// in the KeyFile is installed into the CSP and used.
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of the KeyFile should be
// relative to the project output directory which is
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
// located in the project directory, you would specify the AssemblyKeyFile
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@@ -0,0 +1,58 @@
using System.Reflection;
using System.Runtime.CompilerServices;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.*")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not signed.
// (*) KeyName refers to a key that has been installed in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that key is used.
// (2) If the KeyName does not exist and the KeyFile does exist, the key
// in the KeyFile is installed into the CSP and used.
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of the KeyFile should be
// relative to the project output directory which is
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
// located in the project directory, you would specify the AssemblyKeyFile
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]
@@ -0,0 +1,201 @@
using System;
using System.IO;
using System.Windows.Forms;
using System.ComponentModel;
using System.Collections;
using System.Drawing;
namespace C2C.FileSystem
{
/// <summary>
/// Summary description for DirectoryTreeView.
/// </summary>
///
public class FileSystemTreeView : TreeView
{
private bool _showFiles = true;
private ImageList _imageList = new ImageList();
private Hashtable _systemIcons = new Hashtable();
public static readonly int Folder = 0;
public FileSystemTreeView()
{
this.ImageList = _imageList;
this.MouseDown += new MouseEventHandler(FileSystemTreeView_MouseDown);
this.BeforeExpand += new TreeViewCancelEventHandler(FileSystemTreeView_BeforeExpand);
}
void FileSystemTreeView_MouseDown(object sender, MouseEventArgs e)
{
TreeNode node = this.GetNodeAt(e.X, e.Y);
if (node == null)
return;
this.SelectedNode = node; //select the node under the mouse
}
void FileSystemTreeView_BeforeExpand(object sender, TreeViewCancelEventArgs e)
{
if( e.Node is FileNode ) return;
DirectoryNode node = (DirectoryNode)e.Node;
if (!node.Loaded)
{
node.Nodes[0].Remove(); //remove the fake child node used for virtualization
node.LoadDirectory();
if( this._showFiles == true )
node.LoadFiles();
}
}
public void Load( string directoryPath )
{
if( Directory.Exists( directoryPath ) == false )
throw new DirectoryNotFoundException( "Directory Not Found" );
_systemIcons.Clear();
_imageList.Images.Clear();
Nodes.Clear();
Icon folderIcon = new Icon( typeof( FileSystemTreeView ), "icons.folder.ico");
_imageList.Images.Add( folderIcon );
_systemIcons.Add( FileSystemTreeView.Folder, 0 );
DirectoryNode node = new DirectoryNode( this, new DirectoryInfo( directoryPath ) );
node.Expand();
}
public int GetIconImageIndex( string path )
{
string extension = Path.GetExtension( path );
if( _systemIcons.ContainsKey( extension ) == false )
{
Icon icon = ShellIcon.GetSmallIcon( path );
_imageList.Images.Add( icon );
_systemIcons.Add( extension, _imageList.Images.Count-1 );
}
return (int)_systemIcons[ Path.GetExtension( path )];
}
public bool ShowFiles
{
get{ return this._showFiles; }
set{ this._showFiles = value; }
}
}
public class DirectoryNode : TreeNode
{
private DirectoryInfo _directoryInfo;
public DirectoryNode( DirectoryNode parent, DirectoryInfo directoryInfo ) : base( directoryInfo.Name )
{
this._directoryInfo = directoryInfo;
this.ImageIndex = FileSystemTreeView.Folder;
this.SelectedImageIndex = this.ImageIndex;
parent.Nodes.Add( this );
Virtualize();
}
public DirectoryNode( FileSystemTreeView treeView, DirectoryInfo directoryInfo ) : base( directoryInfo.Name )
{
this._directoryInfo = directoryInfo;
this.ImageIndex = FileSystemTreeView.Folder;
this.SelectedImageIndex = this.ImageIndex;
treeView.Nodes.Add( this );
Virtualize();
}
void Virtualize()
{
int fileCount = 0;
try
{
if( this.TreeView.ShowFiles == true )
fileCount = this._directoryInfo.GetFiles().Length;
if( (fileCount + this._directoryInfo.GetDirectories().Length) > 0 )
new FakeChildNode( this );
}
catch
{
}
}
public void LoadDirectory()
{
foreach( DirectoryInfo directoryInfo in _directoryInfo.GetDirectories() )
{
new DirectoryNode( this, directoryInfo );
}
}
public void LoadFiles()
{
foreach( FileInfo file in _directoryInfo.GetFiles() )
{
new FileNode( this, file );
}
}
public bool Loaded
{
get
{
if( this.Nodes.Count != 0 )
{
if( this.Nodes[0] is FakeChildNode )
return false;
}
return true;
}
}
public new FileSystemTreeView TreeView
{
get{ return (FileSystemTreeView)base.TreeView; }
}
}
public class FileNode : TreeNode
{
private FileInfo _fileInfo;
private DirectoryNode _directoryNode;
public FileNode( DirectoryNode directoryNode, FileInfo fileInfo ) : base( fileInfo.Name )
{
this._directoryNode = directoryNode;
this._fileInfo = fileInfo;
this.ImageIndex = ((FileSystemTreeView)_directoryNode.TreeView).GetIconImageIndex( _fileInfo.FullName );
this.SelectedImageIndex = this.ImageIndex;
_directoryNode.Nodes.Add( this );
}
}
public class FakeChildNode : TreeNode
{
public FakeChildNode( TreeNode parent ) : base()
{
parent.Nodes.Add( this );
}
}
}
@@ -0,0 +1,143 @@
<VisualStudioProject>
<CSHARP
ProjectType = "Local"
ProductVersion = "7.10.3077"
SchemaVersion = "2.0"
ProjectGuid = "{83281176-6B39-4EB8-8CDC-82F018DEED68}"
>
<Build>
<Settings
ApplicationIcon = "App.ico"
AssemblyKeyContainerName = ""
AssemblyName = "DirectoryTreeView"
AssemblyOriginatorKeyFile = ""
DefaultClientScript = "JScript"
DefaultHTMLPageLayout = "Grid"
DefaultTargetSchema = "IE50"
DelaySign = "false"
OutputType = "WinExe"
PreBuildEvent = ""
PostBuildEvent = ""
RootNamespace = "C2C.FileSystem"
RunPostBuildEvent = "OnBuildSuccess"
StartupObject = ""
>
<Config
Name = "Debug"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "DEBUG;TRACE"
DocumentationFile = ""
DebugSymbols = "true"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "false"
OutputPath = "bin\Debug\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
<Config
Name = "Release"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "TRACE"
DocumentationFile = ""
DebugSymbols = "false"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "true"
OutputPath = "bin\Release\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
</Settings>
<References>
<Reference
Name = "System"
AssemblyName = "System"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"
/>
<Reference
Name = "System.Data"
AssemblyName = "System.Data"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"
/>
<Reference
Name = "System.Drawing"
AssemblyName = "System.Drawing"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll"
/>
<Reference
Name = "System.Windows.Forms"
AssemblyName = "System.Windows.Forms"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Windows.Forms.dll"
/>
<Reference
Name = "System.XML"
AssemblyName = "System.Xml"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll"
/>
<Reference
Name = "System.DirectoryServices"
AssemblyName = "System.DirectoryServices"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.DirectoryServices.dll"
/>
</References>
</Build>
<Files>
<Include>
<File
RelPath = "App.ico"
BuildAction = "Content"
/>
<File
RelPath = "AssemblyInfo.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "FileSystemTreeView.cs"
SubType = "Component"
BuildAction = "Compile"
/>
<File
RelPath = "FileSystemTreeView.resx"
DependentUpon = "FileSystemTreeView.cs"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "Form1.cs"
SubType = "Form"
BuildAction = "Compile"
/>
<File
RelPath = "Form1.resx"
DependentUpon = "Form1.cs"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "ShellIcon.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "icons\folder.ico"
BuildAction = "EmbeddedResource"
/>
</Include>
</Files>
</CSHARP>
</VisualStudioProject>
@@ -0,0 +1,48 @@
<VisualStudioProject>
<CSHARP LastOpenVersion = "7.10.3077" >
<Build>
<Settings ReferencePath = "" >
<Config
Name = "Debug"
EnableASPDebugging = "false"
EnableASPXDebugging = "false"
EnableUnmanagedDebugging = "false"
EnableSQLServerDebugging = "false"
RemoteDebugEnabled = "false"
RemoteDebugMachine = ""
StartAction = "Project"
StartArguments = ""
StartPage = ""
StartProgram = ""
StartURL = ""
StartWorkingDirectory = ""
StartWithIE = "false"
/>
<Config
Name = "Release"
EnableASPDebugging = "false"
EnableASPXDebugging = "false"
EnableUnmanagedDebugging = "false"
EnableSQLServerDebugging = "false"
RemoteDebugEnabled = "false"
RemoteDebugMachine = ""
StartAction = "Project"
StartArguments = ""
StartPage = ""
StartProgram = ""
StartURL = ""
StartWorkingDirectory = ""
StartWithIE = "false"
/>
</Settings>
</Build>
<OtherProjectSettings
CopyProjectDestinationFolder = ""
CopyProjectUncPath = ""
CopyProjectOption = "0"
ProjectView = "ProjectFiles"
ProjectTrust = "0"
/>
</CSHARP>
</VisualStudioProject>
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8" ?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<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" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</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>1.0.0.0</value>
</resheader>
<resheader name="Reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="Writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,178 @@
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using C2C.FileSystem;
namespace DirectoryTreeView
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.TextBox txtDirectory;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnDirectory;
private C2C.FileSystem.FileSystemTreeView tree;
private System.Windows.Forms.Panel treePanel;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (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.panel1 = new System.Windows.Forms.Panel();
this.btnDirectory = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.txtDirectory = new System.Windows.Forms.TextBox();
this.treePanel = new System.Windows.Forms.Panel();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.Controls.Add(this.btnDirectory);
this.panel1.Controls.Add(this.label1);
this.panel1.Controls.Add(this.txtDirectory);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(721, 57);
this.panel1.TabIndex = 0;
//
// btnDirectory
//
this.btnDirectory.Location = new System.Drawing.Point(615, 27);
this.btnDirectory.Name = "btnDirectory";
this.btnDirectory.Size = new System.Drawing.Size(30, 21);
this.btnDirectory.TabIndex = 2;
this.btnDirectory.Text = "...";
this.btnDirectory.Click += new System.EventHandler(this.btnDirectory_Click);
//
// label1
//
this.label1.Location = new System.Drawing.Point(9, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(102, 18);
this.label1.TabIndex = 1;
this.label1.Text = "Directory:";
//
// txtDirectory
//
this.txtDirectory.Location = new System.Drawing.Point(9, 27);
this.txtDirectory.Name = "txtDirectory";
this.txtDirectory.Size = new System.Drawing.Size(603, 20);
this.txtDirectory.TabIndex = 0;
this.txtDirectory.Text = "";
this.txtDirectory.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtDirectory_KeyDown);
this.txtDirectory.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtDirectory_KeyPress);
//
// treePanel
//
this.treePanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.treePanel.Location = new System.Drawing.Point(0, 57);
this.treePanel.Name = "treePanel";
this.treePanel.Size = new System.Drawing.Size(721, 530);
this.treePanel.TabIndex = 1;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(721, 587);
this.Controls.Add(this.treePanel);
this.Controls.Add(this.panel1);
this.Name = "Form1";
this.Text = "Demo Application";
this.Load += new System.EventHandler(this.Form1_Load);
this.panel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void Form1_Load(object sender, System.EventArgs e)
{
tree = new C2C.FileSystem.FileSystemTreeView();
treePanel.Controls.Add( tree );
tree.Dock = DockStyle.Fill;
//tree.ShowFiles = false;
}
private void btnDirectory_Click(object sender, System.EventArgs e)
{
FolderBrowserDialog dlg = new FolderBrowserDialog();
if( dlg.ShowDialog() == DialogResult.OK )
{
txtDirectory.Text = dlg.SelectedPath;
tree.Load( txtDirectory.Text );
}
}
private void txtDirectory_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
}
private void txtDirectory_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
if( e.KeyData == Keys.Enter )
{
if( System.IO.Directory.Exists( txtDirectory.Text ) == false )
{
MessageBox.Show( "Directory Does Not Exist", "Invalid Directory", MessageBoxButtons.OK, MessageBoxIcon.Information );
return;
}
tree.Load( txtDirectory.Text );
}
}
}
}
@@ -0,0 +1,193 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
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">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</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 forserialized 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.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:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<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" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</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>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="panel1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="panel1.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="panel1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="panel1.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>3, 3</value>
</data>
<data name="panel1.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="panel1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnDirectory.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="btnDirectory.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnDirectory.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="label1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="label1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="label1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="txtDirectory.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="txtDirectory.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="txtDirectory.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="treePanel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="treePanel.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="treePanel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="treePanel.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>3, 3</value>
</data>
<data name="treePanel.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="treePanel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>(Default)</value>
</data>
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>3, 3</value>
</data>
<data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>80</value>
</data>
<data name="$this.Name">
<value>Form1</value>
</data>
<data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
</root>
@@ -0,0 +1,79 @@
using System;
using System.Drawing;
using System.Runtime.InteropServices;
namespace C2C.FileSystem
{
/// <summary>
/// Summary description for ShellIcon.
/// </summary>
/// <summary>
/// Summary description for ShellIcon. Get a small or large Icon with an easy C# function call
/// that returns a 32x32 or 16x16 System.Drawing.Icon depending on which function you call
/// either GetSmallIcon(string fileName) or GetLargeIcon(string fileName)
/// </summary>
public class ShellIcon
{
[StructLayout(LayoutKind.Sequential)]
public struct SHFILEINFO
{
public IntPtr hIcon;
public IntPtr iIcon;
public uint dwAttributes;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
public string szDisplayName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)]
public string szTypeName;
};
class Win32
{
public const uint SHGFI_ICON = 0x100;
public const uint SHGFI_LARGEICON = 0x0; // 'Large icon
public const uint SHGFI_SMALLICON = 0x1; // 'Small icon
[DllImport("shell32.dll")]
public static extern IntPtr SHGetFileInfo(string pszPath, uint dwFileAttributes, ref SHFILEINFO psfi, uint cbSizeFileInfo, uint uFlags);
}
public ShellIcon()
{
//
// TODO: Add constructor logic here
//
}
public static Icon GetSmallIcon(string fileName)
{
IntPtr hImgSmall; //the handle to the system image list
SHFILEINFO shinfo = new SHFILEINFO();
//Use this to get the small Icon
hImgSmall = Win32.SHGetFileInfo(fileName, 0, ref shinfo,(uint)Marshal.SizeOf(shinfo),Win32.SHGFI_ICON | Win32.SHGFI_SMALLICON);
//The icon is returned in the hIcon member of the shinfo struct
return System.Drawing.Icon.FromHandle(shinfo.hIcon);
}
public static Icon GetLargeIcon(string fileName)
{
IntPtr hImgLarge; //the handle to the system image list
SHFILEINFO shinfo = new SHFILEINFO();
//Use this to get the large Icon
hImgLarge = Win32.SHGetFileInfo(fileName, 0, ref shinfo, (uint)Marshal.SizeOf(shinfo), Win32.SHGFI_ICON | Win32.SHGFI_LARGEICON);
//The icon is returned in the hIcon member of the shinfo struct
return System.Drawing.Icon.FromHandle(shinfo.hIcon);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -0,0 +1,202 @@
using System;
using System.IO;
using System.Windows.Forms;
using System.ComponentModel;
using System.Collections;
using System.Drawing;
namespace C2C.FileSystem
{
/// <summary>
/// Summary description for DirectoryTreeView.
/// </summary>
///
public class FileSystemTreeView : TreeView
{
private bool _showFiles = true;
private ImageList _imageList = new ImageList();
private Hashtable _systemIcons = new Hashtable();
public static readonly int Folder = 0;
public FileSystemTreeView()
{
this.CheckBoxes = true;
this.ImageList = _imageList;
this.MouseDown += new MouseEventHandler(FileSystemTreeView_MouseDown);
this.BeforeExpand += new TreeViewCancelEventHandler(FileSystemTreeView_BeforeExpand);
}
void FileSystemTreeView_MouseDown(object sender, MouseEventArgs e)
{
TreeNode node = this.GetNodeAt(e.X, e.Y);
if (node == null)
return;
this.SelectedNode = node; //select the node under the mouse
}
void FileSystemTreeView_BeforeExpand(object sender, TreeViewCancelEventArgs e)
{
if( e.Node is FileNode ) return;
DirectoryNode node = (DirectoryNode)e.Node;
if (!node.Loaded)
{
node.Nodes[0].Remove(); //remove the fake child node used for virtualization
node.LoadDirectory();
if( this._showFiles == true )
node.LoadFiles();
}
}
public void Load( string directoryPath )
{
if( Directory.Exists( directoryPath ) == false )
throw new DirectoryNotFoundException( "Directory Not Found" );
_systemIcons.Clear();
_imageList.Images.Clear();
Nodes.Clear();
Icon folderIcon = new Icon( typeof( FileSystemTreeView ), "icons.folder.ico");
_imageList.Images.Add( folderIcon );
_systemIcons.Add( FileSystemTreeView.Folder, 0 );
DirectoryNode node = new DirectoryNode( this, new DirectoryInfo( directoryPath ) );
node.Expand();
}
public int GetIconImageIndex( string path )
{
string extension = Path.GetExtension( path );
if( _systemIcons.ContainsKey( extension ) == false )
{
Icon icon = ShellIcon.GetSmallIcon( path );
_imageList.Images.Add( icon );
_systemIcons.Add( extension, _imageList.Images.Count-1 );
}
return (int)_systemIcons[ Path.GetExtension( path )];
}
public bool ShowFiles
{
get{ return this._showFiles; }
set{ this._showFiles = value; }
}
}
public class DirectoryNode : TreeNode
{
private DirectoryInfo _directoryInfo;
public DirectoryNode( DirectoryNode parent, DirectoryInfo directoryInfo ) : base( directoryInfo.Name )
{
this._directoryInfo = directoryInfo;
this.ImageIndex = FileSystemTreeView.Folder;
this.SelectedImageIndex = this.ImageIndex;
parent.Nodes.Add( this );
Virtualize();
}
public DirectoryNode( FileSystemTreeView treeView, DirectoryInfo directoryInfo ) : base( directoryInfo.Name )
{
this._directoryInfo = directoryInfo;
this.ImageIndex = FileSystemTreeView.Folder;
this.SelectedImageIndex = this.ImageIndex;
treeView.Nodes.Add( this );
Virtualize();
}
void Virtualize()
{
int fileCount = 0;
try
{
if( this.TreeView.ShowFiles == true )
fileCount = this._directoryInfo.GetFiles().Length;
if( (fileCount + this._directoryInfo.GetDirectories().Length) > 0 )
new FakeChildNode( this );
}
catch
{
}
}
public void LoadDirectory()
{
foreach( DirectoryInfo directoryInfo in _directoryInfo.GetDirectories() )
{
new DirectoryNode( this, directoryInfo );
}
}
public void LoadFiles()
{
foreach( FileInfo file in _directoryInfo.GetFiles() )
{
new FileNode( this, file );
}
}
public bool Loaded
{
get
{
if( this.Nodes.Count != 0 )
{
if( this.Nodes[0] is FakeChildNode )
return false;
}
return true;
}
}
public new FileSystemTreeView TreeView
{
get{ return (FileSystemTreeView)base.TreeView; }
}
}
public class FileNode : TreeNode
{
private FileInfo _fileInfo;
private DirectoryNode _directoryNode;
public FileNode( DirectoryNode directoryNode, FileInfo fileInfo ) : base( fileInfo.Name )
{
this._directoryNode = directoryNode;
this._fileInfo = fileInfo;
this.ImageIndex = ((FileSystemTreeView)_directoryNode.TreeView).GetIconImageIndex( _fileInfo.FullName );
this.SelectedImageIndex = this.ImageIndex;
_directoryNode.Nodes.Add( this );
}
}
public class FakeChildNode : TreeNode
{
public FakeChildNode( TreeNode parent ) : base()
{
parent.Nodes.Add( this );
}
}
}
@@ -0,0 +1,124 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{83281176-6B39-4EB8-8CDC-82F018DEED68}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon>App.ico</ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>DirectoryTreeView</AssemblyName>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>WinExe</OutputType>
<RootNamespace>C2C.FileSystem</RootNamespace>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<StartupObject>
</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>true</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>
</NoWarn>
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>full</DebugType>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>false</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>
</NoWarn>
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="System">
<Name>System</Name>
</Reference>
<Reference Include="System.Data">
<Name>System.Data</Name>
</Reference>
<Reference Include="System.DirectoryServices">
<Name>System.DirectoryServices</Name>
</Reference>
<Reference Include="System.Drawing">
<Name>System.Drawing</Name>
</Reference>
<Reference Include="System.Windows.Forms">
<Name>System.Windows.Forms</Name>
</Reference>
<Reference Include="System.Xml">
<Name>System.XML</Name>
</Reference>
</ItemGroup>
<ItemGroup>
<Content Include="App.ico" />
<Compile Include="AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="FileSystemTreeView.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ShellIcon.cs">
<SubType>Code</SubType>
</Compile>
<EmbeddedResource Include="FileSystemTreeView.resx">
<DependentUpon>FileSystemTreeView.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="icons\folder.ico" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>
@@ -0,0 +1,58 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<LastOpenVersion>7.10.3077</LastOpenVersion>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ReferencePath>
</ReferencePath>
<CopyProjectDestinationFolder>
</CopyProjectDestinationFolder>
<CopyProjectUncPath>
</CopyProjectUncPath>
<CopyProjectOption>0</CopyProjectOption>
<ProjectView>ProjectFiles</ProjectView>
<ProjectTrust>0</ProjectTrust>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<EnableASPDebugging>false</EnableASPDebugging>
<EnableASPXDebugging>false</EnableASPXDebugging>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
<EnableSQLServerDebugging>false</EnableSQLServerDebugging>
<RemoteDebugEnabled>false</RemoteDebugEnabled>
<RemoteDebugMachine>
</RemoteDebugMachine>
<StartAction>Project</StartAction>
<StartArguments>
</StartArguments>
<StartPage>
</StartPage>
<StartProgram>
</StartProgram>
<StartURL>
</StartURL>
<StartWorkingDirectory>
</StartWorkingDirectory>
<StartWithIE>false</StartWithIE>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<EnableASPDebugging>false</EnableASPDebugging>
<EnableASPXDebugging>false</EnableASPXDebugging>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
<EnableSQLServerDebugging>false</EnableSQLServerDebugging>
<RemoteDebugEnabled>false</RemoteDebugEnabled>
<RemoteDebugMachine>
</RemoteDebugMachine>
<StartAction>Project</StartAction>
<StartArguments>
</StartArguments>
<StartPage>
</StartPage>
<StartProgram>
</StartProgram>
<StartURL>
</StartURL>
<StartWorkingDirectory>
</StartWorkingDirectory>
<StartWithIE>false</StartWithIE>
</PropertyGroup>
</Project>
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8" ?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<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" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</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>1.0.0.0</value>
</resheader>
<resheader name="Reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="Writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,178 @@
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using C2C.FileSystem;
namespace DirectoryTreeView
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.TextBox txtDirectory;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnDirectory;
private C2C.FileSystem.FileSystemTreeView tree;
private System.Windows.Forms.Panel treePanel;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (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.panel1 = new System.Windows.Forms.Panel();
this.btnDirectory = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.txtDirectory = new System.Windows.Forms.TextBox();
this.treePanel = new System.Windows.Forms.Panel();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.Controls.Add(this.btnDirectory);
this.panel1.Controls.Add(this.label1);
this.panel1.Controls.Add(this.txtDirectory);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(721, 57);
this.panel1.TabIndex = 0;
//
// btnDirectory
//
this.btnDirectory.Location = new System.Drawing.Point(615, 27);
this.btnDirectory.Name = "btnDirectory";
this.btnDirectory.Size = new System.Drawing.Size(30, 21);
this.btnDirectory.TabIndex = 2;
this.btnDirectory.Text = "...";
this.btnDirectory.Click += new System.EventHandler(this.btnDirectory_Click);
//
// label1
//
this.label1.Location = new System.Drawing.Point(9, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(102, 18);
this.label1.TabIndex = 1;
this.label1.Text = "Directory:";
//
// txtDirectory
//
this.txtDirectory.Location = new System.Drawing.Point(9, 27);
this.txtDirectory.Name = "txtDirectory";
this.txtDirectory.Size = new System.Drawing.Size(603, 20);
this.txtDirectory.TabIndex = 0;
this.txtDirectory.Text = "";
this.txtDirectory.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtDirectory_KeyDown);
this.txtDirectory.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtDirectory_KeyPress);
//
// treePanel
//
this.treePanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.treePanel.Location = new System.Drawing.Point(0, 57);
this.treePanel.Name = "treePanel";
this.treePanel.Size = new System.Drawing.Size(721, 530);
this.treePanel.TabIndex = 1;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(721, 587);
this.Controls.Add(this.treePanel);
this.Controls.Add(this.panel1);
this.Name = "Form1";
this.Text = "Demo Application";
this.Load += new System.EventHandler(this.Form1_Load);
this.panel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void Form1_Load(object sender, System.EventArgs e)
{
tree = new C2C.FileSystem.FileSystemTreeView();
treePanel.Controls.Add( tree );
tree.Dock = DockStyle.Fill;
//tree.ShowFiles = false;
}
private void btnDirectory_Click(object sender, System.EventArgs e)
{
FolderBrowserDialog dlg = new FolderBrowserDialog();
if( dlg.ShowDialog() == DialogResult.OK )
{
txtDirectory.Text = dlg.SelectedPath;
tree.Load( txtDirectory.Text );
}
}
private void txtDirectory_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
}
private void txtDirectory_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
if( e.KeyData == Keys.Enter )
{
if( System.IO.Directory.Exists( txtDirectory.Text ) == false )
{
MessageBox.Show( "Directory Does Not Exist", "Invalid Directory", MessageBoxButtons.OK, MessageBoxIcon.Information );
return;
}
tree.Load( txtDirectory.Text );
}
}
}
}
@@ -0,0 +1,193 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
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">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</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 forserialized 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.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:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<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" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</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>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="panel1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="panel1.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="panel1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="panel1.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>3, 3</value>
</data>
<data name="panel1.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="panel1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnDirectory.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="btnDirectory.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnDirectory.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="label1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="label1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="label1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="txtDirectory.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="txtDirectory.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="txtDirectory.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="treePanel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="treePanel.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="treePanel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="treePanel.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>3, 3</value>
</data>
<data name="treePanel.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="treePanel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>(Default)</value>
</data>
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>3, 3</value>
</data>
<data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>80</value>
</data>
<data name="$this.Name">
<value>Form1</value>
</data>
<data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
</root>
@@ -0,0 +1,79 @@
using System;
using System.Drawing;
using System.Runtime.InteropServices;
namespace C2C.FileSystem
{
/// <summary>
/// Summary description for ShellIcon.
/// </summary>
/// <summary>
/// Summary description for ShellIcon. Get a small or large Icon with an easy C# function call
/// that returns a 32x32 or 16x16 System.Drawing.Icon depending on which function you call
/// either GetSmallIcon(string fileName) or GetLargeIcon(string fileName)
/// </summary>
public class ShellIcon
{
[StructLayout(LayoutKind.Sequential)]
public struct SHFILEINFO
{
public IntPtr hIcon;
public IntPtr iIcon;
public uint dwAttributes;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
public string szDisplayName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)]
public string szTypeName;
};
class Win32
{
public const uint SHGFI_ICON = 0x100;
public const uint SHGFI_LARGEICON = 0x0; // 'Large icon
public const uint SHGFI_SMALLICON = 0x1; // 'Small icon
[DllImport("shell32.dll")]
public static extern IntPtr SHGetFileInfo(string pszPath, uint dwFileAttributes, ref SHFILEINFO psfi, uint cbSizeFileInfo, uint uFlags);
}
public ShellIcon()
{
//
// TODO: Add constructor logic here
//
}
public static Icon GetSmallIcon(string fileName)
{
IntPtr hImgSmall; //the handle to the system image list
SHFILEINFO shinfo = new SHFILEINFO();
//Use this to get the small Icon
hImgSmall = Win32.SHGetFileInfo(fileName, 0, ref shinfo,(uint)Marshal.SizeOf(shinfo),Win32.SHGFI_ICON | Win32.SHGFI_SMALLICON);
//The icon is returned in the hIcon member of the shinfo struct
return System.Drawing.Icon.FromHandle(shinfo.hIcon);
}
public static Icon GetLargeIcon(string fileName)
{
IntPtr hImgLarge; //the handle to the system image list
SHFILEINFO shinfo = new SHFILEINFO();
//Use this to get the large Icon
hImgLarge = Win32.SHGetFileInfo(fileName, 0, ref shinfo, (uint)Marshal.SizeOf(shinfo), Win32.SHGFI_ICON | Win32.SHGFI_LARGEICON);
//The icon is returned in the hIcon member of the shinfo struct
return System.Drawing.Icon.FromHandle(shinfo.hIcon);
}
}
}
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type='text/xsl' href='_UpgradeReport_Files/UpgradeReport.xslt'?><UpgradeLog>
<Properties><Property Name="Solution" Value="FileSystemTreeView">
</Property><Property Name="Solution File" Value="C:\SoftwarePorter\FileSystemTreeView\FileSystemTreeView.sln">
</Property><Property Name="Date" Value="Monday, August 06, 2007">
</Property><Property Name="Time" Value="0:41:57 AM">
</Property></Properties><Event ErrorLevel="0" Project="FileSystemTreeView" Source="FileSystemTreeView.csproj" Description="Project file successfully backed up as C:\SoftwarePorter\FileSystemTreeView\Backup\FileSystemTreeView.csproj">
</Event><Event ErrorLevel="0" Project="FileSystemTreeView" Source="FileSystemTreeView.csproj.user" Description="Project user file successfully backed up as C:\SoftwarePorter\FileSystemTreeView\Backup\FileSystemTreeView.csproj.user">
</Event><Event ErrorLevel="0" Project="FileSystemTreeView" Source="AssemblyInfo.cs" Description="File successfully backed up as C:\SoftwarePorter\FileSystemTreeView\Backup\AssemblyInfo.cs">
</Event><Event ErrorLevel="0" Project="FileSystemTreeView" Source="FileSystemTreeView.cs" Description="File successfully backed up as C:\SoftwarePorter\FileSystemTreeView\Backup\FileSystemTreeView.cs">
</Event><Event ErrorLevel="0" Project="FileSystemTreeView" Source="Form1.cs" Description="File successfully backed up as C:\SoftwarePorter\FileSystemTreeView\Backup\Form1.cs">
</Event><Event ErrorLevel="0" Project="FileSystemTreeView" Source="ShellIcon.cs" Description="File successfully backed up as C:\SoftwarePorter\FileSystemTreeView\Backup\ShellIcon.cs">
</Event><Event ErrorLevel="0" Project="FileSystemTreeView" Source="App.ico" Description="File successfully backed up as C:\SoftwarePorter\FileSystemTreeView\Backup\App.ico">
</Event><Event ErrorLevel="0" Project="FileSystemTreeView" Source="FileSystemTreeView.resx" Description="File successfully backed up as C:\SoftwarePorter\FileSystemTreeView\Backup\FileSystemTreeView.resx">
</Event><Event ErrorLevel="0" Project="FileSystemTreeView" Source="Form1.resx" Description="File successfully backed up as C:\SoftwarePorter\FileSystemTreeView\Backup\Form1.resx">
</Event><Event ErrorLevel="0" Project="FileSystemTreeView" Source="icons\folder.ico" Description="File successfully backed up as C:\SoftwarePorter\FileSystemTreeView\Backup\icons\folder.ico">
</Event><Event ErrorLevel="0" Project="FileSystemTreeView" Source="FileSystemTreeView.csproj" Description="Project converted successfully">
</Event><Event ErrorLevel="3" Project="FileSystemTreeView" Source="FileSystemTreeView.csproj" Description="Converted">
</Event><Event ErrorLevel="0" Project="FileSystemTreeView" Source="FileSystemTreeView.csproj" Description="Scan complete: Upgrade not required for project files.">
</Event></UpgradeLog>
@@ -0,0 +1,207 @@
BODY
{
BACKGROUND-COLOR: white;
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 100%;
MARGIN-LEFT: 0px;
MARGIN-TOP: 0px
}
P
{
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 70%;
LINE-HEIGHT: 12pt;
MARGIN-BOTTOM: 0px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 10px
}
.note
{
BACKGROUND-COLOR: #ffffff;
COLOR: #336699;
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 100%;
MARGIN-BOTTOM: 0px;
MARGIN-LEFT: 0px;
MARGIN-TOP: 0px;
PADDING-RIGHT: 10px
}
.infotable
{
BACKGROUND-COLOR: #f0f0e0;
BORDER-BOTTOM: #ffffff 0px solid;
BORDER-COLLAPSE: collapse;
BORDER-LEFT: #ffffff 0px solid;
BORDER-RIGHT: #ffffff 0px solid;
BORDER-TOP: #ffffff 0px solid;
FONT-SIZE: 70%;
MARGIN-LEFT: 10px
}
.issuetable
{
BACKGROUND-COLOR: #ffffe8;
BORDER-COLLAPSE: collapse;
COLOR: #000000;
FONT-SIZE: 100%;
MARGIN-BOTTOM: 10px;
MARGIN-LEFT: 13px;
MARGIN-TOP: 0px
}
.issuetitle
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px;
COLOR: #003366;
FONT-WEIGHT: normal
}
.header
{
BACKGROUND-COLOR: #cecf9c;
BORDER-BOTTOM: #ffffff 1px solid;
BORDER-LEFT: #ffffff 1px solid;
BORDER-RIGHT: #ffffff 1px solid;
BORDER-TOP: #ffffff 1px solid;
COLOR: #000000;
FONT-WEIGHT: bold
}
.issuehdr
{
BACKGROUND-COLOR: #E0EBF5;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px solid;
COLOR: #000000;
FONT-WEIGHT: normal
}
.issuenone
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: 0px;
BORDER-LEFT: 0px;
BORDER-RIGHT: 0px;
BORDER-TOP: 0px;
COLOR: #000000;
FONT-WEIGHT: normal
}
.content
{
BACKGROUND-COLOR: #e7e7ce;
BORDER-BOTTOM: #ffffff 1px solid;
BORDER-LEFT: #ffffff 1px solid;
BORDER-RIGHT: #ffffff 1px solid;
BORDER-TOP: #ffffff 1px solid;
PADDING-LEFT: 3px
}
.issuecontent
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px solid;
PADDING-LEFT: 3px
}
A:link
{
COLOR: #cc6633;
TEXT-DECORATION: underline
}
A:visited
{
COLOR: #cc6633;
}
A:active
{
COLOR: #cc6633;
}
A:hover
{
COLOR: #cc3300;
TEXT-DECORATION: underline
}
H1
{
BACKGROUND-COLOR: #003366;
BORDER-BOTTOM: #336699 6px solid;
COLOR: #ffffff;
FONT-SIZE: 130%;
FONT-WEIGHT: normal;
MARGIN: 0em 0em 0em -20px;
PADDING-BOTTOM: 8px;
PADDING-LEFT: 30px;
PADDING-TOP: 16px
}
H2
{
COLOR: #000000;
FONT-SIZE: 80%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: 3px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 20px;
PADDING-LEFT: 0px
}
H3
{
COLOR: #000000;
FONT-SIZE: 80%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: -5px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 20px
}
H4
{
COLOR: #000000;
FONT-SIZE: 70%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: 0px;
MARGIN-TOP: 15px;
PADDING-BOTTOM: 0px
}
UL
{
COLOR: #000000;
FONT-SIZE: 70%;
LIST-STYLE: square;
MARGIN-BOTTOM: 0pt;
MARGIN-TOP: 0pt
}
OL
{
COLOR: #000000;
FONT-SIZE: 70%;
LIST-STYLE: square;
MARGIN-BOTTOM: 0pt;
MARGIN-TOP: 0pt
}
LI
{
LIST-STYLE: square;
MARGIN-LEFT: 0px
}
.expandable
{
CURSOR: hand
}
.expanded
{
color: black
}
.collapsed
{
DISPLAY: none
}
.foot
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #cecf9c 1px solid;
BORDER-TOP: #cecf9c 2px solid
}
.settings
{
MARGIN-LEFT: 25PX;
}
.help
{
TEXT-ALIGN: right;
margin-right: 10px;
}
@@ -0,0 +1,232 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl='urn:schemas-microsoft-com:xslt'>
<xsl:key name="ProjectKey" match="Event" use="@Project" />
<xsl:template match="Events" mode="createProjects">
<projects>
<xsl:for-each select="Event">
<!--xsl:sort select="@Project" order="descending"/-->
<xsl:if test="(1=position()) or (preceding-sibling::*[1]/@Project != @Project)">
<xsl:variable name="ProjectName" select="@Project"/>
<project>
<xsl:attribute name="name">
<xsl:value-of select="@Project"/>
</xsl:attribute>
<xsl:if test="@Project=''">
<xsl:attribute name="solution">
<xsl:value-of select="@Solution"/>
</xsl:attribute>
</xsl:if>
<xsl:for-each select="key('ProjectKey', $ProjectName)">
<!--xsl:sort select="@Source" /-->
<xsl:if test="(1=position()) or (preceding-sibling::*[1]/@Source != @Source)">
<source>
<xsl:attribute name="name">
<xsl:value-of select="@Source"/>
</xsl:attribute>
<xsl:variable name="Source">
<xsl:value-of select="@Source"/>
</xsl:variable>
<xsl:for-each select="key('ProjectKey', $ProjectName)[ @Source = $Source ]">
<event>
<xsl:attribute name="error-level">
<xsl:value-of select="@ErrorLevel"/>
</xsl:attribute>
<xsl:attribute name="description">
<xsl:value-of select="@Description"/>
</xsl:attribute>
</event>
</xsl:for-each>
</source>
</xsl:if>
</xsl:for-each>
</project>
</xsl:if>
</xsl:for-each>
</projects>
</xsl:template>
<xsl:template match="projects">
<xsl:for-each select="project">
<xsl:sort select="@Name" order="ascending"/>
<h2>
<xsl:if test="@solution">Solution: <xsl:value-of select="@solution"/></xsl:if>
<xsl:if test="not(@solution)">Project: <xsl:value-of select="@name"/>
<xsl:for-each select="source">
<xsl:variable name="Hyperlink" select="@name"/>
<xsl:for-each select="event[@error-level='4']">
&#32;<A class="note"><xsl:attribute name="HREF"><xsl:value-of select="$Hyperlink"/></xsl:attribute><xsl:value-of select="@description"/></A>
</xsl:for-each>
</xsl:for-each>
</xsl:if>
</h2>
<table cellpadding="2" cellspacing="0" width="98%" border="1" bordercolor="white" class="infotable">
<tr>
<td nowrap="1" class="header" _locID="Filename">Filename</td>
<td nowrap="1" class="header" _locID="Status">Status</td>
<td nowrap="1" class="header" _locID="Errors">Errors</td>
<td nowrap="1" class="header" _locID="Warnings">Warnings</td>
</tr>
<xsl:for-each select="source">
<xsl:sort select="@name" order="ascending"/>
<xsl:variable name="source-id" select="generate-id(.)"/>
<xsl:if test="count(event)!=count(event[@error-level='4'])">
<tr class="row">
<td class="content">
<A HREF="javascript:"><xsl:attribute name="onClick">javascript:document.images['<xsl:value-of select="$source-id"/>'].click()</xsl:attribute><IMG border="0" alt="expand/collapse section" class="expandable" height="11" onclick="changepic()" src="_UpgradeReport_Files/UpgradeReport_Plus.gif" width="9" ><xsl:attribute name="name"><xsl:value-of select="$source-id"/></xsl:attribute><xsl:attribute name="child">src<xsl:value-of select="$source-id"/></xsl:attribute></IMG></A>&#32;<xsl:value-of select="@name"/>
</td>
<td class="content">
<xsl:if test="count(event[@error-level='3'])=1">
<xsl:for-each select="event[@error-level='3']">
<xsl:if test="@description='Converted'">Converted</xsl:if>
<xsl:if test="@description!='Converted'"><xsl:value-of select="@description"/></xsl:if>
</xsl:for-each>
</xsl:if>
<xsl:if test="count(event[@error-level='3'])!=1 and count(event[@error-level='3' and @description='Converted'])!=0">Converted
</xsl:if>
</td>
<td class="content"><xsl:value-of select="count(event[@error-level='2'])"/></td>
<td class="content"><xsl:value-of select="count(event[@error-level='1'])"/></td>
</tr>
<tr class="collapsed" bgcolor="#ffffff">
<xsl:attribute name="id">src<xsl:value-of select="$source-id"/></xsl:attribute>
<td colspan="7">
<table width="97%" border="1" bordercolor="#dcdcdc" rules="cols" class="issuetable">
<tr>
<td colspan="7" class="issuetitle" _locID="ConversionIssues">Conversion Issues - <xsl:value-of select="@name"/>:</td>
</tr>
<xsl:for-each select="event[@error-level!='3']">
<xsl:if test="@error-level!='4'">
<tr>
<td class="issuenone" style="border-bottom:solid 1 lightgray">
<xsl:value-of select="@description"/>
</td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
</td>
</tr>
</xsl:if>
</xsl:for-each>
<tr valign="top">
<td class="foot">
<xsl:if test="count(source)!=1">
<xsl:value-of select="count(source)"/> files
</xsl:if>
<xsl:if test="count(source)=1">
1 file
</xsl:if>
</td>
<td class="foot">
Converted: <xsl:value-of select="count(source/event[@error-level='3' and @description='Converted'])"/><BR />
Not converted <xsl:value-of select="count(source) - count(source/event[@error-level='3' and @description='Converted'])"/>
</td>
<td class="foot"><xsl:value-of select="count(source/event[@error-level='2'])"/></td>
<td class="foot"><xsl:value-of select="count(source/event[@error-level='1'])"/></td>
</tr>
</table>
</xsl:for-each>
</xsl:template>
<xsl:template match="Property">
<xsl:if test="@Name!='Date' and @Name!='Time' and @Name!='LogNumber' and @Name!='Solution'">
<tr><td nowrap="1"><b><xsl:value-of select="@Name"/>: </b><xsl:value-of select="@Value"/></td></tr>
</xsl:if>
</xsl:template>
<xsl:template match="UpgradeLog">
<html>
<head>
<META HTTP-EQUIV="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="_UpgradeReport_Files\UpgradeReport.css" />
<title>Conversion Report&#32;
<xsl:if test="Properties/Property[@Name='LogNumber']">
<xsl:value-of select="Properties/Property[@Name='LogNumber']/@Value"/>
</xsl:if>
</title>
<script language="javascript">
function outliner () {
oMe = window.event.srcElement
//get child element
var child = document.all[event.srcElement.getAttribute("child",false)];
//if child element exists, expand or collapse it.
if (null != child)
child.className = child.className == "collapsed" ? "expanded" : "collapsed";
}
function changepic() {
uMe = window.event.srcElement;
var check = uMe.src.toLowerCase();
if (check.lastIndexOf("upgradereport_plus.gif") != -1)
{
uMe.src = "_UpgradeReport_Files/UpgradeReport_Minus.gif"
}
else
{
uMe.src = "_UpgradeReport_Files/UpgradeReport_Plus.gif"
}
}
</script>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" onclick="outliner();">
<h1 _locID="ConversionReport">Conversion Report - <xsl:value-of select="Properties/Property[@Name='Solution']/@Value"/></h1>
<p><span class="note">
<b>Time of Conversion:</b>&#32;&#32;<xsl:value-of select="Properties/Property[@Name='Date']/@Value"/>&#32;&#32;<xsl:value-of select="Properties/Property[@Name='Time']/@Value"/><br/>
</span></p>
<xsl:variable name="SortedEvents">
<Events>
<xsl:for-each select="Event">
<xsl:sort select="@Project" order="ascending"/>
<xsl:sort select="@Source" order="ascending"/>
<xsl:sort select="@ErrorLevel" order="ascending"/>
<Event>
<xsl:attribute name="Project"><xsl:value-of select="@Project"/> </xsl:attribute>
<xsl:attribute name="Solution"><xsl:value-of select="/UpgradeLog/Properties/Property[@Name='Solution']/@Value"/> </xsl:attribute>
<xsl:attribute name="Source"><xsl:value-of select="@Source"/> </xsl:attribute>
<xsl:attribute name="ErrorLevel"><xsl:value-of select="@ErrorLevel"/> </xsl:attribute>
<xsl:attribute name="Description"><xsl:value-of select="@Description"/> </xsl:attribute>
</Event>
</xsl:for-each>
</Events>
</xsl:variable>
<xsl:variable name="Projects">
<xsl:apply-templates select="msxsl:node-set($SortedEvents)/*" mode="createProjects"/>
</xsl:variable>
<xsl:apply-templates select="msxsl:node-set($Projects)/*"/>
<p></p><p>
<table class="note">
<tr>
<td nowrap="1">
<b>Conversion Settings</b>
</td>
</tr>
<xsl:apply-templates select="Properties"/>
</table></p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Binary file not shown.

After

Width:  |  Height:  |  Size: 69 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -0,0 +1,220 @@
using System;
using System.Drawing;
using System.Text;
using System.Collections.Generic;
using System.IO;
using System.Windows.Forms;
using SIL.FieldWorks.Common.Controls;
using SysGen.RBuild.Framework;
using SysGen.BuildEngine;
using SysGen.BuildEngine.Tasks;
namespace TriStateTreeViewDemo
{
public class CatalogTriStateTreeView : TriStateTreeView
{
private ISysGenDesigner m_SysGenDesigner = null;
private TreeNode m_PlatformNode = null;
public CatalogTriStateTreeView()
{
}
private void CatalogTriStateTreeView_BeforeCheck(object sender, TreeViewCancelEventArgs e)
{
if (m_SysGenDesigner.SysGenEngine.Project != null)
{
if (e.Node is ModuleTreeNode)
{
//Get the underlying module
ModuleTreeNode moduleNode = e.Node as ModuleTreeNode;
if (GetChecked(e.Node) == CheckState.Unchecked)
{
//Add the selected node and dependencies
m_SysGenDesigner.PlatformController.Add(moduleNode.Module);
}
else
{
//Remove the module from our platform
m_SysGenDesigner.PlatformController.Remove(moduleNode.Module);
}
//Update current module status
UpdateCatalogTree();
}
else if (e.Node is FolderTreeNode)
{
if (m_AutoUpdatingParents == false)
{
//e.Cancel = (AddTreeNodeModules(e.Node) == false);
}
}
}
else
{
MessageBox.Show("Cannot modify a catalog tree without platform associated");
}
}
public void SetCatalog(ISysGenDesigner sysGenDesigner)
{
//Set the software catalog
m_SysGenDesigner = sysGenDesigner;
//Load the platform tree catalog
LoadCatalogTree();
UpdateCatalogTree();
NodeMouseClick += new TreeNodeMouseClickEventHandler(CatalogTriStateTreeView_NodeMouseClick);
}
void CatalogTriStateTreeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
ModuleTreeNode moduleNode = e.Node as ModuleTreeNode;
if (moduleNode != null)
m_SysGenDesigner.InspectedObject = moduleNode.Module;
}
private void LoadCatalogTree()
{
m_PlatformNode = new TreeNode();
LoadPlatformModules(m_PlatformNode, m_SysGenDesigner.SysGenEngine.ProjectTask);
Nodes.Clear();
Nodes.Add(m_PlatformNode);
m_PlatformNode.Text = RootNodeText;
m_PlatformNode.Expand();
}
private void UpdateCatalogTree()
{
BeginUpdate();
BeforeCheck -= new TreeViewCancelEventHandler(CatalogTriStateTreeView_BeforeCheck);
m_PlatformNode.Text = RootNodeText;
m_PlatformNode.Expand();
UpdatePlatformModules(m_PlatformNode);
EndUpdate();
BeforeCheck += new TreeViewCancelEventHandler(CatalogTriStateTreeView_BeforeCheck);
}
private string RootNodeText
{
get
{
return string.Format("Catalog ({0} Modules-{1} Available)",
m_SysGenDesigner.PlatformController.Project.Platform.Modules.Count,
m_SysGenDesigner.PlatformController.Project.Modules.Count);
}
}
private void UpdatePlatformModules(TreeNode node)
{
if (node is ModuleTreeNode)
{
//Get the underlying module
ModuleTreeNode moduleNode = node as ModuleTreeNode;
if (moduleNode != null)
{
if (m_SysGenDesigner.PlatformController.Project.Platform.Modules.Contains(moduleNode.Module))
{
SetChecked(moduleNode, CheckState.Checked);
}
else
{
SetChecked(moduleNode, CheckState.Unchecked);
}
}
}
else
{
foreach (TreeNode subNode in node.Nodes)
{
UpdatePlatformModules(subNode);
}
}
}
private void LoadPlatformModules(TreeNode node, Task task)
{
if (task is ModuleTask)
{
RBuildModule module = ((ModuleTask)task).Module;
node.Nodes.Add(new ModuleTreeNode(module));
}
else if (task is ITaskContainer)
{
if (task is DirectoryTask)
{
FolderTreeNode taskNode = new FolderTreeNode(((DirectoryTask)task).Name);
node.Nodes.Add(taskNode);
foreach (Task innerTask in ((ITaskContainer)task).ChildTasks)
{
LoadPlatformModules(taskNode, innerTask);
}
}
else
{
foreach (Task innerTask in ((ITaskContainer)task).ChildTasks)
{
LoadPlatformModules(node, innerTask);
}
}
}
}
public abstract class CatalogTreeNode : TreeNode
{
public abstract string NodeName { get; }
}
public class ModuleTreeNode : CatalogTreeNode
{
RBuildModule m_Module = null;
public ModuleTreeNode(RBuildModule module)
{
m_Module = module;
Text = module.Name;
}
public RBuildModule Module
{
get { return m_Module; }
}
public override string NodeName
{
get { return Module.Name; }
}
}
public class FolderTreeNode : CatalogTreeNode
{
private string m_FolderName = null;
public FolderTreeNode(string name)
{
m_FolderName = name;
Text = name;
}
public override string NodeName
{
get { return m_FolderName; }
}
}
}
}
@@ -0,0 +1,91 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using SysGen.RBuild.Framework;
using SysGen.BuildEngine;
using SysGen.BuildEngine.Tasks;
namespace TriStateTreeViewDemo
{
public class ModuleFiltersListViewItem : ListViewItem
{
private ModuleFilter m_ModuleFilter = null;
public ModuleFiltersListViewItem(ModuleFilter filter)
{
m_ModuleFilter = filter;
Text = filter.Name;
SubItems.Add(filter.Modules.Count.ToString());
}
public ModuleFilter Filter
{
get { return m_ModuleFilter; }
}
}
public class ModuleFiltersListView : ListView
{
private ISysGenDesigner m_SysGenDesigner = null;
public ModuleFiltersListView()
{
View = View.Details;
FullRowSelect = true;
CheckBoxes = true;
Columns.Add("Name", 200);
Columns.Add("Modules", 100);
}
public void SetCatalog(ISysGenDesigner sysGenDesigner)
{
//Set the software catalog
m_SysGenDesigner = sysGenDesigner;
//m_SysGenDesigner.PlatformController.PlatformModulesUpdated += new EventHandler(PlatformController_PlatformModulesUpdated);
foreach (ModuleFilter filter in sysGenDesigner.ModuleFilterController.ModuleFilters)
{
Items.Add(new ModuleFiltersListViewItem(filter));
}
}
//protected override void OnItemCheck(ItemCheckEventArgs ice)
//{
// base.OnItemCheck(ice);
//}
//protected override void OnItemChecked(ItemCheckedEventArgs e)
//{
// base.OnItemChecked(e);
//}
private void PlatformController_PlatformModulesUpdated(object sender, EventArgs e)
{
BeginUpdate();
foreach (ModuleFiltersListViewItem filterItem in Items)
{
foreach (RBuildModule module in m_SysGenDesigner.ProjectController.Project.Platform.Modules)
{
if (!filterItem.Filter.Modules.Contains(module))
{
filterItem.Checked = false;
break;
}
}
filterItem.Checked = true;
}
EndUpdate();
}
}
}
@@ -0,0 +1,114 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using SysGen.RBuild.Framework;
using SysGen.BuildEngine;
using SysGen.BuildEngine.Tasks;
namespace TriStateTreeViewDemo
{
public abstract class NewItemListViewItem : ListViewItem
{
protected ISysGenDesigner m_SysGenDesigner = null;
public NewItemListViewItem(ISysGenDesigner designer)
{
m_SysGenDesigner = designer;
}
public abstract string Description { get; }
public abstract string DefaultFileName { get; }
public virtual void Apply()
{
}
}
public class ModuleFiltersNewItemListViewItem : NewItemListViewItem
{
private ModuleFilter m_ModuleFilter = null;
public ModuleFiltersNewItemListViewItem(ISysGenDesigner designer ,ModuleFilter filter): base(designer)
{
m_ModuleFilter = filter;
Text = filter.Name;
}
public override string Description
{
get { return m_ModuleFilter.Name; }
}
public override string DefaultFileName
{
get { return null; }
}
public override void Apply()
{
m_SysGenDesigner.ModuleFilterController.Apply(m_ModuleFilter);
}
}
public class LanguageNewItemListViewItem : NewItemListViewItem
{
private RBuildLanguage m_Language = null;
public LanguageNewItemListViewItem(ISysGenDesigner designer, RBuildLanguage language)
: base(designer)
{
m_Language = language;
Text = language.Name;
}
public override string Description
{
get { return m_Language.Name; }
}
public override string DefaultFileName
{
get { return null; }
}
public override void Apply()
{
m_SysGenDesigner.ProjectController.AddLanguage(m_Language);
}
}
public class DebugChannelNewItemListViewItem : NewItemListViewItem
{
private RBuildDebugChannel m_DebugChannel = null;
public DebugChannelNewItemListViewItem(ISysGenDesigner designer, RBuildDebugChannel channel)
: base(designer)
{
m_DebugChannel = channel;
Text = channel.Name;
}
public override string Description
{
get { return m_DebugChannel.Name; }
}
public override string DefaultFileName
{
get { return null; }
}
public override void Apply()
{
m_SysGenDesigner.ProjectController.AddDebugChannel(m_DebugChannel);
}
}
}
@@ -0,0 +1,306 @@
using System;
using System.Drawing;
using System.Text;
using System.Collections.Generic;
using System.IO;
using System.Windows.Forms;
using SIL.FieldWorks.Common.Controls;
using SysGen.RBuild.Framework;
using SysGen.BuildEngine;
using SysGen.BuildEngine.Tasks;
namespace TriStateTreeViewDemo
{
public class PlatformTreeView : TriStateTreeView
{
private ISysGenDesigner m_SysGenDesigner = null;
private PlatformTreeNode m_PlatformNode = null;
public PlatformTreeView()
{
}
private void CatalogTriStateTreeView_BeforeCheck(object sender, TreeViewCancelEventArgs e)
{
if (m_SysGenDesigner.ProjectController.Project != null)
{
if (e.Node is ModuleTreeNode)
{
//Get the underlying module
ModuleTreeNode moduleNode = e.Node as ModuleTreeNode;
if (GetChecked(e.Node) == CheckState.Unchecked)
{
//Add the selected node and dependencies
m_SysGenDesigner.ProjectController.Add(moduleNode.Module);
}
else
{
//Remove the module from our platform
m_SysGenDesigner.ProjectController.Remove(moduleNode.Module);
}
}
else if (e.Node is FolderTreeNode)
{
}
}
else
{
MessageBox.Show("Cannot modify a catalog tree without platform associated");
}
/* cancel the paint event*/
e.Cancel = true;
}
public void SetCatalog(ISysGenDesigner sysGenDesigner)
{
//Set the software catalog
m_SysGenDesigner = sysGenDesigner;
m_SysGenDesigner.ProjectController.PlatformModulesUpdated += new EventHandler(PlatformController_PlatformModulesUpdated);
//Load the platform tree catalog
LoadCatalogTree();
UpdateCatalogTree();
NodeMouseClick += new TreeNodeMouseClickEventHandler(CatalogTriStateTreeView_NodeMouseClick);
}
void PlatformController_PlatformModulesUpdated(object sender, EventArgs e)
{
//Update current module status
UpdateCatalogTree();
}
void CatalogTriStateTreeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
CatalogTreeNode catalogNode = e.Node as CatalogTreeNode;
if (catalogNode != null)
m_SysGenDesigner.InspectedObject = catalogNode.NodeObject;
}
private void LoadCatalogTree()
{
m_PlatformNode = new PlatformTreeNode(m_SysGenDesigner.ProjectController.Project.Platform);
LoadPlatformModules(m_PlatformNode);
//LoadPlatformModules(m_PlatformNode, m_SysGenDesigner.SysGenEngine.ProjectTask);
Nodes.Clear();
Nodes.Add(m_PlatformNode);
m_PlatformNode.Text = RootNodeText;
m_PlatformNode.Expand();
}
private void UpdateCatalogTree()
{
BeginUpdate();
BeforeCheck -= new TreeViewCancelEventHandler(CatalogTriStateTreeView_BeforeCheck);
m_PlatformNode.Text = RootNodeText;
m_PlatformNode.Expand();
UpdatePlatformModules(m_PlatformNode);
EndUpdate();
BeforeCheck += new TreeViewCancelEventHandler(CatalogTriStateTreeView_BeforeCheck);
}
private string RootNodeText
{
get
{
return string.Format("Catalog ({0} Modules-{1} Available)",
m_SysGenDesigner.ProjectController.Project.Platform.Modules.Count,
m_SysGenDesigner.ProjectController.Project.Modules.Count);
}
}
private void UpdatePlatformModules(TreeNode node)
{
if (node is ModuleTreeNode)
{
//Get the underlying module
ModuleTreeNode moduleNode = node as ModuleTreeNode;
if (moduleNode != null)
{
if (m_SysGenDesigner.ProjectController.Project.Platform.Modules.Contains(moduleNode.Module))
{
SetChecked(moduleNode, CheckState.Checked);
}
else
{
SetChecked(moduleNode, CheckState.Unchecked);
}
}
}
else
{
foreach (TreeNode subNode in node.Nodes)
{
UpdatePlatformModules(subNode);
}
}
}
private void LoadPlatformModules(TreeNode node)
{
foreach (RBuildModule module in m_SysGenDesigner.ProjectController.AvailableModules)
{
TreeNode parent = node;
foreach (string part in module.CatalogPath.Split(new char[] { '\\' }))
{
if (part.Length > 0)
{
parent = GetFolderNode(parent, part);
}
}
parent.Nodes.Add(new ModuleTreeNode(module));
}
}
private TreeNode GetFolderNode(TreeNode parent, string name)
{
foreach (TreeNode node in parent.Nodes)
{
CatalogTreeNode folderNode = node as CatalogTreeNode;
if (folderNode != null)
{
if (folderNode.NodeName == name)
{
return folderNode;
}
}
}
FolderTreeNode newNode = new FolderTreeNode(name);
parent.Nodes.Add(newNode);
return newNode;
}
//private void LoadPlatformModules(TreeNode node, Task task)
//{
// foreach (string path in
// /*
// if (task is ModuleTask)
// {
// RBuildModule module = ((ModuleTask)task).Module;
// node.Nodes.Add(new ModuleTreeNode(module));
// }
// else if (task is ITaskContainer)
// {
// if (task is DirectoryTask)
// {
// FolderTreeNode taskNode = new FolderTreeNode(((DirectoryTask)task).Name);
// node.Nodes.Add(taskNode);
// foreach (Task innerTask in ((ITaskContainer)task).ChildTasks)
// {
// LoadPlatformModules(taskNode, innerTask);
// }
// }
// else
// {
// foreach (Task innerTask in ((ITaskContainer)task).ChildTasks)
// {
// LoadPlatformModules(node, innerTask);
// }
// }
// }
// */
//}
public abstract class CatalogTreeNode : TreeNode
{
public abstract string NodeName { get; }
public abstract object NodeObject { get;}
}
public class PlatformTreeNode : CatalogTreeNode
{
RBuildPlatform m_Platform = null;
public PlatformTreeNode(RBuildPlatform platform)
{
m_Platform = platform;
Text = platform.Name;
}
public RBuildPlatform Platform
{
get { return m_Platform; }
}
public override string NodeName
{
get { return m_Platform.Name; }
}
public override object NodeObject
{
get { return Platform; }
}
}
public class ModuleTreeNode : CatalogTreeNode
{
RBuildModule m_Module = null;
public ModuleTreeNode(RBuildModule module)
{
m_Module = module;
Text = module.Name;
}
public RBuildModule Module
{
get { return m_Module; }
}
public override string NodeName
{
get { return Module.Name; }
}
public override object NodeObject
{
get { return Module; }
}
}
public class FolderTreeNode : CatalogTreeNode
{
private string m_FolderName = null;
public FolderTreeNode(string name)
{
m_FolderName = name;
Text = name;
}
public override string NodeName
{
get { return m_FolderName; }
}
public override object NodeObject
{
get { return NodeName; }
}
}
}
}
@@ -0,0 +1,161 @@
using System;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Text;
using SysGen.RBuild.Framework;
using SysGen.BuildEngine;
using SysGen.BuildEngine.Tasks;
namespace TriStateTreeViewDemo
{
public class ProjectTreeView : TreeView
{
private ISysGenDesigner m_SysGenDesigner = null;
private TreeNode m_Project = new TreeNode("Project");
private TreeNode m_Platforms = new TreeNode("Platform");
private TreeNode m_Languages = new TreeNode("Languages");
private TreeNode m_DebugChannels = new TreeNode("Debug Channels");
//private TreeNode m_Filters = new TreeNode("Filters");
private TreeNode m_Files = new TreeNode("Files");
private TreeNode m_Registry = new TreeNode("Registry");
//private TreeNode m_Filters = new TreeNode("Filters");
public ProjectTreeView()
{
}
public void SetCatalog(ISysGenDesigner sysGenDesigner)
{
//Set the software catalog
m_SysGenDesigner = sysGenDesigner;
m_SysGenDesigner.ProjectController.ProjectLoaded += new EventHandler(PlatformController_ProjectLoaded);
m_SysGenDesigner.ProjectController.ProjectUpdated += new EventHandler(PlatformController_ProjectUpdated);
LoadProject();
}
void PlatformController_ProjectLoaded(object sender, EventArgs e)
{
LoadProject();
UpdateProject();
}
void PlatformController_ProjectUpdated(object sender, EventArgs e)
{
UpdateProject();
}
private void LoadProject()
{
Nodes.Clear();
m_Project = new ProjectTreeNode(m_SysGenDesigner.ProjectController.SysGenProject);
m_Project.Nodes.Add(m_Platforms);
m_Project.Nodes.Add(m_Languages);
m_Project.Nodes.Add(m_DebugChannels);
// m_Project.Nodes.Add(m_Filters);
m_Project.Nodes.Add(m_Files);
m_Project.Nodes.Add(m_Registry);
m_Project.Expand();
Nodes.Add(m_Project);
}
private void UpdateProject()
{
m_Languages.Nodes.Clear();
m_DebugChannels.Nodes.Clear();
foreach (RBuildLanguage language in m_SysGenDesigner.ProjectController.Project.Platform.Languages)
{
m_Languages.Nodes.Add(language.Name);
}
foreach (RBuildDebugChannel channel in m_SysGenDesigner.ProjectController.Project.Platform.DebugChannels)
{
m_DebugChannels.Nodes.Add(channel.Name);
}
}
public abstract class CatalogTreeNode : TreeNode
{
public abstract string NodeName { get; }
public abstract object NodeObject { get;}
}
public class ProjectTreeNode : CatalogTreeNode
{
Project m_Platform = null;
public ProjectTreeNode(Project platform)
{
m_Platform = platform;
Text = platform.FileName;
}
public Project Platform
{
get { return m_Platform; }
}
public override string NodeName
{
get { return m_Platform.Name; }
}
public override object NodeObject
{
get { return Platform; }
}
}
public class ModuleTreeNode : CatalogTreeNode
{
RBuildModule m_Module = null;
public ModuleTreeNode(RBuildModule module)
{
m_Module = module;
Text = module.Name;
}
public RBuildModule Module
{
get { return m_Module; }
}
public override string NodeName
{
get { return Module.Name; }
}
public override object NodeObject
{
get { return Module; }
}
}
public class FolderTreeNode : CatalogTreeNode
{
private string m_FolderName = null;
public FolderTreeNode(string name)
{
m_FolderName = name;
Text = name;
}
public override string NodeName
{
get { return m_FolderName; }
}
public override object NodeObject
{
get { return NodeName; }
}
}
}
}
@@ -0,0 +1,118 @@
namespace RosBuilder.Controls
{
partial class RegistryEditor
{
/// <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 Component 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.listView1 = new System.Windows.Forms.ListView();
this.treeView1 = new System.Windows.Forms.TreeView();
this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
this.columnHeader3 = new System.Windows.Forms.ColumnHeader();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.SuspendLayout();
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.treeView1);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.listView1);
this.splitContainer1.Size = new System.Drawing.Size(623, 542);
this.splitContainer1.SplitterDistance = 207;
this.splitContainer1.TabIndex = 0;
//
// listView1
//
this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1,
this.columnHeader2,
this.columnHeader3});
this.listView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.listView1.Location = new System.Drawing.Point(0, 0);
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(412, 542);
this.listView1.TabIndex = 0;
this.listView1.UseCompatibleStateImageBehavior = false;
this.listView1.View = System.Windows.Forms.View.Details;
//
// treeView1
//
this.treeView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.treeView1.Location = new System.Drawing.Point(0, 0);
this.treeView1.Name = "treeView1";
this.treeView1.Size = new System.Drawing.Size(207, 542);
this.treeView1.TabIndex = 0;
//
// columnHeader1
//
this.columnHeader1.Text = "Name";
this.columnHeader1.Width = 159;
//
// columnHeader2
//
this.columnHeader2.Text = "Type";
this.columnHeader2.Width = 130;
//
// columnHeader3
//
this.columnHeader3.Text = "Data";
//
// RegistryEditor
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.splitContainer1);
this.Name = "RegistryEditor";
this.Size = new System.Drawing.Size(623, 542);
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 treeView1;
private System.Windows.Forms.ListView listView1;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.ColumnHeader columnHeader2;
private System.Windows.Forms.ColumnHeader columnHeader3;
}
}
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
namespace RosBuilder.Controls
{
public partial class RegistryEditor : UserControl
{
public RegistryEditor()
{
InitializeComponent();
}
}
}
@@ -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>
+38
View File
@@ -0,0 +1,38 @@
namespace RosBuilder
{
partial class Form1
{
/// <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.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Text = "Form1";
}
#endregion
}
}
+18
View File
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace RosBuilder
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
}
+120
View 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>
@@ -0,0 +1,155 @@
using System;
using System.Windows.Forms;
using System.ComponentModel;
using System.Collections.Generic;
using System.Text;
using SysGen.RBuild.Framework;
namespace TriStateTreeViewDemo
{
public class PlatformInspector
{
private RBuildPlatform m_Platform = null;
public PlatformInspector(RBuildPlatform platform)
{
m_Platform = platform;
}
[Category("Info")]
public string Name
{
get { return m_Platform.Name; }
set { m_Platform.Name = value; }
}
[Category("Info")]
public string Description
{
get { return m_Platform.Description; }
set { m_Platform.Description = value; }
}
[Category("Applications")]
[Description("The module to be used as a shell for the platform")]
public string Shell
{
set
{
if (value != string.Empty)
{
try
{
RBuildModule module = m_Platform.Modules.GetByName(value);
if (module == null)
throw new ArgumentException("Unknown '" + value + "' shell module");
if (module.Type != ModuleType.Win32CUI &&
module.Type != ModuleType.Win32GUI)
throw new ArgumentException("Only Win32 GUI and CUI applications can be set as shell");
/* set the shell to use */
m_Platform.Shell = module;
}
catch (ArgumentException e)
{
MessageBox.Show(e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
get
{
if (m_Platform.Shell != null)
return m_Platform.Shell.Name;
return string.Empty;
}
}
[Category("Applications")]
[Description("The module to be used as a screensaver for the platform")]
public string Screensaver
{
set
{
if (value != string.Empty)
{
try
{
RBuildModule module = m_Platform.Modules.GetByName(value);
if (module == null)
throw new ArgumentException("Unknown '" + value + "' screen saver module");
if (module.Type != ModuleType.Win32SCR)
throw new ArgumentException("Only Win32 SCR applications can be set as shell");
/* set the shell to use */
m_Platform.Screensaver = module;
}
catch (ArgumentException e)
{
MessageBox.Show(e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
get
{
if (m_Platform.Screensaver != null)
return m_Platform.Screensaver.Name;
return string.Empty;
}
}
//public IList<RBuildDebugChannel> DebugChannels
//{
// get { return m_Platform.DebugChannels; }
//}
[Category("Appareance")]
[Description("The module to be used as a screensaver for the platform")]
public string Wallpaper
{
set
{
if (value != string.Empty)
{
RBuildWallpaperFile iW = new RBuildWallpaperFile();
iW.Name = value;
m_Platform.Wallpaper = iW;
//foreach (RBuildModule module in m_Platform.Modules)
//{
// foreach (RBuildFile file in module.Files)
// {
// RBuildInstallWallpaperFile wallpaper = file as RBuildInstallWallpaperFile;
// if (wallpaper != null)
// {
// if (wallpaper.ID.ToLower() == value.ToLower())
// {
// m_Platform.Wallpaper = wallpaper;
// }
// }
// }
//}
// specified wallpaper not found
//throw new ArgumentException();
}
}
get
{
if (m_Platform.Wallpaper != null)
return m_Platform.Wallpaper.ID;
return string.Empty;
}
}
}
}
+654
View File
@@ -0,0 +1,654 @@
namespace TriStateTreeViewDemo
{
partial class MainForm
{
/// <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.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.newToolStripButton = new System.Windows.Forms.ToolStripButton();
this.openToolStripButton = new System.Windows.Forms.ToolStripButton();
this.saveToolStripButton = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator = new System.Windows.Forms.ToolStripSeparator();
this.cutToolStripButton = new System.Windows.Forms.ToolStripButton();
this.copyToolStripButton = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
this.saveConfigToolStripButton = new System.Windows.Forms.ToolStripButton();
this.cmbArchitecture = new System.Windows.Forms.ToolStripComboBox();
this.cmbDebug = new System.Windows.Forms.ToolStripComboBox();
this.cmbOptimization = new System.Windows.Forms.ToolStripComboBox();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.helpToolStripButton = new System.Windows.Forms.ToolStripButton();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.printToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.printPreviewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.platformToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.addFiltersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.addLanguagesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.addDebToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.redoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
this.cutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
this.selectAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.customizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.contentsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.indexToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.searchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.pgProperties = new System.Windows.Forms.PropertyGrid();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.tvPlatform = new TriStateTreeViewDemo.PlatformTreeView();
this.tvProject = new TriStateTreeViewDemo.ProjectTreeView();
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
this.statusStrip1.SuspendLayout();
this.toolStrip1.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.splitContainer2.Panel1.SuspendLayout();
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
this.SuspendLayout();
//
// statusStrip1
//
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripStatusLabel1});
this.statusStrip1.Location = new System.Drawing.Point(0, 601);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(820, 22);
this.statusStrip1.TabIndex = 5;
this.statusStrip1.Text = "statusStrip1";
//
// toolStrip1
//
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.newToolStripButton,
this.openToolStripButton,
this.saveToolStripButton,
this.toolStripSeparator,
this.cutToolStripButton,
this.copyToolStripButton,
this.toolStripSeparator8,
this.saveConfigToolStripButton,
this.cmbArchitecture,
this.cmbDebug,
this.cmbOptimization,
this.toolStripSeparator1,
this.helpToolStripButton});
this.toolStrip1.Location = new System.Drawing.Point(0, 24);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(820, 25);
this.toolStrip1.TabIndex = 6;
this.toolStrip1.Text = "toolStrip1";
//
// newToolStripButton
//
this.newToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.newToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("newToolStripButton.Image")));
this.newToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.newToolStripButton.Name = "newToolStripButton";
this.newToolStripButton.Size = new System.Drawing.Size(23, 22);
this.newToolStripButton.Text = "&New";
this.newToolStripButton.Click += new System.EventHandler(this.newToolStripButton_Click);
//
// openToolStripButton
//
this.openToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.openToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("openToolStripButton.Image")));
this.openToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.openToolStripButton.Name = "openToolStripButton";
this.openToolStripButton.Size = new System.Drawing.Size(23, 22);
this.openToolStripButton.Text = "&Open";
this.openToolStripButton.Click += new System.EventHandler(this.openToolStripButton_Click);
//
// saveToolStripButton
//
this.saveToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.saveToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripButton.Image")));
this.saveToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.saveToolStripButton.Name = "saveToolStripButton";
this.saveToolStripButton.Size = new System.Drawing.Size(23, 22);
this.saveToolStripButton.Text = "&Save";
this.saveToolStripButton.Click += new System.EventHandler(this.saveToolStripButton_Click);
//
// toolStripSeparator
//
this.toolStripSeparator.Name = "toolStripSeparator";
this.toolStripSeparator.Size = new System.Drawing.Size(6, 25);
//
// cutToolStripButton
//
this.cutToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.cutToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("cutToolStripButton.Image")));
this.cutToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.cutToolStripButton.Name = "cutToolStripButton";
this.cutToolStripButton.Size = new System.Drawing.Size(23, 22);
this.cutToolStripButton.Text = "C&ut";
//
// copyToolStripButton
//
this.copyToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.copyToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("copyToolStripButton.Image")));
this.copyToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.copyToolStripButton.Name = "copyToolStripButton";
this.copyToolStripButton.Size = new System.Drawing.Size(23, 22);
this.copyToolStripButton.Text = "&Copy";
//
// toolStripSeparator8
//
this.toolStripSeparator8.Name = "toolStripSeparator8";
this.toolStripSeparator8.Size = new System.Drawing.Size(6, 25);
//
// saveConfigToolStripButton
//
this.saveConfigToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.saveConfigToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("saveConfigToolStripButton.Image")));
this.saveConfigToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.saveConfigToolStripButton.Name = "saveConfigToolStripButton";
this.saveConfigToolStripButton.Size = new System.Drawing.Size(69, 22);
this.saveConfigToolStripButton.Text = "&Save Config";
this.saveConfigToolStripButton.Click += new System.EventHandler(this.saveConfigToolStripButton_Click);
//
// cmbArchitecture
//
this.cmbArchitecture.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbArchitecture.Name = "cmbArchitecture";
this.cmbArchitecture.Size = new System.Drawing.Size(150, 25);
//
// cmbDebug
//
this.cmbDebug.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbDebug.Name = "cmbDebug";
this.cmbDebug.Size = new System.Drawing.Size(75, 25);
//
// cmbOptimization
//
this.cmbOptimization.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbOptimization.Name = "cmbOptimization";
this.cmbOptimization.Size = new System.Drawing.Size(75, 25);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
//
// helpToolStripButton
//
this.helpToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.helpToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("helpToolStripButton.Image")));
this.helpToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.helpToolStripButton.Name = "helpToolStripButton";
this.helpToolStripButton.Size = new System.Drawing.Size(23, 22);
this.helpToolStripButton.Text = "He&lp";
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileToolStripMenuItem,
this.platformToolStripMenuItem,
this.editToolStripMenuItem,
this.toolsToolStripMenuItem,
this.helpToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(820, 24);
this.menuStrip1.TabIndex = 7;
this.menuStrip1.Text = "menuStrip1";
//
// fileToolStripMenuItem
//
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.newToolStripMenuItem,
this.openToolStripMenuItem,
this.toolStripSeparator2,
this.saveToolStripMenuItem,
this.saveAsToolStripMenuItem,
this.toolStripSeparator3,
this.printToolStripMenuItem,
this.printPreviewToolStripMenuItem,
this.toolStripSeparator4,
this.exitToolStripMenuItem});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(35, 20);
this.fileToolStripMenuItem.Text = "&File";
//
// newToolStripMenuItem
//
this.newToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("newToolStripMenuItem.Image")));
this.newToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
this.newToolStripMenuItem.Name = "newToolStripMenuItem";
this.newToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));
this.newToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
this.newToolStripMenuItem.Text = "&New";
//
// openToolStripMenuItem
//
this.openToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("openToolStripMenuItem.Image")));
this.openToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
this.openToolStripMenuItem.Name = "openToolStripMenuItem";
this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
this.openToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
this.openToolStripMenuItem.Text = "&Open";
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(148, 6);
//
// saveToolStripMenuItem
//
this.saveToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripMenuItem.Image")));
this.saveToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
this.saveToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
this.saveToolStripMenuItem.Text = "&Save";
//
// saveAsToolStripMenuItem
//
this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem";
this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
this.saveAsToolStripMenuItem.Text = "Save &As";
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(148, 6);
//
// printToolStripMenuItem
//
this.printToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("printToolStripMenuItem.Image")));
this.printToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
this.printToolStripMenuItem.Name = "printToolStripMenuItem";
this.printToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P)));
this.printToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
this.printToolStripMenuItem.Text = "&Print";
//
// printPreviewToolStripMenuItem
//
this.printPreviewToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("printPreviewToolStripMenuItem.Image")));
this.printPreviewToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
this.printPreviewToolStripMenuItem.Name = "printPreviewToolStripMenuItem";
this.printPreviewToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
this.printPreviewToolStripMenuItem.Text = "Print Pre&view";
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(148, 6);
//
// exitToolStripMenuItem
//
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
this.exitToolStripMenuItem.Text = "E&xit";
//
// platformToolStripMenuItem
//
this.platformToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.addFiltersToolStripMenuItem,
this.addLanguagesToolStripMenuItem,
this.addDebToolStripMenuItem});
this.platformToolStripMenuItem.Name = "platformToolStripMenuItem";
this.platformToolStripMenuItem.Size = new System.Drawing.Size(59, 20);
this.platformToolStripMenuItem.Text = "&Platform";
//
// addFiltersToolStripMenuItem
//
this.addFiltersToolStripMenuItem.Name = "addFiltersToolStripMenuItem";
this.addFiltersToolStripMenuItem.Size = new System.Drawing.Size(185, 22);
this.addFiltersToolStripMenuItem.Text = "&Add Filters";
this.addFiltersToolStripMenuItem.Click += new System.EventHandler(this.addFiltersToolStripMenuItem_Click);
//
// addLanguagesToolStripMenuItem
//
this.addLanguagesToolStripMenuItem.Name = "addLanguagesToolStripMenuItem";
this.addLanguagesToolStripMenuItem.Size = new System.Drawing.Size(185, 22);
this.addLanguagesToolStripMenuItem.Text = "&Add Languages";
this.addLanguagesToolStripMenuItem.Click += new System.EventHandler(this.addLanguagesToolStripMenuItem_Click);
//
// addDebToolStripMenuItem
//
this.addDebToolStripMenuItem.Name = "addDebToolStripMenuItem";
this.addDebToolStripMenuItem.Size = new System.Drawing.Size(185, 22);
this.addDebToolStripMenuItem.Text = "&Add Debug Channels";
this.addDebToolStripMenuItem.Click += new System.EventHandler(this.addDebToolStripMenuItem_Click);
//
// editToolStripMenuItem
//
this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.undoToolStripMenuItem,
this.redoToolStripMenuItem,
this.toolStripSeparator5,
this.cutToolStripMenuItem,
this.copyToolStripMenuItem,
this.pasteToolStripMenuItem,
this.toolStripSeparator6,
this.selectAllToolStripMenuItem});
this.editToolStripMenuItem.Name = "editToolStripMenuItem";
this.editToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
this.editToolStripMenuItem.Text = "&Edit";
//
// undoToolStripMenuItem
//
this.undoToolStripMenuItem.Name = "undoToolStripMenuItem";
this.undoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z)));
this.undoToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
this.undoToolStripMenuItem.Text = "&Undo";
//
// redoToolStripMenuItem
//
this.redoToolStripMenuItem.Name = "redoToolStripMenuItem";
this.redoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Y)));
this.redoToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
this.redoToolStripMenuItem.Text = "&Redo";
//
// toolStripSeparator5
//
this.toolStripSeparator5.Name = "toolStripSeparator5";
this.toolStripSeparator5.Size = new System.Drawing.Size(147, 6);
//
// cutToolStripMenuItem
//
this.cutToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("cutToolStripMenuItem.Image")));
this.cutToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
this.cutToolStripMenuItem.Name = "cutToolStripMenuItem";
this.cutToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X)));
this.cutToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
this.cutToolStripMenuItem.Text = "Cu&t";
//
// copyToolStripMenuItem
//
this.copyToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("copyToolStripMenuItem.Image")));
this.copyToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
this.copyToolStripMenuItem.Name = "copyToolStripMenuItem";
this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
this.copyToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
this.copyToolStripMenuItem.Text = "&Copy";
//
// pasteToolStripMenuItem
//
this.pasteToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("pasteToolStripMenuItem.Image")));
this.pasteToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem";
this.pasteToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V)));
this.pasteToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
this.pasteToolStripMenuItem.Text = "&Paste";
//
// toolStripSeparator6
//
this.toolStripSeparator6.Name = "toolStripSeparator6";
this.toolStripSeparator6.Size = new System.Drawing.Size(147, 6);
//
// selectAllToolStripMenuItem
//
this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem";
this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
this.selectAllToolStripMenuItem.Text = "Select &All";
//
// toolsToolStripMenuItem
//
this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.customizeToolStripMenuItem,
this.optionsToolStripMenuItem});
this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem";
this.toolsToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
this.toolsToolStripMenuItem.Text = "&Tools";
//
// customizeToolStripMenuItem
//
this.customizeToolStripMenuItem.Name = "customizeToolStripMenuItem";
this.customizeToolStripMenuItem.Size = new System.Drawing.Size(134, 22);
this.customizeToolStripMenuItem.Text = "&Customize";
//
// optionsToolStripMenuItem
//
this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(134, 22);
this.optionsToolStripMenuItem.Text = "&Options";
//
// helpToolStripMenuItem
//
this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.contentsToolStripMenuItem,
this.indexToolStripMenuItem,
this.searchToolStripMenuItem,
this.toolStripSeparator7,
this.aboutToolStripMenuItem});
this.helpToolStripMenuItem.Name = "helpToolStripMenuItem";
this.helpToolStripMenuItem.Size = new System.Drawing.Size(40, 20);
this.helpToolStripMenuItem.Text = "&Help";
//
// contentsToolStripMenuItem
//
this.contentsToolStripMenuItem.Name = "contentsToolStripMenuItem";
this.contentsToolStripMenuItem.Size = new System.Drawing.Size(129, 22);
this.contentsToolStripMenuItem.Text = "&Contents";
//
// indexToolStripMenuItem
//
this.indexToolStripMenuItem.Name = "indexToolStripMenuItem";
this.indexToolStripMenuItem.Size = new System.Drawing.Size(129, 22);
this.indexToolStripMenuItem.Text = "&Index";
//
// searchToolStripMenuItem
//
this.searchToolStripMenuItem.Name = "searchToolStripMenuItem";
this.searchToolStripMenuItem.Size = new System.Drawing.Size(129, 22);
this.searchToolStripMenuItem.Text = "&Search";
//
// toolStripSeparator7
//
this.toolStripSeparator7.Name = "toolStripSeparator7";
this.toolStripSeparator7.Size = new System.Drawing.Size(126, 6);
//
// aboutToolStripMenuItem
//
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(129, 22);
this.aboutToolStripMenuItem.Text = "&About...";
//
// pgProperties
//
this.pgProperties.Dock = System.Windows.Forms.DockStyle.Fill;
this.pgProperties.Location = new System.Drawing.Point(0, 0);
this.pgProperties.Name = "pgProperties";
this.pgProperties.Size = new System.Drawing.Size(348, 304);
this.pgProperties.TabIndex = 9;
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 49);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.tvPlatform);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
this.splitContainer1.Size = new System.Drawing.Size(820, 552);
this.splitContainer1.SplitterDistance = 468;
this.splitContainer1.TabIndex = 11;
//
// splitContainer2
//
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer2.Location = new System.Drawing.Point(0, 0);
this.splitContainer2.Name = "splitContainer2";
this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer2.Panel1
//
this.splitContainer2.Panel1.Controls.Add(this.tvProject);
//
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add(this.pgProperties);
this.splitContainer2.Size = new System.Drawing.Size(348, 552);
this.splitContainer2.SplitterDistance = 244;
this.splitContainer2.TabIndex = 0;
//
// tvPlatform
//
this.tvPlatform.Dock = System.Windows.Forms.DockStyle.Fill;
this.tvPlatform.ImageIndex = 1;
this.tvPlatform.Location = new System.Drawing.Point(0, 0);
this.tvPlatform.Name = "tvPlatform";
this.tvPlatform.SelectedImageIndex = 1;
this.tvPlatform.Size = new System.Drawing.Size(468, 552);
this.tvPlatform.TabIndex = 1;
//
// tvProject
//
this.tvProject.Dock = System.Windows.Forms.DockStyle.Fill;
this.tvProject.Location = new System.Drawing.Point(0, 0);
this.tvProject.Name = "tvProject";
this.tvProject.Size = new System.Drawing.Size(348, 244);
this.tvProject.TabIndex = 10;
//
// toolStripStatusLabel1
//
this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
this.toolStripStatusLabel1.Size = new System.Drawing.Size(109, 17);
this.toolStripStatusLabel1.Text = "toolStripStatusLabel1";
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(820, 623);
this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.toolStrip1);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.menuStrip1);
this.MainMenuStrip = this.menuStrip1;
this.Name = "MainForm";
this.Text = "SysGen Platform Designer";
this.Load += new System.EventHandler(this.MainForm_Load);
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.ResumeLayout(false);
this.splitContainer2.Panel1.ResumeLayout(false);
this.splitContainer2.Panel2.ResumeLayout(false);
this.splitContainer2.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private TriStateTreeViewDemo.PlatformTreeView tvPlatform;
private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.ToolStrip toolStrip1;
private System.Windows.Forms.ToolStripButton newToolStripButton;
private System.Windows.Forms.ToolStripButton openToolStripButton;
private System.Windows.Forms.ToolStripButton saveToolStripButton;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator;
private System.Windows.Forms.ToolStripButton cutToolStripButton;
private System.Windows.Forms.ToolStripButton copyToolStripButton;
private System.Windows.Forms.ToolStripButton saveConfigToolStripButton;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripButton helpToolStripButton;
private System.Windows.Forms.ToolStripComboBox cmbArchitecture;
private System.Windows.Forms.ToolStripComboBox cmbDebug;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Windows.Forms.ToolStripMenuItem printToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem printPreviewToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem undoToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem redoToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
private System.Windows.Forms.ToolStripMenuItem cutToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem pasteToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;
private System.Windows.Forms.ToolStripMenuItem selectAllToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem toolsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem customizeToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem contentsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem indexToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem searchToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
private System.Windows.Forms.PropertyGrid pgProperties;
private System.Windows.Forms.ToolStripComboBox cmbOptimization;
private ProjectTreeView tvProject;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.SplitContainer splitContainer2;
private System.Windows.Forms.ToolStripMenuItem platformToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem addFiltersToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem addLanguagesToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem addDebToolStripMenuItem;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
}
}
+362
View File
@@ -0,0 +1,362 @@
using System;
using System.Xml;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using TriStateTreeViewDemo;
using SysGen.Framework.Catalog;
using SysGen.BuildEngine;
using SysGen.BuildEngine.Log;
using SysGen.BuildEngine.Framework;
using SysGen.RBuild.Framework;
namespace TriStateTreeViewDemo
{
public interface ISysGenDesigner
{
ModuleFilterController ModuleFilterController { get; }
ProjectController ProjectController { get; }
object InspectedObject { set; }
}
public partial class MainForm : Form, ISysGenDesigner
{
ProjectController m_ProjectController = null;
ModuleFilterController m_FilterController = null;
public MainForm()
{
InitializeComponent();
m_ProjectController = new ProjectController(this);
m_FilterController = new ModuleFilterController(this);
tvPlatform.SetCatalog(this);
tvProject.SetCatalog(this);
tvProject.DoubleClick += new EventHandler(tvProject_DoubleClick);
//lvModuleFilters.SetCatalog(this);
}
private void button1_Click(object sender, EventArgs e)
{
//m_project = new RBuildProject();
m_ProjectController = new ProjectController(this);
m_FilterController = new ModuleFilterController(this);
tvPlatform.SetCatalog(this);
tvProject.SetCatalog(this);
//lvModuleFilters.SetCatalog(this);
//PlatformCatalogReader m_Reader = new PlatformCatalogReader(@"C:\Ros\trunk\reactos\rbuilddb.xml");
/*
BuildLog.Listeners.Clear();
m_SysGenEngine.SetDefaults = false;
m_SysGenEngine.RunBackends = false;
m_SysGenEngine.CleanCustomConfigs();
m_SysGenEngine.ReadBuildFiles();
m_PlatformController = new PlatformController(this);
m_FilterController = new ModuleFilterController(this);
catalogTriStateTreeView1.SetCatalog(this);
lvModuleFilters.SetCatalog(this);
*/
}
void tvProject_DoubleClick(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
using (XmlTextWriter writer = new XmlTextWriter(@"c:\pkg.rbuild", Encoding.ASCII))
{
writer.Indentation = 4;
writer.Formatting = Formatting.Indented;
// Starts a new document
writer.WriteStartDocument();
writer.WriteStartElement("module");
writer.WriteAttributeString("name", "");
writer.WriteAttributeString("type", "modulegroup");
foreach (RBuildModule module in m_ProjectController.Project.Platform.Modules)
{
writer.WriteElementString("requires", module.Name);
}
writer.WriteEndElement();
writer.WriteEndDocument();
}
}
private void button3_Click(object sender, EventArgs e)
{
}
public ModuleFilterController ModuleFilterController
{
get { return m_FilterController; }
}
public ProjectController ProjectController
{
get { return m_ProjectController; }
}
private void lvModuleFilters_SelectedIndexChanged(object sender, EventArgs e)
{
}
//private void lvModuleFilters_ItemCheck(object sender, ItemCheckEventArgs e)
//{
// ModuleFiltersListViewItem filerListViewItem = lvModuleFilters.FocusedItem as ModuleFiltersListViewItem;
// if (filerListViewItem != null)
// {
// if (e.NewValue == CheckState.Checked)
// {
// m_FilterController.Apply(filerListViewItem.Filter);
// }
// }
//}
private void MainForm_Load(object sender, EventArgs e)
{
cmbArchitecture.Items.Add("x86 - (i486)");
cmbArchitecture.Items.Add("x86 - (i586)");
cmbArchitecture.Items.Add("x86 - (Pentium)");
cmbArchitecture.Items.Add("x86 - (Pentium2)");
cmbArchitecture.Items.Add("x86 - (Pentium3)");
cmbArchitecture.Items.Add("x86 - (Pentium4)");
cmbArchitecture.Items.Add("x86 - (athlon-xp)");
cmbArchitecture.Items.Add("x86 - (athlon-mp)");
cmbArchitecture.Items.Add("x86 - (k6-2)");
cmbArchitecture.Items.Add("x86 - Xbox");
cmbArchitecture.Items.Add("Power PC");
cmbArchitecture.Items.Add("ARM");
cmbArchitecture.SelectedIndex = 2;
cmbDebug.Items.Add("Debug");
cmbDebug.Items.Add("Release");
cmbDebug.SelectedIndex = 0;
cmbOptimization.Items.Add("Level 0");
cmbOptimization.Items.Add("Level 1");
cmbOptimization.Items.Add("Level 2");
cmbOptimization.Items.Add("Level 3");
cmbOptimization.Items.Add("Level 4");
cmbOptimization.Items.Add("Level 5");
cmbOptimization.SelectedIndex = 1;
}
public object InspectedObject
{
set
{
if (value is RBuildPlatform)
{
pgProperties.SelectedObject = new PlatformInspector(m_ProjectController.Project.Platform);
}
else
pgProperties.SelectedObject = value;
}
}
private void openToolStripButton_Click(object sender, EventArgs e)
{
m_ProjectController.Open();
}
private void saveToolStripButton_Click(object sender, EventArgs e)
{
m_ProjectController.Save();
}
private void saveConfigToolStripButton_Click(object sender, EventArgs e)
{
//if (MessageBox.Show("Your platform does not have a default shell selected ¿are you sure you want to continue?",
// "Question",
// MessageBoxButtons.YesNo,
// MessageBoxIcon.Question) == DialogResult.OK)
//{
// Creates an XML file is not exist
using (XmlTextWriter writer = new XmlTextWriter(m_ProjectController.SysGenProject.Source + @"\config.rbuild", Encoding.ASCII))
{
writer.Indentation = 4;
writer.Formatting = Formatting.Indented;
// Starts a new document
writer.WriteStartDocument();
writer.WriteStartElement("group");
writer.WriteComment("Platform information");
writer.WriteElementString("platformname", m_ProjectController.Project.Platform.Name);
writer.WriteElementString("platformdescription", m_ProjectController.Project.Platform.Description);
writer.WriteComment("Default applications");
if (m_ProjectController.Project.Platform.Shell != null)
{
writer.WriteElementString("platformshell", m_ProjectController.Project.Platform.Shell.Name);
}
if (m_ProjectController.Project.Platform.Screensaver != null)
{
writer.WriteElementString("platformscreensaver", m_ProjectController.Project.Platform.Screensaver.Name);
}
if (m_ProjectController.Project.Platform.Wallpaper != null)
{
writer.WriteElementString("platformwallpaper", m_ProjectController.Project.Platform.Wallpaper.ID);
}
writer.WriteComment("Modules incuded in the platform");
foreach (RBuildModule module in m_ProjectController.Project.Platform.Modules)
{
writer.WriteElementString("platformmodule", module.Name);
}
writer.WriteComment("Languages incuded in the platform");
foreach (RBuildLanguage language in m_ProjectController.Project.Platform.Languages)
{
writer.WriteElementString("platformlanguage", language.Name);
}
writer.WriteComment("Debug Channels incuded in the platform");
foreach (RBuildDebugChannel debugChannel in m_ProjectController.Project.Platform.DebugChannels)
{
writer.WriteElementString("platformdebugchhanel", debugChannel.Name);
}
writer.WriteComment("Platform RBuild Properties");
writer.WriteComment("Properties");
writer.WriteStartElement("property");
writer.WriteAttributeString("name", "SARCH");
writer.WriteAttributeString("value", "");
writer.WriteEndElement();
writer.WriteStartElement("property");
writer.WriteAttributeString("name", "OARCH");
writer.WriteAttributeString("value", "pentium");
writer.WriteEndElement();
writer.WriteStartElement("property");
writer.WriteAttributeString("name", "OPTIMIZE");
writer.WriteAttributeString("value", ((int)m_ProjectController.SysGenProject.OptimizeLevel).ToString());
writer.WriteEndElement();
writer.WriteStartElement("property");
writer.WriteAttributeString("name", "KDBG");
writer.WriteAttributeString("value", m_ProjectController.SysGenProject.KDebug ? "1" : "0");
writer.WriteEndElement();
writer.WriteStartElement("property");
writer.WriteAttributeString("name", "DBG");
writer.WriteAttributeString("value", m_ProjectController.SysGenProject.Debug ? "1" : "0");
writer.WriteEndElement();
writer.WriteStartElement("property");
writer.WriteAttributeString("name", "GDB");
writer.WriteAttributeString("value", m_ProjectController.SysGenProject.GDB ? "1" : "0");
writer.WriteEndElement();
writer.WriteStartElement("property");
writer.WriteAttributeString("name", "NSWPAT");
writer.WriteAttributeString("value", m_ProjectController.SysGenProject.NSWPAT ? "1" : "0");
writer.WriteEndElement();
writer.WriteStartElement("property");
writer.WriteAttributeString("name", "_WINKD_");
writer.WriteAttributeString("value", m_ProjectController.SysGenProject.WINKD ? "1" : "0");
writer.WriteEndElement();
writer.WriteEndElement();
writer.WriteEndDocument();
// }
}
}
private void newToolStripButton_Click(object sender, EventArgs e)
{
m_ProjectController.New();
}
private void addFiltersToolStripMenuItem_Click(object sender, EventArgs e)
{
using (NewItemForm newItem = new NewItemForm())
{
foreach (ModuleFilter filter in ModuleFilterController.ModuleFilters)
{
newItem.ListView.Items.Add(new ModuleFiltersNewItemListViewItem(this, filter));
}
if (newItem.ShowDialog() == DialogResult.OK)
{
foreach (ListViewItem lvItem in newItem.ListView.SelectedItems)
{
NewItemListViewItem item = lvItem as NewItemListViewItem;
if (item != null)
item.Apply();
}
}
}
}
private void addLanguagesToolStripMenuItem_Click(object sender, EventArgs e)
{
using (NewItemForm newItem = new NewItemForm())
{
foreach (RBuildLanguage language in m_ProjectController.Project.Languages)
{
newItem.ListView.Items.Add(new LanguageNewItemListViewItem(this, language));
}
if (newItem.ShowDialog() == DialogResult.OK)
{
foreach (ListViewItem lvItem in newItem.ListView.SelectedItems)
{
NewItemListViewItem item = lvItem as NewItemListViewItem;
if (item != null)
item.Apply();
}
}
}
}
private void addDebToolStripMenuItem_Click(object sender, EventArgs e)
{
using (NewItemForm newItem = new NewItemForm())
{
foreach (RBuildDebugChannel channel in m_ProjectController.Project.DebugChannels)
{
newItem.ListView.Items.Add(new DebugChannelNewItemListViewItem(this, channel));
}
if (newItem.ShowDialog() == DialogResult.OK)
{
foreach (ListViewItem lvItem in newItem.ListView.SelectedItems)
{
NewItemListViewItem item = lvItem as NewItemListViewItem;
if (item != null)
item.Apply();
}
}
}
}
}
}
@@ -0,0 +1,353 @@
<?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>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>127, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="newToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAQ9JREFUOE+t09lq
wkAUBmBfyr5DfY32jaReSOmFCyKCgkKLFrVUBZeKiEbshqRuaNw1xiXmLxMJBJ0Zc+GBw9zMfDPnHMZm
u1ZE35s4zXCqjmC8Al+sgHLjD9y7yGFWPIbecOO45yORtMAEHnxxJHL1IyKI9JeEXqtMwOl50Q8bSS0l
8PzBBPbqAQQxICrgjeapgKZpkJUdBmNZB+y3d/QSnsIZKrDdqZjMFYj9OR9wB1NngHrQsJC36EkrfIkT
PuDyJ84AZbOHNF2j1Z2h9i3xAVKfOUjjZssN2oMFmq0xSkLfOmBu3E97iurnENlKxzpgbpzwO0Kh1kOy
KFoDjHmzVuYYjRmTDZfyWh9Yd/4B2Mz2w1z7EGUAAAAASUVORK5CYII=
</value>
</data>
<data name="openToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAlpJREFUOE+tk21I
k1EYhif0oyA0sqIQCix/+GcQFFH9CCmiUBTLLEjShJofVBgL2fxoU9Pp5ubUlS5rU9f8rCyjsA+pUCRC
TR1ppmVFUSlmhq78unrnQF1KGHTg/nEOz30993PO+7qJFrmUeiv2n+Mij+XLRLLYULdF2pxlEVIDcw0p
AsyxD5fmI/rQ94pqi26eOlsfuZj+7BgSm01QdA4ih7m73Yx9qGpavwatjPebqCzOprPt8YKQgzFagqL0
BEjyEFWVaBkdLHMxT34uYNwWR9nVTEoL0zHlp2DMSeaSRk6eKt4VWm5WM/rVPNN5SjDTLQebZEHNA1wr
UvHjk3E6tsNcV62e1r3KLGqtKm6WplNpSsVqVFJsOM8VfSKFWjkGtcyZptSYzvC7XByx3zQoqCnTMvlG
CX1prnornPUmQJcUXsbSVhGK5bIOkcmQyveeTHiv4VZ5Nk33Nc6iuSO8CIfmECYa/bE/8ON1iRipJNh5
F0V6Bd86lfQ1JlFj1TDVq4COKCegLVIwHmGiKRB7/V6G7+5koHozymgfYRy5E1CgTWKgXcZ1i5qWp0KS
rjgBcAJawph6FszYk/2M1O1isGYLX8p9ab6wgqP+3rMvYciS01GfzA1LFvQkQ6sQ9/khxhoCGHnox1Dt
NvorxXw0b8Km8UQh2cip6GOzgNyMeKqKM7HdjqFZJ5pRk2YJ9aql3EnxoCJxNaZ4Ly6e3UDY3O6OEXRp
59ApTpIhiyDh9GHORAZyPHQPB/ZtZ/cOMVvFPvh6e7F+3SrWrHRnraf7Xz/xf/rJ/kvxb84I3U1y+9/W
AAAAAElFTkSuQmCC
</value>
</data>
<data name="saveToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAixJREFUOE+tk91L
k3EUx/cvdN9N0EW3NTWGa7EaPOUcyqphWBG9PZEv5dJlmqhYmUYtXyBb4dJJy+kknFT4BqZIjaFMJUsz
V7TEoabYRDD49ju/6Pm1Mi+iH5zLz+c855zvo1L9j/fsaRRUvvZltHmX8Ni9gMaGCO47ZlBb8wn22yHc
KJ9CackECgteIy93FBfOB6H0JrC3B6ipXsVGb2V1Dca0XhxOe8JLEXhbF7mgsuLLX3mCIwsr2G1+DrVa
huWQRwjcj+a5oLTk87qCn/D78CLiTD4UXJ7GAXOTEDjrZ7ngku3dH4Jf4ZHJCLZJXlhzxpGa4hSCurth
LsjOGo0R/A4PBsPYrHdDlgMwmRxCUF31kQvkMwFFsB7c4/+ATYkNOHL0BZKSaoXgZuU0urvATgkcP/kK
lmMDfNu0MJqZPps6/4D7cNDSCUmyC8HVskl0+MAyADS5vrG7f0X59Tm+VFoYzZyZEVTg5NR2GAwVQnCl
cByeZuChc40FJwpjek5MmU/YkH6uiHdOTmHwfg/0+jIhsOWNMRiouhPlnUnAQoI4rYSht7MYm5qDnHsN
e41tHNbucUGnKxICiqXjHpTPJgHBZ/Nv4U1oHqGZJVwstiNe72JwI+J3PYA2MV8IMjOG2dzLfOatBg+2
7JDQ0tEPX9cguvv8GHg5hH0mC9S6eiQweLumDhqNVQgo06dP9fN4UsIoJHRnOhVtmxZGM1NXKoJ3JmTH
Cv71r/4OTrQ4xWMwWlcAAAAASUVORK5CYII=
</value>
</data>
<data name="cutToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAYdJREFUOE+t001L
QlEQBuB+TdCmRVEJRRIWtRAUlKsQhFmkpZQtIiWyAlMwP5KkXS0shLqGFkgoFqWQmaRR2qIvU7FMwWhd
8JZXkFx0uVGzOcNh5jkDw6mr+++4SN7B6fbju/uQecYm6a25+/Hdl2IJptWNmmJyL4DwWZwZUJbtayT8
RxGqIV8oQaaaRfrxkTmw4z2G+WuKbC6PYDgOkUSJp6ccc+AgdI4luwPbHh/UCxb0S0aZN5fHTmefMTVv
wfDEHIiBMegMpt8BZUShNoGQTIKQGxA8TTIHMoUPGF1vEOvTWHTcgqeJQahNwLqVQiRRpIdS+XcM2l4h
1t2DI3WAP7oGoSYE3kwSPQofljcqm/kxjK4SCH0OXSMetItsUC26wZuOVptYhI0eEOuz1YI2gZnKBdpr
6iR9V2jkKOkBQpeiCryhFFr4eioft16iU7qNho4h1Dc00QOqlRuwpSSa+UawuZXdByIZsPoUaOmWwrUf
owcOozlwZeto7ZXDuXvCfHV/+dGfqqrf44qgu28AAAAASUVORK5CYII=
</value>
</data>
<data name="copyToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAeJJREFUOE+lk9FP
klEYxv1TSsecde0f0FpZrTbbal7URVvZuuJCr7pq2WzLNWy0iSHNwtIB9qG0ltLSYRJpBomUgZPMGSyU
8SmJIOiv7zssCdrAzXd77s77e5/nnPdUVR20HBPfUCWNB4QsI176HB8IL/9iX2y1ubTMwx6utz0nuLhc
GWIfCxT153Z26ep/g9Md4FJLZ2WIZdQnAM4QSJ/BH5Z5aH6NNCljm0hgdSV4MppAPxQXCq5kil31OTx7
DjLbOeSNNJFYUgBKq31glfpmN76F9QLEZHOJc73ubXQjMreln7Q+DdP/du0/QIsxhmNK5mjTMJ/m43mI
Qcmr5t5MZVlNpFiKrPM1vIbpVVQAOqSckF+ZekUX5UjTS+ouDFLb+CwPUPNupbN7k7WmEDcMX3hgXSpy
IP/OsrCyhXtuA6M0g+bc4wJATqaZ/x7DF4zg8f9g/OMibb355701kERriHL5fojzd2aFjNI0mjPdBUD9
6auUqlU/KwBZJV4skWUuvMmYV8b+Ls6jQQ81DfryO3KtfUoA/p3810G37T3VJ3TlARdvukhldjANeemx
z2B8MS0mq80GyySHj98rD2jQOpXbtgrVNprRnO2h5lQX1Sc7leYODh27W3nN9/WZDnroDx0A5wwhdtmt
AAAAAElFTkSuQmCC
</value>
</data>
<data name="saveConfigToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAlBJREFUOE+1k1lI
lGEUhn/owm6KFuqqq4LoJooIqouMwixMM4zEjKyJGJUSlcnSITU1RSe3SdPGyGVQc6tEUSkSIXFo13CM
FonUyGmy5p9xz+Lp/z8ZbGjzpgMv5+a8z1n4Pkn6H9HZnEH7zVQayxKYF7+hMg+3ynKO4LBVMWa7xmBf
Nme1vuSl67hi0GNMj/sVqBon5XqmnXVMOqoxF+sYH6kgJyWKF13xnD/tT7xmM7bOY4y0riY6bL8nRAWo
5mlnDUUZR+m2ZCO/L2C4T89bywmaSgIJD/WmKnEVT/MkIg/v8wTUVeTMAuQbGBLDSNaFoI8K5lxkEDpt
IDEafyJCfciPXiMAIX7enoDqUgNTci1TdhPjQ5nYn0dhrVgu1Fu+jO7iRTwyegmzKp9tGz0BZlMGE/Yy
JgbSGH95irFnB5GbF5Nb3kqmqZELl2uJN5iJSS0hPMFIWGyWJ6C0MJXRQSNjfVpGH/vjur+Jj7dXCLM7
pme+4XBOMjDsIDgihYDj+jlISW4S8qs0XA99cXWsx9m2ksFySXRWo/RWp5Cppp3efpsw3+2ysidIMwsp
zErgc88ZnO3rkFuWYq/3ov+6JMb+OvOdLy6l8wcHvW9sWHre4Rcag69i3rX3AN7bdyDlX4zD/iBCMS/h
U8NChioXYC2SiFZ2Vsd2T3BVmaDA3EZTh1VkVVs3rEW6lBwrHoj7yu6sVQ72c+d7ltfCXH+nm5rWJ3MA
dY3cpJPKCwtEE7SbgJ1bBFm9trqzu9vvspjgT3FIubZa8C/N67P9regHTvjvLQ3rR38AAAAASUVORK5C
YII=
</value>
</data>
<data name="helpToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAhhJREFUOE+1U09r
E0EU70fIR9iPUBQ8eMrR46IN5JhCDz2oBA8SBHEpCMFgG5GiwdJdq2Ijqe6ldo3Wrmhri0gXazW2YbMt
UdNmm45ulf7R/HwzU1hLIzn54LFvhvn9eW9nOjr+R0wvBLhTXEf6bgV9w0sYLJQx/uoz2mq9c7eRn2pA
L67Bq+/i29YeWLBL9Q6u5ktI6w6Kr1dbE3HwA3sT/o8mbAfQRgE1LZPXtsPgbjZxaXAG4y/Kh0m48sbP
JgwbiKYAwwLYNkR4DEje5HsMFSI5l3l2kGD6/RYezzeEMgfzwzzMWSCRlV9OFk0xqhl06wNy+Tchyb2n
dXxhv4TVaFLazppAJ9VKL0MySxYoVI0hkXaw5AbovjAWEmTur4qBqZoEdfbKVCgTBObqdolBUW0ocRs1
P8Cx2PWQ4PJtl6a9J+xLIB1OMHIilU2b1gSMqCZ9TdTq33FEHQgJcg8rWPF3qHcJVOKeyOyoJIioDqUk
UFM2SuUqus4YIcHEzFdYji8GxIGROAc41JJHc6E1B58wRRqWhzFrEVduTR78E5mRBSz7v0l1H0AgXgsH
+2DNcPBp3cep0/rhezA5V0Vfbg5ug+4CqaiaI/rmyWu+t1zdQIysDxdmW9/GiZcVnO+fgvHkI+YXV7BG
067VA9Ezt91Fyvq/wH8/lKHCW/RcfITj8Rs4evIaYmdHkBl63v4xtX1tLQ78AZ3a8qxOv4hDAAAAAElF
TkSuQmCC
</value>
</data>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>226, 17</value>
</metadata>
<data name="newToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAQ9JREFUOE+t09lq
wkAUBmBfyr5DfY32jaReSOmFCyKCgkKLFrVUBZeKiEbshqRuaNw1xiXmLxMJBJ0Zc+GBw9zMfDPnHMZm
u1ZE35s4zXCqjmC8Al+sgHLjD9y7yGFWPIbecOO45yORtMAEHnxxJHL1IyKI9JeEXqtMwOl50Q8bSS0l
8PzBBPbqAQQxICrgjeapgKZpkJUdBmNZB+y3d/QSnsIZKrDdqZjMFYj9OR9wB1NngHrQsJC36EkrfIkT
PuDyJ84AZbOHNF2j1Z2h9i3xAVKfOUjjZssN2oMFmq0xSkLfOmBu3E97iurnENlKxzpgbpzwO0Kh1kOy
KFoDjHmzVuYYjRmTDZfyWh9Yd/4B2Mz2w1z7EGUAAAAASUVORK5CYII=
</value>
</data>
<data name="openToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAlpJREFUOE+tk21I
k1EYhif0oyA0sqIQCix/+GcQFFH9CCmiUBTLLEjShJofVBgL2fxoU9Pp5ubUlS5rU9f8rCyjsA+pUCRC
TR1ppmVFUSlmhq78unrnQF1KGHTg/nEOz30993PO+7qJFrmUeiv2n+Mij+XLRLLYULdF2pxlEVIDcw0p
AsyxD5fmI/rQ94pqi26eOlsfuZj+7BgSm01QdA4ih7m73Yx9qGpavwatjPebqCzOprPt8YKQgzFagqL0
BEjyEFWVaBkdLHMxT34uYNwWR9nVTEoL0zHlp2DMSeaSRk6eKt4VWm5WM/rVPNN5SjDTLQebZEHNA1wr
UvHjk3E6tsNcV62e1r3KLGqtKm6WplNpSsVqVFJsOM8VfSKFWjkGtcyZptSYzvC7XByx3zQoqCnTMvlG
CX1prnornPUmQJcUXsbSVhGK5bIOkcmQyveeTHiv4VZ5Nk33Nc6iuSO8CIfmECYa/bE/8ON1iRipJNh5
F0V6Bd86lfQ1JlFj1TDVq4COKCegLVIwHmGiKRB7/V6G7+5koHozymgfYRy5E1CgTWKgXcZ1i5qWp0KS
rjgBcAJawph6FszYk/2M1O1isGYLX8p9ab6wgqP+3rMvYciS01GfzA1LFvQkQ6sQ9/khxhoCGHnox1Dt
NvorxXw0b8Km8UQh2cip6GOzgNyMeKqKM7HdjqFZJ5pRk2YJ9aql3EnxoCJxNaZ4Ly6e3UDY3O6OEXRp
59ApTpIhiyDh9GHORAZyPHQPB/ZtZ/cOMVvFPvh6e7F+3SrWrHRnraf7Xz/xf/rJ/kvxb84I3U1y+9/W
AAAAAElFTkSuQmCC
</value>
</data>
<data name="saveToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAixJREFUOE+tk91L
k3EUx/cvdN9N0EW3NTWGa7EaPOUcyqphWBG9PZEv5dJlmqhYmUYtXyBb4dJJy+kknFT4BqZIjaFMJUsz
V7TEoabYRDD49ju/6Pm1Mi+iH5zLz+c855zvo1L9j/fsaRRUvvZltHmX8Ni9gMaGCO47ZlBb8wn22yHc
KJ9CackECgteIy93FBfOB6H0JrC3B6ipXsVGb2V1Dca0XhxOe8JLEXhbF7mgsuLLX3mCIwsr2G1+DrVa
huWQRwjcj+a5oLTk87qCn/D78CLiTD4UXJ7GAXOTEDjrZ7ngku3dH4Jf4ZHJCLZJXlhzxpGa4hSCurth
LsjOGo0R/A4PBsPYrHdDlgMwmRxCUF31kQvkMwFFsB7c4/+ATYkNOHL0BZKSaoXgZuU0urvATgkcP/kK
lmMDfNu0MJqZPps6/4D7cNDSCUmyC8HVskl0+MAyADS5vrG7f0X59Tm+VFoYzZyZEVTg5NR2GAwVQnCl
cByeZuChc40FJwpjek5MmU/YkH6uiHdOTmHwfg/0+jIhsOWNMRiouhPlnUnAQoI4rYSht7MYm5qDnHsN
e41tHNbucUGnKxICiqXjHpTPJgHBZ/Nv4U1oHqGZJVwstiNe72JwI+J3PYA2MV8IMjOG2dzLfOatBg+2
7JDQ0tEPX9cguvv8GHg5hH0mC9S6eiQweLumDhqNVQgo06dP9fN4UsIoJHRnOhVtmxZGM1NXKoJ3JmTH
Cv71r/4OTrQ4xWMwWlcAAAAASUVORK5CYII=
</value>
</data>
<data name="printToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAi1JREFUOE+1k/9P
UlEYxv2nWK2tVlttGmpltrCcEQ1XUjSMaUHJNLIpNcnCragplBvUoC/okJhZLG92ySUpU8RNICdIhAio
EF+e7r1UZMDW1jrb+8t7z/N83vucc8rK/sdyeYIwvpopWYbRaZTk0uIx0o0/V/JbGt7lVTwxT6CKKylt
oLd8xGYihS/hKGz2WaaeWUnoTATsMz7UCztx9Ex7cYN3jkUQU4tb4DR5LZaAcyEAg4VE5YlLMFmJQoNQ
JA61gUA6k4XPH9pCN9s+gZz2oq5Jjlq+DDfUz3Fba86bOGY9jHiUdDF0mvqT7A/F4fKEcE9nZf5d1jOI
B4ZxVJ2U5gyc8z70akegMX3AXb0ND1+8R6/GgvZbeog61OA2K3CA2lxR34JjZ69B2T8EsVyN/Q0XcwY3
B14iGk8UpE43UukMNqhA6QyC4Q0srcQg7dagsbWHmuDHScj7jDC9nsJTqx0a4xjuaIfRqXoMSXc/hG0q
8C4owGnqwEGeFOXHxThH9eoEV7G7VpiboE2pK0qnm9H1JLz+NUzOBfHWEcAQsQSuqAuVDa1gVZzKGUgU
jwoMqAzxNZbC3Od1jDvDYPdth+7NCpP8Yf4V7KoR5A1arg8gmQIoGMLxLJYjWSwEMphwb2J4MoZB2yqU
LBZUIxHGYB9HlBfTE4jl9+GmBPTHv6lfo//+GGoaZajmXQabumXl1HHt5TRjz5Hz2HlIgB3Vp7GNzWeo
RcX/+pq/AwHYL0leVl8fAAAAAElFTkSuQmCC
</value>
</data>
<data name="printPreviewToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAY5JREFUOE+d081L
AkEUAPD1T+hYhzoERV77OHUo8JBBt+4RRkSQ4U0SunaJOkSRKQWZWCiF5kdroa0WRAoRFXXoEEkWCUFY
Wbvrvnqz7NK6OxANPIZh5v1m3uyOKZK5AaamiaLICILACDzPtDXXM+3mRlPtGnWMAK15g4fQabVBYDej
20QFdtJXVGBxg4Xk8aWMRDhjJLh/TgUW1hPQ1T+ihmEZgXieCghiFRBRIEPAFzkxBO4fSsByOfBsRkkE
4xkoFEv6Mla3szoAF2Jy+E2A0KMc/nyRINe3BS2yspXSAf4YR5Kfq/LUE1QJopxEU8qSP6kD5nwxFUAE
A0E8hdM1rz0BXtDvhheHwMEnwKkkJ2OPAJMuw+TUDB2QJAneKzxgCRNnHwTBUJJd3ijYx8fowBcvwstr
BXIXdxBOZAmCu2JgssMxBGvOOmNA+d5KP+sJw17qiJRjn3bDwOAocF4LQMWtRTABf9W/hLWjFcpsA0Fc
tm76+6C+vJ+J4b4WgmAp/0bMTXVg6ekFNrQM3y3xMcC3lb+tAAAAAElFTkSuQmCC
</value>
</data>
<data name="cutToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAYdJREFUOE+t001L
QlEQBuB+TdCmRVEJRRIWtRAUlKsQhFmkpZQtIiWyAlMwP5KkXS0shLqGFkgoFqWQmaRR2qIvU7FMwWhd
8JZXkFx0uVGzOcNh5jkDw6mr+++4SN7B6fbju/uQecYm6a25+/Hdl2IJptWNmmJyL4DwWZwZUJbtayT8
RxGqIV8oQaaaRfrxkTmw4z2G+WuKbC6PYDgOkUSJp6ccc+AgdI4luwPbHh/UCxb0S0aZN5fHTmefMTVv
wfDEHIiBMegMpt8BZUShNoGQTIKQGxA8TTIHMoUPGF1vEOvTWHTcgqeJQahNwLqVQiRRpIdS+XcM2l4h
1t2DI3WAP7oGoSYE3kwSPQofljcqm/kxjK4SCH0OXSMetItsUC26wZuOVptYhI0eEOuz1YI2gZnKBdpr
6iR9V2jkKOkBQpeiCryhFFr4eioft16iU7qNho4h1Dc00QOqlRuwpSSa+UawuZXdByIZsPoUaOmWwrUf
owcOozlwZeto7ZXDuXvCfHV/+dGfqqrf44qgu28AAAAASUVORK5CYII=
</value>
</data>
<data name="copyToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAeJJREFUOE+lk9FP
klEYxv1TSsecde0f0FpZrTbbal7URVvZuuJCr7pq2WzLNWy0iSHNwtIB9qG0ltLSYRJpBomUgZPMGSyU
8SmJIOiv7zssCdrAzXd77s77e5/nnPdUVR20HBPfUCWNB4QsI176HB8IL/9iX2y1ubTMwx6utz0nuLhc
GWIfCxT153Z26ep/g9Md4FJLZ2WIZdQnAM4QSJ/BH5Z5aH6NNCljm0hgdSV4MppAPxQXCq5kil31OTx7
DjLbOeSNNJFYUgBKq31glfpmN76F9QLEZHOJc73ubXQjMreln7Q+DdP/du0/QIsxhmNK5mjTMJ/m43mI
Qcmr5t5MZVlNpFiKrPM1vIbpVVQAOqSckF+ZekUX5UjTS+ouDFLb+CwPUPNupbN7k7WmEDcMX3hgXSpy
IP/OsrCyhXtuA6M0g+bc4wJATqaZ/x7DF4zg8f9g/OMibb355701kERriHL5fojzd2aFjNI0mjPdBUD9
6auUqlU/KwBZJV4skWUuvMmYV8b+Ls6jQQ81DfryO3KtfUoA/p3810G37T3VJ3TlARdvukhldjANeemx
z2B8MS0mq80GyySHj98rD2jQOpXbtgrVNprRnO2h5lQX1Sc7leYODh27W3nN9/WZDnroDx0A5wwhdtmt
AAAAAElFTkSuQmCC
</value>
</data>
<data name="pasteToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAlBJREFUOE+1k1lI
lGEUhn/owm6KFuqqq4LoJooIqouMwixMM4zEjKyJGJUSlcnSITU1RSe3SdPGyGVQc6tEUSkSIXFo13CM
FonUyGmy5p9xz+Lp/z8ZbGjzpgMv5+a8z1n4Pkn6H9HZnEH7zVQayxKYF7+hMg+3ynKO4LBVMWa7xmBf
Nme1vuSl67hi0GNMj/sVqBon5XqmnXVMOqoxF+sYH6kgJyWKF13xnD/tT7xmM7bOY4y0riY6bL8nRAWo
5mlnDUUZR+m2ZCO/L2C4T89bywmaSgIJD/WmKnEVT/MkIg/v8wTUVeTMAuQbGBLDSNaFoI8K5lxkEDpt
IDEafyJCfciPXiMAIX7enoDqUgNTci1TdhPjQ5nYn0dhrVgu1Fu+jO7iRTwyegmzKp9tGz0BZlMGE/Yy
JgbSGH95irFnB5GbF5Nb3kqmqZELl2uJN5iJSS0hPMFIWGyWJ6C0MJXRQSNjfVpGH/vjur+Jj7dXCLM7
pme+4XBOMjDsIDgihYDj+jlISW4S8qs0XA99cXWsx9m2ksFySXRWo/RWp5Cppp3efpsw3+2ysidIMwsp
zErgc88ZnO3rkFuWYq/3ov+6JMb+OvOdLy6l8wcHvW9sWHre4Rcag69i3rX3AN7bdyDlX4zD/iBCMS/h
U8NChioXYC2SiFZ2Vsd2T3BVmaDA3EZTh1VkVVs3rEW6lBwrHoj7yu6sVQ72c+d7ltfCXH+nm5rWJ3MA
dY3cpJPKCwtEE7SbgJ1bBFm9trqzu9vvspjgT3FIubZa8C/N67P9regHTvjvLQ3rR38AAAAASUVORK5C
YII=
</value>
</data>
</root>
@@ -0,0 +1,295 @@
using System;
using System.Collections.Generic;
using System.Text;
using SysGen.BuildEngine;
using SysGen.BuildEngine.Framework;
using SysGen.RBuild.Framework;
namespace TriStateTreeViewDemo
{
public class ModuleFilterController
{
private List<ModuleFilter> m_ModuleFilters = new List<ModuleFilter>();
private ISysGenDesigner m_SysGenDesigner = null;
public ModuleFilterController(ISysGenDesigner engine)
{
//The engine...
m_SysGenDesigner = engine;
RegisterDinamicFilters();
RegisterModuleGroups();
InitializeFilters();
}
private void RegisterDinamicFilters()
{
m_ModuleFilters.Add(new AllModuleFilter());
m_ModuleFilters.Add(new AllWin32CUIModuleFilter());
m_ModuleFilters.Add(new AllWin32GUIModuleFilter());
m_ModuleFilters.Add(new AllScreenSaversModuleFilter());
m_ModuleFilters.Add(new AllKeyboardLayoutsModuleFilter());
m_ModuleFilters.Add(new AllDriversModuleFilter());
m_ModuleFilters.Add(new AllDllsModuleFilter());
}
private void RegisterModuleGroups()
{
foreach (RBuildModule module in m_SysGenDesigner.ProjectController.AvailableModules)
{
if (module.Type == ModuleType.ModuleGroup)
{
m_ModuleFilters.Add(new PackageModuleFilter(module));
}
}
}
private void InitializeFilters()
{
foreach (ModuleFilter filter in m_ModuleFilters)
{
filter.Designer = m_SysGenDesigner;
filter.Initialize();
}
}
public List<ModuleFilter> ModuleFilters
{
get { return m_ModuleFilters; }
}
public void Apply(ModuleFilter filter)
{
m_SysGenDesigner.ProjectController.Add(filter.Modules);
}
public void Remove(ModuleFilter filter)
{
//m_SysGenDesigner.PlatformController.Remove(filter.Modules);
}
}
public abstract class ModuleFilter
{
protected ISysGenDesigner m_Project = null;
protected RBuildModuleCollection m_Modules = new RBuildModuleCollection();
public ModuleFilter()
{
}
public virtual void Initialize()
{
ExecuteRule();
}
public abstract void ExecuteRule();
public RBuildModuleCollection Modules
{
get { return m_Modules; }
}
public ISysGenDesigner Designer
{
get { return m_Project; }
set { m_Project = value; }
}
public abstract string Name { get; }
public override string ToString()
{
return string.Format("{0} - ({1} modules)",
Name,
Modules.Count);
}
}
public class PackageModuleFilter : ModuleFilter
{
RBuildModule m_Module = null;
public PackageModuleFilter(RBuildModule module)
{
//Save the underlaying module...
m_Module = module;
}
public override string Name
{
get { return (m_Module.Description != null) ? m_Module.Description : m_Module.Name; }
}
public override void ExecuteRule()
{
Modules.Add(m_Module.Needs);
}
}
public class AllModuleFilter : ModuleFilter
{
public AllModuleFilter()
{
}
public override string Name
{
get { return "All"; }
}
public override void ExecuteRule()
{
foreach (RBuildModule module in Designer.ProjectController.AvailableModules)
{
if (Modules.Contains(module) == false)
Modules.Add(module);
}
}
}
public class AllWin32CUIModuleFilter : ModuleFilter
{
public AllWin32CUIModuleFilter()
{
}
public override string Name
{
get { return "All Console Applications"; }
}
public override void ExecuteRule()
{
foreach (RBuildModule module in Designer.ProjectController.AvailableModules)
{
if (module.Type == ModuleType.Win32CUI)
{
if (Modules.Contains(module) == false)
Modules.Add(module);
}
}
}
}
public class AllWin32GUIModuleFilter : ModuleFilter
{
public AllWin32GUIModuleFilter()
{
}
public override string Name
{
get { return "All Graphical Applications"; }
}
public override void ExecuteRule()
{
foreach (RBuildModule module in Designer.ProjectController.AvailableModules)
{
if (module.Type == ModuleType.Win32GUI)
{
if (Modules.Contains(module) == false)
Modules.Add(module);
}
}
}
}
public class AllScreenSaversModuleFilter : ModuleFilter
{
public AllScreenSaversModuleFilter()
{
}
public override string Name
{
get { return "All ScreenSavers"; }
}
public override void ExecuteRule()
{
foreach (RBuildModule module in Designer.ProjectController.AvailableModules)
{
if (module.Type == ModuleType.Win32SCR)
{
if (Modules.Contains(module) == false)
Modules.Add(module);
}
}
}
}
public class AllKeyboardLayoutsModuleFilter : ModuleFilter
{
public AllKeyboardLayoutsModuleFilter()
{
}
public override string Name
{
get { return "All Keyboard Layouts"; }
}
public override void ExecuteRule()
{
foreach (RBuildModule module in Designer.ProjectController.AvailableModules)
{
if (module.Type == ModuleType.KeyboardLayout)
{
if (Modules.Contains(module) == false)
Modules.Add(module);
}
}
}
}
public class AllDriversModuleFilter : ModuleFilter
{
public AllDriversModuleFilter()
{
}
public override string Name
{
get { return "All Drivers"; }
}
public override void ExecuteRule()
{
foreach (RBuildModule module in Designer.ProjectController.AvailableModules)
{
if (module.Type == ModuleType.KernelModeDriver)
{
if (Modules.Contains(module) == false)
Modules.Add(module);
}
}
}
}
public class AllDllsModuleFilter : ModuleFilter
{
public AllDllsModuleFilter()
{
}
public override string Name
{
get { return "All Dlls"; }
}
public override void ExecuteRule()
{
foreach (RBuildModule module in Designer.ProjectController.AvailableModules)
{
if (module.Type == ModuleType.Win32DLL)
{
if (Modules.Contains(module) == false)
Modules.Add(module);
}
}
}
}
}
+135
View File
@@ -0,0 +1,135 @@
namespace TriStateTreeViewDemo
{
partial class NewItemForm
{
/// <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.lbItems = new System.Windows.Forms.Label();
this.lvAddItem = new System.Windows.Forms.ListView();
this.btnAdd = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.lbDescription = new System.Windows.Forms.Label();
this.lbName = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// lbItems
//
this.lbItems.AutoSize = true;
this.lbItems.Location = new System.Drawing.Point(12, 24);
this.lbItems.Name = "lbItems";
this.lbItems.Size = new System.Drawing.Size(78, 13);
this.lbItems.TabIndex = 0;
this.lbItems.Text = "Available Items";
//
// lvAddItem
//
this.lvAddItem.Location = new System.Drawing.Point(12, 40);
this.lvAddItem.Name = "lvAddItem";
this.lvAddItem.Size = new System.Drawing.Size(583, 236);
this.lvAddItem.TabIndex = 1;
this.lvAddItem.UseCompatibleStateImageBehavior = false;
this.lvAddItem.View = System.Windows.Forms.View.List;
this.lvAddItem.DoubleClick += new System.EventHandler(this.lvAddItem_DoubleClick);
//
// btnAdd
//
this.btnAdd.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btnAdd.Location = new System.Drawing.Point(439, 348);
this.btnAdd.Name = "btnAdd";
this.btnAdd.Size = new System.Drawing.Size(75, 23);
this.btnAdd.TabIndex = 2;
this.btnAdd.Text = "Add";
this.btnAdd.UseVisualStyleBackColor = true;
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(520, 348);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 3;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
//
// lbDescription
//
this.lbDescription.AutoSize = true;
this.lbDescription.Location = new System.Drawing.Point(12, 279);
this.lbDescription.Name = "lbDescription";
this.lbDescription.Size = new System.Drawing.Size(79, 13);
this.lbDescription.TabIndex = 4;
this.lbDescription.Text = "Select any item";
//
// lbName
//
this.lbName.AutoSize = true;
this.lbName.Location = new System.Drawing.Point(9, 308);
this.lbName.Name = "lbName";
this.lbName.Size = new System.Drawing.Size(35, 13);
this.lbName.TabIndex = 5;
this.lbName.Text = "&Name";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(53, 305);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(542, 20);
this.textBox1.TabIndex = 6;
//
// NewItemForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(607, 383);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.lbName);
this.Controls.Add(this.lbDescription);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnAdd);
this.Controls.Add(this.lvAddItem);
this.Controls.Add(this.lbItems);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "NewItemForm";
this.Text = "Add Item";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label lbItems;
private System.Windows.Forms.ListView lvAddItem;
private System.Windows.Forms.Button btnAdd;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Label lbDescription;
private System.Windows.Forms.Label lbName;
private System.Windows.Forms.TextBox textBox1;
}
}
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace TriStateTreeViewDemo
{
public partial class NewItemForm : Form
{
public NewItemForm()
{
InitializeComponent();
}
public ListView ListView
{
get { return lvAddItem; }
}
private void lvAddItem_DoubleClick(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
}
}
}
@@ -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>
@@ -0,0 +1,206 @@
using System;
using System.Collections;
using System.Diagnostics;
using System.Text;
using System.Xml;
using System.Collections.Generic;
using SysGen.RBuild.Framework;
namespace SysGen.Framework.Catalog
{
public class PlatformCatalogReader
{
XmlDocument doc = new XmlDocument();
RBuildProject m_Project = new RBuildProject();
public PlatformCatalogReader(string filename)
{
doc.Load(filename);
}
public RBuildProject Project
{
get { return m_Project; }
}
public void Read()
{
foreach (XmlNode node in doc.SelectSingleNode("/catalog/modules").ChildNodes)
{
RBuildModule module = new RBuildModule();
module.Type = (ModuleType)Enum.Parse(typeof(ModuleType), node.Attributes["type"].Value.ToString());
module.Name = node.Attributes["name"].Value.ToString();
module.Folder.Base = node.Attributes["base"].Value.ToString();
module.CatalogPath = node.Attributes["path"].Value.ToString();
module.Description = node.Attributes["desc"].Value.ToString();
m_Project.Modules.Add(module);
}
foreach (XmlNode node in doc.SelectSingleNode("/catalog/modules").ChildNodes)
{
RBuildModule module = m_Project.Modules.GetByName(node.Attributes["name"].Value.ToString());
foreach (XmlNode snode in node.SelectSingleNode("libraries").ChildNodes)
{
module.Libraries.Add(m_Project.Modules.GetByName(snode.InnerText));
}
foreach (XmlNode snode in node.SelectSingleNode("dependencies").ChildNodes)
{
module.Dependencies.Add(m_Project.Modules.GetByName(snode.InnerText));
}
foreach (XmlNode snode in node.SelectSingleNode("requeriments").ChildNodes)
{
module.Requeriments.Add(m_Project.Modules.GetByName(snode.InnerText));
}
}
foreach (XmlNode node in doc.SelectSingleNode("/catalog/languages").ChildNodes)
{
RBuildLanguage language = new RBuildLanguage();
language.Name = node.Attributes["name"].Value.ToString();
m_Project.Languages.Add(language);
}
foreach (XmlNode node in doc.SelectSingleNode("/catalog/debugchannels").ChildNodes)
{
RBuildDebugChannel language = new RBuildDebugChannel();
language.Name = node.Attributes["name"].Value.ToString();
m_Project.DebugChannels.Add(language);
}
/*
RBuildModuleInfoCollection modules = new RBuildModuleInfoCollection();
WhitespaceHandling = WhitespaceHandling.None;
ReadStartElement("modules");
while (Name == "module")
{
RBuildModuleInfo module = new RBuildModuleInfo();
MoveToFirstAttribute();
do
{
switch (Name)
{
case "name":
module.Name = Value;
break;
case "type":
module.Type = (ModuleType)Enum.Parse(typeof(ModuleType), Value);
break;
case "base":
module.Base = Value;
break;
case "desc":
module.CatalogPath = Value;
break;
case "path":
module.CatalogPath = Value;
break;
}
}
while (MoveToNextAttribute());
MoveToElement();
//Read();
//Read();
if (Name == "libraries")
{
if (!IsEmptyElement)
{
ReadStartElement("libraries");
while (Name == "library")
{
ReadStartElement("library");
module.Libraries.Add(ReadContentAsString());
ReadEndElement();
}
ReadEndElement();
}
else
ReadStartElement("libraries");
}
if (Name == "dependencies")
{
if (!IsEmptyElement)
{
ReadStartElement("dependencies");
while (Name == "dependency")
{
ReadStartElement("dependency");
module.Dependencies.Add(ReadContentAsString());
ReadEndElement();
}
ReadEndElement();
}
else
ReadStartElement("dependencies");
}
if (Name == "requeriments")
{
if (!IsEmptyElement)
{
ReadStartElement("requeriments");
while (Name == "requires")
{
ReadStartElement("requires");
module.Requirements.Add(ReadContentAsString());
ReadEndElement();
}
ReadEndElement();
}
else
ReadStartElement("requeriments");
}
modules.Add(module);
Read();
}
ReadEndElement();
foreach (RBuildModuleInfo moduleInfo in modules)
{
RBuildModule module = new RBuildModule();
module.Type = moduleInfo.Type;
module.Name = moduleInfo.Name;
m_Modules.Add(module);
}
foreach (RBuildModuleInfo moduleInfo in modules)
{
RBuildModule module = m_Modules.GetByName(moduleInfo.Name);
foreach (string library in moduleInfo.Libraries)
module.Libraries.Add(m_Modules.GetByName(library));
foreach (string library in moduleInfo.Dependencies)
module.Dependencies.Add(m_Modules.GetByName(library));
foreach (string library in moduleInfo.Requirements)
module.Requeriments.Add(m_Modules.GetByName(library));
}*/
}
}
}
@@ -0,0 +1,86 @@
using System;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Text;
using SysGen.RBuild.Framework;
using SysGen.BuildEngine;
using SysGen.BuildEngine.Tasks;
namespace TriStateTreeViewDemo
{
public class PlatformController
{
private ISysGenDesigner m_SysGenDesigner = null;
public PlatformController(ISysGenDesigner engine)
{
m_SysGenDesigner = engine;
}
public ProjectTask ProjectTask
{
get { return m_SysGenDesigner.SysGenEngine.ProjectTask; }
}
public RBuildProject Project
{
get { return m_SysGenDesigner.SysGenEngine.Project; }
}
public void Remove(RBuildModule module)
{
}
public void Add(RBuildModule module)
{
SysGenDependencyTracker dependencyTracker = new SysGenDependencyTracker(module , Project.Platform.Modules);
if (AskAddModulesToPlatform(dependencyTracker.Missing))
{
Project.Platform.Modules.Add(dependencyTracker.Dependencies);
}
}
public void Add(RBuildModuleCollection modules)
{
SysGenDependencyTracker dependencyTracker = new SysGenDependencyTracker(modules, Project.Platform.Modules);
if (AskAddModulesToPlatform(dependencyTracker.Missing))
{
Project.Platform.Modules.Add(dependencyTracker.Dependencies);
}
}
public bool AskAddModulesToPlatform(RBuildModuleCollection missingDependencies)
{
if (missingDependencies.Count > 0)
{
StringBuilder str = new StringBuilder();
str.AppendFormat("This action requieres adding {0} dependecies no present in your platform :", missingDependencies.Count);
str.AppendLine();
str.AppendLine();
foreach (RBuildModule dependency in missingDependencies)
{
str.AppendFormat("{0} on '{1}' \n",
dependency.Name,
dependency.Base);
}
str.AppendLine();
str.AppendLine("¿Do you want to add this dependencies?");
if (MessageBox.Show(str.ToString(), "RosBuilder", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
{
return true;
}
}
else
return true;
return false;
}
}
}
+109
View File
@@ -0,0 +1,109 @@
using System;
using System.Reflection;
using System.Collections.Generic;
using System.Windows.Forms;
using TriStateTreeViewDemo;
namespace TriStateTreeViewDemo
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
MainForm mainForm = new MainForm();
if (args.Length == 0)
{
//Create file associations from .dnml files to the script engine
CreateFileAssociation();
}
else if (args[0].ToLower() == "remove")
{
//Remove file associations for .dnml files to the script engine
RemoveFileAssociation();
}
else
{
mainForm.ProjectController.Open(args[0]);
if (args.Length > 1)
{
if (args[1].ToLower() == "x86")
{
MessageBox.Show("86");
}
else if (args[1].ToLower() == "ppc")
{
MessageBox.Show("ppc");
}
else if (args[1].ToLower() == "arm")
{
MessageBox.Show("arm");
}
else
{
MessageBox.Show("Unknown Architecture");
}
if (args.Length > 2)
{
if (args[2].ToLower() == "debug")
{
mainForm.ProjectController.SysGenProject.Debug = true;
}
else if (args[2].ToLower() == "release")
{
mainForm.ProjectController.SysGenProject.Debug = false;
}
else
{
MessageBox.Show("Unknown Target Mode");
}
}
}
}
//Run the application
Application.Run(mainForm);
}
internal static void CreateFileAssociation()
{
FileAssociation FA = new FileAssociation();
FA.Extension = "sgpd";
FA.ContentType = "application/sysgenproject";
FA.FullName = "SysGenProject";
FA.ProperName = "SysGenProject";
FA.AddCommand("open", "\"" + Assembly.GetExecutingAssembly().Location + "\" \" %1\"");
FA.AddCommand("edit", "notepad.exe %1");
FA.AddCommand("Generate x86", "\"" + Assembly.GetExecutingAssembly().Location + "\" \" %1\" X86 RELEASE");
FA.AddCommand("Generate x86 [DEBUG]", "\"" + Assembly.GetExecutingAssembly().Location + "\" \" %1\" X86 DEBUG");
FA.IconPath = Assembly.GetExecutingAssembly().Location;
FA.IconIndex = 0;
FA.Create();
}
internal static void RemoveFileAssociation()
{
FileAssociation FA = new FileAssociation();
FA.Extension = "sgpd";
FA.ContentType = "application/sysgenproject";
FA.FullName = "SysGenProject";
FA.ProperName = "SysGenProject";
FA.AddCommand("open", Assembly.GetExecutingAssembly().Location + " %1");
FA.AddCommand("edit", "notepad.exe %1");
FA.AddCommand("edit123", "notepad.exe %1");
FA.IconPath = Assembly.GetExecutingAssembly().Location;
FA.IconIndex = 0;
FA.Remove();
}
}
}
@@ -0,0 +1,267 @@
using System;
using System.Collections.Specialized;
using System.Collections.Generic;
using System.Xml;
using System.Collections;
using System.IO;
using System.Text;
using SysGen.RBuild.Framework;
namespace TriStateTreeViewDemo
{
public enum TargetArchitectureType
{
X86,
X86_i486,
X86_i586,
X86_Pentium,
X86_Pentium2,
X86_Pentium3,
X86_Pentium4,
X86_AthlonXP,
X86_AthlonMP,
X86_Xbox,
PPC,
ARM
}
public enum OptimizeLevelType : int
{
Level_0 = 0,
Level_1 = 1,
Level_2 = 2,
Level_3 = 3,
Level_4 = 4,
Level_5 = 5
}
public class Project : RBuildPlatform
{
RBuildProject m_Project = null;
string m_FilePath; // full path to this project, including filename
string m_FileName = "Unnamed";
//MovieOptions movieOptions;
//CompilerOptions compilerOptions;
//PathCollection classpaths;
//PathCollection compileTargets;
//HiddenPathCollection hiddenPaths;
//AssetCollection libraryAssets;
bool traceEnabled; // selected configuration
public bool NoOutput; // Disable file building
public string InputPath; // For code injection
public string OutputPath;
public string PreBuildEvent;
public string PostBuildEvent;
public string TestMovieCommand;
public bool AlwaysRunPostBuild;
public bool ShowHiddenPaths;
public string Source;
public Project(RBuildProject project,string path)
{
m_FilePath = path;
m_FileName = Path.GetFileName(path);
m_Project = project;
m_Project.Platform = this;
}
public Project(RBuildProject project)
{
m_Project = project;
m_Project.Platform = this;
}
public RBuildProject RBuildProject
{
get { return m_Project; }
}
public virtual bool UsesInjection { get { return false; } }
public virtual bool HasLibraries { get { return false; } }
public virtual void ValidateBuild(out string error) { error = null; }
#region Simple Properties
public string ProjectPath { get { return m_FilePath; } set { m_FilePath = value; } }
//public string Name { get { return Path.GetFileNameWithoutExtension(path).Replace(' ', '-'); } }
public string Directory { get { return Path.GetDirectoryName(m_FilePath); } }
public Boolean TraceEnabled { set { traceEnabled = value; } get { return traceEnabled; } }
public string FileName
{
get { return m_FileName; }
}
//// we only provide getters for these to preserve the original pointer
//public MovieOptions MovieOptions { get { return movieOptions; } }
//public PathCollection Classpaths { get { return classpaths; } }
//public PathCollection CompileTargets { get { return compileTargets; } }
//public HiddenPathCollection HiddenPaths { get { return hiddenPaths; } }
//public AssetCollection LibraryAssets { get { return libraryAssets; } }
//public CompilerOptions CompilerOptions
//{
// get { return compilerOptions; }
// set { compilerOptions = value; }
//}
//public PathCollection AbsoluteClasspaths
//{
// get
// {
// PathCollection absolute = new PathCollection();
// foreach (string cp in classpaths)
// absolute.Add(GetAbsolutePath(cp));
// return absolute;
// }
//}
//public string OutputPathAbsolute { get { return GetAbsolutePath(OutputPath); } }
public bool CanBuild
{
get { return OutputPath != null && OutputPath.Length > 0; }
}
#endregion
#region Methods
// all the Set/Is methods expect absolute paths (as opposed to the way they're
// actually stored)
//public void SetPathHidden(string path, bool isHidden)
//{
// path = GetRelativePath(path);
// if (isHidden)
// {
// hiddenPaths.Add(path);
// compileTargets.RemoveAtOrBelow(path); // can't compile hidden files
// libraryAssets.RemoveAtOrBelow(path); // can't embed hidden resources
// }
// else hiddenPaths.Remove(path);
//}
//public bool IsPathHidden(string path)
//{
// return hiddenPaths.IsHidden(GetRelativePath(path));
//}
public void SetCompileTarget(string path, bool isCompileTarget)
{
//if (isCompileTarget)
// compileTargets.Add(GetRelativePath(path));
//else
// compileTargets.Remove(GetRelativePath(path));
}
//public bool IsCompileTarget(string path) { return compileTargets.Contains(GetRelativePath(path)); }
public void SetLibraryAsset(string path, bool isLibraryAsset)
{
//if (isLibraryAsset)
// libraryAssets.Add(GetRelativePath(path));
//else
// libraryAssets.Remove(GetRelativePath(path));
}
//public bool IsLibraryAsset(string path) { return libraryAssets.Contains(GetRelativePath(path)); }
// public LibraryAsset GetAsset(string path) { return libraryAssets[GetRelativePath(path)]; }
public void ChangeAssetPath(string fromPath, string toPath)
{
//if (IsLibraryAsset(fromPath))
//{
// //LibraryAsset asset = libraryAssets[GetRelativePath(fromPath)];
// //libraryAssets.Remove(asset);
// //asset.Path = GetRelativePath(toPath);
// //libraryAssets.Add(asset);
//}
}
//public bool IsInput(string path) { return GetRelativePath(path) == InputPath; }
//public bool IsOutput(string path) { return GetRelativePath(path) == OutputPath; }
/// <summary>
/// Call this when you delete a path so we can remove all our references to it
/// </summary>
public void NotifyPathsDeleted(string path)
{
//path = GetRelativePath(path);
//hiddenPaths.Remove(path);
//compileTargets.RemoveAtOrBelow(path);
//libraryAssets.RemoveAtOrBelow(path);
}
/// <summary>
/// Returns the path to the "obj\" subdirectory, creating it if necessary.
/// </summary>
public string GetObjDirectory()
{
string objPath = Path.Combine(this.Directory, "obj");
if (!System.IO.Directory.Exists(objPath))
System.IO.Directory.CreateDirectory(objPath);
return objPath;
}
#endregion
#region Relative Path Helpers
//public string GetRelativePath(string path)
//{
// return ProjectPaths.GetRelativePath(this.Directory,path);
//}
//public string GetAbsolutePath(string path)
//{
// return ProjectPaths.GetAbsolutePath(this.Directory,path);
//}
#endregion
public Project Load()
{
ProjectReader reader = new ProjectReader(this, ProjectPath);
try
{
return reader.ReadProject();
}
catch (XmlException exception)
{
string format = string.Format("Error in Project '{0}' line {1}, position {2}.",
ProjectPath,
exception.LineNumber,
exception.LinePosition);
throw new Exception(format, exception);
}
finally
{
reader.Close();
}
}
public void Save()
{
ProjectWriter writer = new ProjectWriter(this, ProjectPath);
try
{
writer.WriteProject();
writer.Flush();
}
finally
{
writer.Close();
}
}
}
}
@@ -0,0 +1,319 @@
using System;
using System.Windows.Forms;
using System.Collections;
using System.Diagnostics;
using System.Text;
using System.Xml;
using System.Collections.Generic;
using SysGen.RBuild.Framework;
namespace TriStateTreeViewDemo
{
public class ProjectReader : XmlTextReader
{
Project project;
public ProjectReader(Project project, string filename)
: base(filename)
{
this.project = project;
WhitespaceHandling = WhitespaceHandling.None;
}
protected Project Project { get { return project; } }
public virtual Project ReadProject()
{
MoveToContent();
while (Read())
ProcessNode(Name);
return project;
}
private void ReadModules()
{
RBuildModule module = null;
ReadStartElement("modules");
while (Name == "module")
{
try
{
module = project.RBuildProject.Modules.GetByName(GetAttribute("name"));
if (module == null)
throw new Exception("Unkown module '" + Value + "'");
project.Modules.Add(module);
//project.SysGenDesinger.PlatformController.Project.Platform.Modules.Add(module);
}
catch (Exception e)
{
MessageBox.Show(
e.Message,
"Error",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
//project.Modules.Add(GetAttribute("name"));
// continue reading
Read();
}
ReadEndElement();
}
private void ReadLanguages()
{
RBuildLanguage language = null;
ReadStartElement("languages");
while (Name == "language")
{
try
{
language = project.RBuildProject.Languages.GetByName(GetAttribute("name"));
if (language == null)
throw new Exception("Unkown language '" + Value + "'");
project.Languages.Add(language);
}
catch (Exception e)
{
MessageBox.Show(e.Message,
"Error",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
// continue reading
Read();
}
ReadEndElement();
}
//private void ReadRSLPaths()
//{
// //project.CompilerOptions.RSLPaths = ReadLibrary("rslPaths");
//}
//private void ReadExternalLibraryPaths()
//{
// //project.CompilerOptions.ExternalLibraryPaths = ReadLibrary("externalLibraryPaths");
//}
//private void ReadLibrayPath()
//{
// //project.CompilerOptions.LibraryPaths = ReadLibrary("libraryPaths");
//}
//private void ReadIncludeLibraries()
//{
// //project.CompilerOptions.IncludeLibraries = ReadLibrary("includeLibraries");
//}
//private string[] ReadLibrary(string name)
//{
// ReadStartElement(name);
// List<string> elements = new List<string>();
// while (Name == "element")
// {
// elements.Add(GetAttribute("path"));
// Read();
// }
// ReadEndElement();
// string[] result = new string[elements.Count];
// elements.CopyTo(result);
// return result;
//}
public void ReadApplications()
{
ReadStartElement("applications");
while (Name == "option")
{
MoveToFirstAttribute();
switch (Name)
{
case "shell":
project.Shell = Project.RBuildProject.Modules.GetByName(Value);
break;
case "screensaver":
project.Screensaver = Project.RBuildProject.Modules.GetByName(Value);
break;
case "wallpaper":
//project.Wallpaper = Value;
break;
}
Read();
}
ReadEndElement();
}
//protected virtual void ProcessNode(string name)
//{
// switch (name)
// {
// case "output": ReadOutputOptions(); break;
// // case "classpaths": ReadClasspaths(); break;
// // case "compileTargets": ReadCompileTargets(); break;
// // case "hiddenPaths": ReadHiddenPaths(); break;
// // case "preBuildCommand": ReadPreBuildCommand(); break;
// // case "postBuildCommand": ReadPostBuildCommand(); break;
// // case "options": ReadProjectOptions(); break;
// }
//}
// process AS3-specific stuff
protected virtual void ProcessNode(string name)
{
if (NodeType == XmlNodeType.Element)
{
switch (name)
{
//case "build": ReadBuildOptions(); break;
//case "includeLibraries": ReadIncludeLibraries(); break;
//case "libraryPaths": ReadLibrayPath(); break;
//case "externalLibraryPaths": ReadExternalLibraryPaths(); break;
case "modules":
ReadModules();
break;
case "languages":
ReadLanguages();
break;
case "applications":
ReadApplications();
break;
case "output":
ReadOutputOptions();
break;
case "options":
ReadProjectOptions();
break;
//default:
// base.ProcessNode(name); break;
}
}
}
public void ReadOutputOptions()
{
ReadStartElement("output");
while (Name == "movie")
{
MoveToFirstAttribute();
switch (Name)
{
case "name":
project.Name = Value;
break;
case "desc":
project.Description = Value;
break;
//case "path": project.OutputPath = OSPath(Value); break;
//case "fps": project.MovieOptions.Fps = IntValue; break;
//case "width": project.MovieOptions.Width = IntValue; break;
//case "height": project.MovieOptions.Height = IntValue; break;
//case "version": project.MovieOptions.Version = IntValue; break;
//case "background": project.MovieOptions.Background = Value; break;
}
Read();
}
ReadEndElement();
}
//public void ReadClasspaths()
//{
// ReadStartElement("classpaths");
// //ReadPaths("class",project.Classpaths);
// ReadEndElement();
//}
//public void ReadCompileTargets()
//{
// ReadStartElement("compileTargets");
// //ReadPaths("compile",project.CompileTargets);
// ReadEndElement();
//}
//public void ReadHiddenPaths()
//{
// ReadStartElement("hiddenPaths");
// //ReadPaths("hidden",project.HiddenPaths);
// ReadEndElement();
//}
//public void ReadPreBuildCommand()
//{
// if (!IsEmptyElement)
// {
// ReadStartElement("preBuildCommand");
// project.PreBuildEvent = OSPath(ReadString().Trim());
// ReadEndElement();
// }
//}
public void ReadPostBuildCommand()
{
//project.AlwaysRunPostBuild = Convert.ToBoolean(GetAttribute("alwaysRun"));
//if (!IsEmptyElement)
//{
// ReadStartElement("postBuildCommand");
// project.PostBuildEvent = OSPath(ReadString().Trim());
// ReadEndElement();
//}
}
public void ReadProjectOptions()
{
ReadStartElement("options");
while (Name == "option")
{
MoveToFirstAttribute();
switch (Name)
{
case "debug":
project.Debug = BoolValue;
break;
case "kdebug":
project.KDebug = BoolValue;
break;
case "source":
project.Source = Value;
break;
}
Read();
}
ReadEndElement();
}
public bool BoolValue { get { return Convert.ToBoolean(Value); } }
public int IntValue { get { return Convert.ToInt32(Value); } }
//public void ReadPaths(string pathNodeName, IAddPaths paths)
//{
// while (Name == pathNodeName)
// {
// paths.Add(OSPath(GetAttribute("path")));
// Read();
// }
//}
//protected string OSPath(string path)
//{
// if (path != null)
// return path.Replace('\\',System.IO.Path.DirectorySeparatorChar);
// else
// return null;
//}
}
}
@@ -0,0 +1,170 @@
using System;
using System.Collections;
using System.IO;
using System.Diagnostics;
using System.Text;
using System.Xml;
using SysGen.RBuild.Framework;
using SysGen.BuildEngine;
using SysGen.BuildEngine.Framework;
namespace TriStateTreeViewDemo
{
public class ProjectWriter : XmlTextWriter
{
Project m_Project;
public ProjectWriter(Project project, string filename) : base(filename,Encoding.UTF8)
{
m_Project = project;
Formatting = Formatting.Indented;
}
protected Project Project { get { return m_Project; } }
public void WriteProject()
{
WriteStartDocument();
WriteStartElement("project");
WriteOutputOptions();
WriteBuildOptions();
WriteProjectOptions();
WriteEndElement();
WriteEndDocument();
}
public void WriteOutputOptions()
{
WriteComment(" Output SWF options ");
WriteStartElement("output");
WriteOption("movie", "name", m_Project.Name);
WriteOption("movie", "desc", m_Project.Description);
WriteEndElement();
}
public void WriteBuildOptions()
{
WriteComment(" Build options ");
WriteStartElement("build");
if (Project.Modules.Count > 0)
{
WriteStartElement("modules");
foreach (RBuildModule module in Project.Modules)
{
WriteStartElement("module");
WriteAttributeString("name", module.Name);
WriteEndElement();
}
WriteEndElement();
}
WriteEndElement();
if (Project.Languages.Count > 0)
{
WriteComment(" Build options ");
WriteStartElement("languages");
foreach (RBuildLanguage language in Project.Languages)
{
WriteStartElement("language");
WriteAttributeString("name", language.Name);
WriteEndElement();
}
WriteEndElement();
}
if (Project.DebugChannels.Count > 0)
{
WriteStartElement("debugchhanels");
foreach (RBuildDebugChannel channel in Project.DebugChannels)
{
WriteStartElement("debugchannel");
WriteAttributeString("name", channel.Name);
WriteEndElement();
}
WriteEndElement();
}
WriteStartElement("applications");
if (m_Project.Shell != null)
WriteOption("Shell", m_Project.Shell.Name);
if (m_Project.Screensaver != null)
WriteOption("Screensaver", m_Project.Screensaver.Name);
if (m_Project.Wallpaper != null)
WriteOption("Wallpaper", m_Project.Wallpaper.Name);
WriteEndElement();
}
public void WriteClasspaths()
{
WriteComment(" Other classes to be compiled into your SWF ");
WriteStartElement("classpaths");
//WritePaths(project.Classpaths,"class");
WriteEndElement();
}
public void WriteCompileTargets()
{
WriteComment(" Class files to compile (other referenced classes will automatically be included) ");
WriteStartElement("compileTargets");
//WritePaths(project.CompileTargets,"compile");
WriteEndElement();
}
public void WriteHiddenPaths()
{
WriteComment(" Paths to exclude from the Project Explorer tree ");
WriteStartElement("hiddenPaths");
//WritePaths(project.HiddenPaths,"hidden");
WriteEndElement();
}
public void WritePreBuildCommand()
{
WriteComment(" Executed before build ");
WriteStartElement("preBuildCommand");
if (m_Project.PreBuildEvent.Length > 0)
WriteString(m_Project.PreBuildEvent);
WriteEndElement();
}
public void WritePostBuildCommand()
{
WriteComment(" Executed after build ");
WriteStartElement("postBuildCommand");
WriteAttributeString("alwaysRun",m_Project.AlwaysRunPostBuild.ToString());
if (m_Project.PostBuildEvent.Length > 0)
WriteString(m_Project.PostBuildEvent);
WriteEndElement();
}
public void WriteProjectOptions()
{
WriteComment(" Other project options ");
WriteStartElement("options");
WriteOption("debug",m_Project.Debug);
WriteOption("kdebug",m_Project.KDebug);
WriteOption("source", @"c:\ros\trunk\reactos" /*project.Source*/);
WriteEndElement();
}
public void WriteOption(string optionName, object optionValue)
{
WriteOption("option", optionName, optionValue);
}
public void WriteOption(string nodeName, string optionName, object optionValue)
{
WriteStartElement(nodeName);
WriteAttributeString(optionName, optionValue.ToString());
WriteEndElement();
}
}
}
@@ -0,0 +1,222 @@
using System;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Text;
using SysGen.RBuild.Framework;
using SysGen.BuildEngine;
using SysGen.BuildEngine.Tasks;
using SysGen.Framework.Catalog;
namespace TriStateTreeViewDemo
{
public class ProjectController
{
private ISysGenDesigner m_SysGenDesigner = null;
private RBuildProject m_Project = null;
public event EventHandler PlatformModulesUpdated;
public event EventHandler ProjectLoaded;
public event EventHandler ProjectSaved;
public event EventHandler ProjectUpdated;
public ProjectController(ISysGenDesigner engine)
{
m_SysGenDesigner = engine;
PlatformCatalogReader m_Catalog = new PlatformCatalogReader(@"C:\Ros\trunk\reactos\rbuilddb.xml");
m_Catalog.Read();
m_Project = m_Catalog.Project;
New();
}
public void New()
{
m_Project.Platform = new Project(m_Project);
if (ProjectLoaded != null)
ProjectLoaded(this, EventArgs.Empty);
if (PlatformModulesUpdated != null)
PlatformModulesUpdated(this, EventArgs.Empty);
}
public void Open(string file)
{
SysGenProject = new Project(m_Project, file);
SysGenProject.Load();
if (ProjectLoaded != null)
ProjectLoaded(this, EventArgs.Empty);
if (PlatformModulesUpdated != null)
PlatformModulesUpdated(this, EventArgs.Empty);
}
public void Open()
{
using (OpenFileDialog openFile = new OpenFileDialog())
{
openFile.Title = "Open SysGen Designer Project File";
//openFile.InitialDirectory = m_SysGenEngine.BaseDirectory;
openFile.Filter = "SysGen Project File|*.sgpd";
if (openFile.ShowDialog() == DialogResult.OK)
{
SysGenProject = new Project(m_Project, openFile.FileName);
SysGenProject.Load();
if (ProjectLoaded != null)
ProjectLoaded(this, EventArgs.Empty);
if (PlatformModulesUpdated != null)
PlatformModulesUpdated(this, EventArgs.Empty);
}
}
}
public void Save()
{
using (SaveFileDialog saveFile = new SaveFileDialog())
{
saveFile.Title = "Save SysGen Designer Project File";
//saveFile.InitialDirectory = m_SysGenEngine.BaseDirectory;
saveFile.Filter = "SysGen Project File|*.sgpd";
if (saveFile.ShowDialog() == DialogResult.OK)
{
SysGenProject.ProjectPath = saveFile.FileName;
SysGenProject.Save();
if (PlatformModulesUpdated != null)
PlatformModulesUpdated(this, EventArgs.Empty);
if (ProjectSaved != null)
ProjectSaved(this, EventArgs.Empty);
}
}
}
public RBuildModuleCollection AvailableModules
{
get { return m_Project.Modules; }
}
public RBuildProject Project
{
get { return m_Project; }
}
public Project SysGenProject
{
get { return Project.Platform as Project; }
set { Project.Platform = value; }
}
public void Remove(RBuildModule module)
{
SysGenDependencyTracker dependencyTracker = new SysGenDependencyTracker(Project, module);
if (dependencyTracker.Using.Count > 0)
{
string s = string.Format("Cannot remove module '{0}' because '{1}' modules depends on it",
module.Name,
dependencyTracker.Using.Count);
MessageBox.Show(s, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
{
Project.Platform.Modules.Remove(module);
}
if (PlatformModulesUpdated != null)
PlatformModulesUpdated(this, EventArgs.Empty);
}
public void Add(RBuildModule module)
{
SysGenDependencyTracker dependencyTracker = new SysGenDependencyTracker(Project , module);
if (AskAddModulesToPlatform(dependencyTracker.Missing))
{
Project.Platform.Modules.Add(dependencyTracker.DependsOn);
Project.Platform.Modules.Add(module);
}
if (PlatformModulesUpdated != null)
PlatformModulesUpdated(this, EventArgs.Empty);
}
public void Add(RBuildModuleCollection modules)
{
SysGenDependencyTracker dependencyTracker = new SysGenDependencyTracker(Project, modules);
if (AskAddModulesToPlatform(dependencyTracker.Missing))
{
Project.Platform.Modules.Add(dependencyTracker.DependsOn);
Project.Platform.Modules.Add(modules);
}
if (PlatformModulesUpdated != null)
PlatformModulesUpdated(this, EventArgs.Empty);
}
public void AddLanguage(RBuildLanguage language)
{
if (Project.Platform.Languages.Contains(language) == false)
Project.Platform.Languages.Add(language);
if (PlatformModulesUpdated != null)
PlatformModulesUpdated(this, EventArgs.Empty);
if (ProjectUpdated != null)
ProjectUpdated(this, EventArgs.Empty);
}
public void AddDebugChannel(RBuildDebugChannel channel)
{
if (Project.Platform.DebugChannels.Contains(channel) == false)
Project.Platform.DebugChannels.Add(channel);
if (PlatformModulesUpdated != null)
PlatformModulesUpdated(this, EventArgs.Empty);
if (ProjectUpdated != null)
ProjectUpdated(this, EventArgs.Empty);
}
public bool AskAddModulesToPlatform(RBuildModuleCollection missingDependencies)
{
if (missingDependencies.Count > 0)
{
StringBuilder str = new StringBuilder();
str.AppendFormat("This action requieres adding {0} dependecies no present in your platform :", missingDependencies.Count);
str.AppendLine();
str.AppendLine();
foreach (RBuildModule dependency in missingDependencies)
{
str.AppendFormat("{0} on '{1}' \n",
dependency.Name,
dependency.Base);
}
str.AppendLine();
str.AppendLine("¿Do you want to add this dependencies?");
if (MessageBox.Show(str.ToString(), "RosBuilder", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
{
return true;
}
}
else
return true;
return false;
}
}
}
@@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("RosBuilder")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Sand")]
[assembly: AssemblyProduct("RosBuilder")]
[assembly: AssemblyCopyright("Copyright © Sand 2007")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("8f4d0b84-8882-4b89-8e3c-8ce5238d603f")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4927
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace RosBuilder.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RosBuilder.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
@@ -0,0 +1,117 @@
<?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.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: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" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</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" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</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>
@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4927
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace RosBuilder.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}
@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
@@ -0,0 +1,148 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{78A0F196-A5BD-469A-B901-B269671AFB0A}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RosBuilder</RootNamespace>
<AssemblyName>RosBuilder</AssemblyName>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>2.0</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Controls\NewItemListView.cs" />
<Compile Include="Controls\PlatformTreeView.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\ModuleFiltersListView.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\ProjectTreeView.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\RegistryEditor.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\RegistryEditor.Designer.cs">
<DependentUpon>RegistryEditor.cs</DependentUpon>
</Compile>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="ModuleFilter.cs" />
<Compile Include="NewItemForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="NewItemForm.Designer.cs">
<DependentUpon>NewItemForm.cs</DependentUpon>
</Compile>
<Compile Include="PlatformCatalogReader.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="ProjectController.cs" />
<Compile Include="Inspectors\PlatformInspector.cs" />
<Compile Include="Program.cs" />
<Compile Include="Project\Project.cs" />
<Compile Include="Project\ProjectReader.cs" />
<Compile Include="Project\ProjectWriter.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Controls\RegistryEditor.resx">
<SubType>Designer</SubType>
<DependentUpon>RegistryEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form1.resx">
<SubType>Designer</SubType>
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MainForm.resx">
<SubType>Designer</SubType>
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="NewItemForm.resx">
<SubType>Designer</SubType>
<DependentUpon>NewItemForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="Util\FileAssociation.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RosFramework\SysGen.RBuild.Framework.csproj">
<Project>{88D9BED7-30C5-4683-A6C6-6F2EB55B8F26}</Project>
<Name>SysGen.RBuild.Framework</Name>
</ProjectReference>
<ProjectReference Include="..\SysGen.BuildEngine\SysGen.Framework.csproj">
<Project>{8F5F8375-4097-4952-B860-784EB9961ABE}</Project>
<Name>SysGen.Framework</Name>
</ProjectReference>
<ProjectReference Include="..\TriStateTreeView\TriStateTreeView.csproj">
<Project>{99CEE41D-B76D-4102-B0AD-C81069509D17}</Project>
<Name>TriStateTreeView</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -0,0 +1,5 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
</Project>
@@ -0,0 +1,244 @@
using System;
using System.Security;
using System.Collections;
using Microsoft.Win32;
namespace TriStateTreeViewDemo
{
/// <summary>List of commands.</summary>
internal struct CommandList
{
/// <summary>
/// Holds the names of the commands.
/// </summary>
public ArrayList Captions;
/// <summary>
/// Holds the commands.
/// </summary>
public ArrayList Commands;
}
/// <summary>Properties of the file association.</summary>
internal struct FileType
{
/// <summary>
/// Holds the command names and the commands.
/// </summary>
public CommandList Commands;
/// <summary>
/// Holds the extension of the file type.
/// </summary>
public string Extension;
/// <summary>
/// Holds the proper name of the file type.
/// </summary>
public string ProperName;
/// <summary>
/// Holds the full name of the file type.
/// </summary>
public string FullName;
/// <summary>
/// Holds the name of the content type of the file type.
/// </summary>
public string ContentType;
/// <summary>
/// Holds the path to the resource with the icon of this file type.
/// </summary>
public string IconPath;
/// <summary>
/// Holds the icon index in the resource file.
/// </summary>
public short IconIndex;
}
/// <summary>Creates file associations for your programs.</summary>
/// <example>The following example creates a file association for the type XYZ with a non-existent program.
/// <br></br><br>VB.NET code</br>
/// <code>
/// Dim FA as New FileAssociation
/// FA.Extension = "xyz"
/// FA.ContentType = "application/myprogram"
/// FA.FullName = "My XYZ Files!"
/// FA.ProperName = "XYZ File"
/// FA.AddCommand("open", "C:\mydir\myprog.exe %1")
/// FA.Create
/// </code>
/// <br>C# code</br>
/// <code>
/// FileAssociation FA = new FileAssociation();
/// FA.Extension = "xyz";
/// FA.ContentType = "application/myprogram";
/// FA.FullName = "My XYZ Files!";
/// FA.ProperName = "XYZ File";
/// FA.AddCommand("open", "C:\\mydir\\myprog.exe %1");
/// FA.Create();
/// </code>
/// </example>
public class FileAssociation
{
/// <summary>Initializes an instance of the FileAssociation class.</summary>
public FileAssociation()
{
FileInfo = new FileType();
FileInfo.Commands.Captions = new ArrayList();
FileInfo.Commands.Commands = new ArrayList();
}
/// <summary>Gets or sets the proper name of the file type.</summary>
/// <value>A String representing the proper name of the file type.</value>
public string ProperName
{
get
{
return FileInfo.ProperName;
}
set
{
FileInfo.ProperName = value;
}
}
/// <summary>Gets or sets the full name of the file type.</summary>
/// <value>A String representing the full name of the file type.</value>
public string FullName
{
get
{
return FileInfo.FullName;
}
set
{
FileInfo.FullName = value;
}
}
/// <summary>Gets or sets the content type of the file type.</summary>
/// <value>A String representing the content type of the file type.</value>
public string ContentType
{
get
{
return FileInfo.ContentType;
}
set
{
FileInfo.ContentType = value;
}
}
/// <summary>Gets or sets the extension of the file type.</summary>
/// <value>A String representing the extension of the file type.</value>
/// <remarks>If the extension doesn't start with a dot ("."), a dot is automatically added.</remarks>
public string Extension
{
get
{
return FileInfo.Extension;
}
set
{
if (value.Substring(0, 1) != ".")
value = "." + value;
FileInfo.Extension = value;
}
}
/// <summary>Gets or sets the index of the icon of the file type.</summary>
/// <value>A short representing the index of the icon of the file type.</value>
public short IconIndex
{
get
{
return FileInfo.IconIndex;
}
set
{
FileInfo.IconIndex = value;
}
}
/// <summary>Gets or sets the path of the resource that contains the icon for the file type.</summary>
/// <value>A String representing the path of the resource that contains the icon for the file type.</value>
/// <remarks>This resource can be an executable or a DLL.</remarks>
public string IconPath
{
get
{
return FileInfo.IconPath;
}
set
{
FileInfo.IconPath = value;
}
}
/// <summary>Adds a new command to the command list.</summary>
/// <param name="Caption">The name of the command.</param>
/// <param name="Command">The command to execute.</param>
/// <exceptions cref="ArgumentNullException">Caption -or- Command is null (VB.NET: Nothing).</exceptions>
public void AddCommand(string Caption, string Command)
{
if (Caption == null || Command == null)
throw new ArgumentNullException();
FileInfo.Commands.Captions.Add(Caption);
FileInfo.Commands.Commands.Add(Command);
}
/// <summary>Creates the file association.</summary>
/// <exceptions cref="ArgumentNullException">Extension -or- ProperName is null (VB.NET: Nothing).</exceptions>
/// <exceptions cref="ArgumentException">Extension -or- ProperName is empty.</exceptions>
/// <exceptions cref="SecurityException">The user does not have registry write access.</exceptions>
public void Create()
{
// remove the extension to avoid incompatibilities [such as DDE links]
try
{
Remove();
}
catch (ArgumentException) {} // the extension doesn't exist
// create the exception
if (Extension == "" || ProperName == "")
throw new ArgumentException();
int cnt;
try
{
RegistryKey RegKey = Registry.ClassesRoot.CreateSubKey(Extension);
RegKey.SetValue("", ProperName);
if (ContentType != null && ContentType != "")
RegKey.SetValue("Content Type", ContentType);
RegKey.Close();
RegKey = Registry.ClassesRoot.CreateSubKey(ProperName);
RegKey.SetValue("", FullName);
RegKey.Close();
if (IconPath != "")
{
RegKey = Registry.ClassesRoot.CreateSubKey(ProperName + "\\" + "DefaultIcon");
RegKey.SetValue("", IconPath + "," + IconIndex.ToString());
RegKey.Close();
}
for (cnt = 0; cnt < FileInfo.Commands.Captions.Count; cnt++)
{
RegKey = Registry.ClassesRoot.CreateSubKey(ProperName + "\\" + "Shell" + "\\" + (String)FileInfo.Commands.Captions[cnt]);
RegKey = RegKey.CreateSubKey("Command");
RegKey.SetValue("", FileInfo.Commands.Commands[cnt]);
RegKey.Close();
}
}
catch
{
throw new SecurityException();
}
}
/// <summary>Removes the file association.</summary>
/// <exceptions cref="ArgumentNullException">Extension -or- ProperName is null (VB.NET: Nothing).</exceptions>
/// <exceptions cref="ArgumentException">Extension -or- ProperName is empty -or- the specified extension doesn't exist.</exceptions>
/// <exceptions cref="SecurityException">The user does not have registry delete access.</exceptions>
public void Remove()
{
if (Extension == null || ProperName == null)
throw new ArgumentNullException();
if (Extension == "" || ProperName == "")
throw new ArgumentException();
Registry.ClassesRoot.DeleteSubKeyTree(Extension);
Registry.ClassesRoot.DeleteSubKeyTree(ProperName);
}
/// <summary>Holds the properties of the file type.</summary>
private FileType FileInfo;
}
}
@@ -0,0 +1,311 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
public abstract class RBuildElement : IRBuildNamed
{
protected string m_RBuild = null;
protected string m_Name = null;
protected string m_Base = null;
protected string m_Path = null;
protected string m_XmlFile = null;
protected List<string> m_AssemblyFlags = new List<string>();
protected List<string> m_CompilerFlags = new List<string>();
protected List<string> m_LinkerFlags = new List<string>();
protected RBuildIncludeFolderCollection m_Includes = new RBuildIncludeFolderCollection();
protected RBuildPlatformFileCollection m_Files = new RBuildPlatformFileCollection();
protected RBuildDefineCollection m_Defines = new RBuildDefineCollection();
protected RBuildPropertyCollection m_Properties = new RBuildPropertyCollection();
protected RBuildFolderCollection m_Folders = new RBuildFolderCollection();
protected RBuildFolder m_Folder = new RBuildFolder();
public string Name
{
get { return m_Name; }
set { m_Name = value; }
}
public virtual RBuildFolder Folder
{
get { return m_Folder; }
set { m_Folder = value; }
}
public string XmlFile
{
get { return m_XmlFile; }
set { m_XmlFile = value; }
}
public string Path
{
get { return m_Path; }
set { m_Path = value; }
}
public string Base
{
get { return Folder.FullPath; }
}
public string RBuildPath
{
get { return System.IO.Path.Combine(Base, RBuildFile); }
}
public string RBuildFile
{
get { return m_RBuild; }
set { m_RBuild = value; }
}
public Uri BaseURI
{
get { return new Uri(Base, UriKind.Relative); }
}
public string BaseParent
{
get { return Base.Replace(System.IO.Path.DirectorySeparatorChar + Name , string.Empty); }
}
public string FolderFullPath
{
get { return System.IO.Path.Combine(Path, Base); }
}
public RBuildFolderCollection Folders
{
get { return m_Folders; }
}
public RBuildPlatformFileCollection Files
{
get { return m_Files; }
}
public RBuildPropertyCollection Properties
{
get { return m_Properties; }
}
public List<string> CompilerFlags
{
get { return m_CompilerFlags; }
}
public List<string> LinkerFlags
{
get { return m_LinkerFlags; }
}
public List<string> AssemblyFlags
{
get { return m_AssemblyFlags; }
}
public RBuildDefineCollection Defines
{
get { return m_Defines; }
}
public RBuildIncludeFolderCollection IncludeFolders
{
get { return m_Includes; }
set { m_Includes = value; }
}
public string MakeFilePreCondition
{
get { return string.Format("{0}_PRECONDITION", Name); }
}
public string MakeFileRCFlags
{
get { return string.Format("{0}_RCFLAGS", Name); }
}
public string MakeFileWIDLFlags
{
get { return string.Format("{0}_WIDLFLAGS", Name); }
}
public string MakeFileLFlags
{
get { return string.Format("{0}_LFLAGS", Name); }
}
public string MakeFileNASMFlags
{
get { return string.Format("{0}_NASMFLAGS", Name); }
}
public string MakeFileFoldersMacro
{
get { return string.Format("$({0}_FOLDERS)", Name); }
}
public string MakeFileFolders
{
get { return string.Format("{0}_FOLDERS", Name); }
}
public string MakeFileCFlags
{
get { return string.Format("{0}_CFLAGS", Name); }
}
public string MakeFileObjs
{
get { return string.Format("{0}_OBJS", Name); }
}
public string MakeFileSources
{
get { return string.Format("{0}_SOURCES", Name); }
}
public string MakeFileHeaders
{
get { return string.Format("{0}_HEADERS", Name); }
}
public string MakeFileMakeTarget
{
get { return string.Format("{0}", Name); }
}
public string MakeFileFlagDebugTarget
{
get { return string.Format("{0}_flagdebug", Name); }
}
public string MakeFileInfoTarget
{
get { return string.Format("{0}_info", Name); }
}
public string MakeFileCleanTarget
{
get { return string.Format("{0}_clean", Name); }
}
public string MakeFileDependsTarget
{
get { return string.Format("{0}_depends", Name); }
}
public string MakeFileInstallTarger
{
get { return string.Format("{0}_install", Name); }
}
public string MakeFileHeadersMacro
{
get { return string.Format("$({0}_HEADERS)", Name); }
}
public string MakeFileMCHeadersMacro
{
get { return string.Format("$({0}_MCHEADERS)", Name); }
}
public string MakeFileMCHeaders
{
get { return string.Format("{0}_MCHEADERS", Name); }
}
public string MakeFileRPCHeadersMacro
{
get { return string.Format("$({0}_RPCHEADERS)", Name); }
}
public string MakeFileRPCHeaders
{
get { return string.Format("{0}_RPCHEADERS", Name); }
}
public string MakeFileRPCSourcesMacro
{
get { return string.Format("$({0}_RPCSOURCES)", Name); }
}
public string MakeFileRPCSources
{
get { return string.Format("{0}_RPCSOURCES", Name); }
}
public string MakeFilePCHMacro
{
get { return string.Format("$({0}_PCH)", Name); }
}
public string MakeFilePCHHeaders
{
get { return string.Format("{0}_PCH", Name); }
}
public string MakeFileNASMMacro
{
get { return string.Format("$({0}_NASMFLAGS)", Name); }
}
public string MakeFileCFlagsMacro
{
get { return string.Format("$({0}_CFLAGS)", Name); }
}
public string MakeFileLFlagsMacro
{
get { return string.Format("$({0}_LFLAGS)", Name); }
}
public string MakeFileWIDLFlagsMacro
{
get { return string.Format("$({0}_WIDLFLAGS)", Name); }
}
public string MakeFileObjsMacro
{
get { return string.Format("$({0}_OBJS)", Name); }
}
public string MakeFileSourcesMacro
{
get { return string.Format("$({0}_SOURCES)", Name); }
}
public string MakeFilePreConditionMacro
{
get { return string.Format("$({0}_PRECONDITION)", Name); }
}
public string MakeFileRCFlagsMacro
{
get { return string.Format("$({0}_RCFLAGS)", Name); }
}
public abstract void SaveAs(string file);
public override bool Equals(object obj)
{
if (obj is RBuildElement)
{
RBuildElement element = obj as RBuildElement;
if (element.Name == Name)
return true;
}
return false;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
}
}
@@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
public class RBuildAPIStatusCollection : List<RBuildAPIInfo>
{
public int Percentage
{
get
{
if (TotalFunctions == 0)
return 100;
return ((100 * ImplementedFunctionsCount) / TotalFunctions);
}
}
public int TotalFunctions
{
get { return (ImplementedFunctionsCount + UnImplementedFunctionsCount); }
}
public int ImplementedFunctionsCount
{
get
{
int count = 0;
foreach (RBuildAPIInfo info in this)
if (info.Implemented == true)
count++;
return count;
}
}
public int UnImplementedFunctionsCount
{
get
{
int count = 0;
foreach (RBuildAPIInfo info in this)
if (info.Implemented == false)
count++;
return count;
}
}
}
}
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
public class RBuildAuthorCollection : List<RBuildAuthor>
{
public RBuildAuthor GetByName(string alias)
{
foreach (RBuildAuthor author in this)
{
if (author.Contributor.Alias == alias)
return author;
}
return null;
}
}
}
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
public class RBuildBuildFamilyCollection : List<RBuildBuildFamily>
{
public RBuildBuildFamily GetByName(string name)
{
foreach (RBuildBuildFamily family in this)
{
if (family.Name == name)
return family;
}
return null;
}
}
}
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
public class RBuildContributorCollection : List<RBuildContributor>
{
public RBuildContributor GetByName(string alias)
{
foreach (RBuildContributor contributor in this)
{
if (contributor.Alias == alias)
return contributor;
}
return null;
}
}
}
@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
public class RBuildDebugChannelCollection : List<RBuildDebugChannel>
{
public RBuildDebugChannel GetByName(string name)
{
foreach (RBuildDebugChannel channel in this)
{
if (channel.Name == name)
return channel;
}
return null;
}
public string Text
{
get
{
StringBuilder sBuilder = new StringBuilder();
foreach (RBuildDebugChannel channel in this)
{
sBuilder.Append(channel.Text);
}
return sBuilder.ToString();
}
}
}
}
@@ -0,0 +1,25 @@
using System;
using System.Collections;
using System.Collections.Generic;
namespace SysGen.RBuild.Framework
{
public class RBuildDefineCollection : List<RBuildDefine>
{
public bool IsDefined(string name)
{
foreach (RBuildDefine define in this)
{
if (define.Name == name)
return true;
}
return false;
}
public void Add(string name)
{
Add(new RBuildDefine(name));
}
}
}
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
public class RBuildExportedFunctionsCollection : List<RBuildExportFunction>
{
}
}
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
public class RBuildFamilyCollection : List<RBuildFamily>
{
}
}
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
public class RBuildFileCollection : List<RBuildFile>
{
public void Add(RBuildFileCollection files)
{
foreach (RBuildFile file in files)
{
Add(file);
}
}
}
}
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
public class RBuildFolderCollection : List<RBuildFolder>
{
public void Add(RBuildFolderCollection folders)
{
foreach (RBuildFolder folder in folders)
{
Add(folder);
}
}
}
}
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
public class RBuildIncludeFolderCollection : List<RBuildFolder>
{
}
}
@@ -0,0 +1,28 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
public class RBuildInstallFolderCollection : List<RBuildInstallFolder>
{
public RBuildInstallFolder GetByName(string name)
{
foreach (RBuildInstallFolder folder in this)
{
if (NormalizeFolderName(folder.Name) == NormalizeFolderName(name))
return folder;
}
return null;
}
private string NormalizeFolderName(string path)
{
return path.Replace(
Path.AltDirectorySeparatorChar,
Path.DirectorySeparatorChar);
}
}
}
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
public class RBuildLanguageCollection : List<RBuildLanguage>
{
public RBuildLanguage GetByName(string culture)
{
foreach (RBuildLanguage language in this)
{
if (language.Name == culture)
return language;
}
return null;
}
}
}
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
public class RBuildLocalizationFileCollection : List<RBuildLocalizationFile>
{
public bool ContainsLocalization(string culture)
{
return GetByName(culture) != null;
}
public RBuildLocalizationFile GetByName(string culture)
{
foreach (RBuildLocalizationFile file in this)
{
if (file.IsoName == culture)
return file;
}
return null;
}
}
}
@@ -0,0 +1,82 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
public class ModulePreferenceComparer : IComparer<RBuildModule>
{
public int Compare(RBuildModule x, RBuildModule y)
{
if (x.Type == y.Type)
return 0;
if (x.Type == ModuleType.BuildTool)
return -1;
return 1;
}
}
public class RBuildModuleCollection : List<RBuildModule>
{
public event EventHandler OnModuleAdded;
public void Add(RBuildModuleCollection modules)
{
foreach (RBuildModule module in modules)
{
Add(module);
}
}
public new void Add(RBuildModule module)
{
if (module == null)
throw new Exception("Could not add a null instance");
if (GetByName(module.Name) == null)
{
base.Add(module);
}
if (OnModuleAdded != null)
OnModuleAdded(this, EventArgs.Empty);
}
public void Add(string moduleName)
{
RBuildModule module = GetByName(moduleName);
if (module == null)
throw new Exception(string.Format("Unknown '{0}' module", moduleName));
Add(module);
}
public void Add(int index, RBuildModule moduleName)
{
base.Insert(index, moduleName);
}
public void DisableAll()
{
foreach (RBuildModule module in this)
{
// Disable module
module.Enabled = false;
}
}
public RBuildModule GetByName(string name)
{
foreach (RBuildModule module in this)
{
if (module.Name == name)
return module;
}
return null;
}
}
}
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
public class RBuildModuleInfoCollection : List<RBuildModuleInfo>
{
public RBuildModuleInfo GetByName(string name)
{
foreach (RBuildModuleInfo module in this)
{
if (module.Name == name)
return module;
}
return null;
}
}
}
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
public class RBuildPlatformFileCollection : List<RBuildOutputFile>
{
public void Add(RBuildPlatformFileCollection files)
{
foreach (RBuildPlatformFile file in files)
{
Add(file);
}
}
}
}
@@ -0,0 +1,108 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text.RegularExpressions;
namespace SysGen.RBuild.Framework
{
public class RBuildPropertyCollection : List<RBuildProperty>
{
/// <summary>
/// Adds a property that cannot be changed.
/// </summary>
/// <remarks>
/// Properties added with this method can never be changed. Note that
/// they are removed if the <c>Clear</c> method is called.
/// </remarks>
/// <param name="name">Name of property</param>
/// <param name="value">Value of property</param>
public virtual void AddReadOnly(string name, string value)
{
Add(name, value, true);
}
/// <summary>
/// Adds a property to the collection.
/// </summary>
/// <param name="name">Name of property</param>
/// <param name="value">Value of property</param>
public virtual void Add(string name, string value)
{
Add(name, value, false);
}
/// <summary>
/// Adds a property to the collection.
/// </summary>
/// <param name="name">Name of property</param>
/// <param name="value">Value of property</param>
public virtual void Add(string name, bool value)
{
Add(name, value.ToString());
}
/// <summary>
/// Adds a property to the collection.
/// </summary>
/// <param name="name">Name of property</param>
/// <param name="value">Value of property</param>
public virtual void Add(string name, string value, bool readOnly)
{
if (!PropertyExists(name))
{
Add(new RBuildProperty(name, value , readOnly));
}
}
/// <summary>
/// Adds a property to the collection.
/// </summary>
/// <param name="name">Name of property</param>
/// <param name="value">Value of property</param>
public virtual void Add(string name, string value, bool readOnly, bool isInternal)
{
if (!PropertyExists(name))
{
Add(new RBuildProperty(name, value, readOnly,isInternal));
}
}
/// <summary>
/// Returns true if a property is listed as read only
/// </summary>
/// <param name="name">Property to check</param>
/// <returns>true if readonly, false otherwise</returns>
public virtual bool IsReadOnlyProperty(string name)
{
if (PropertyExists(name))
return this[name].ReadOnly;
return false;
}
/// <summary>
/// Returns true if a property exists
/// </summary>
/// <param name="name">Property to check</param>
/// <returns>true if exists, false otherwise</returns>
public bool PropertyExists(string name)
{
return (this[name] != null);
}
/// <summary>
/// Indexer property.
/// </summary>
public virtual RBuildProperty this[string name]
{
get
{
foreach (RBuildProperty property in this)
if (property.Name == name)
return property;
return null;
}
}
}
}
@@ -0,0 +1,60 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
public class SourceCodePreferenceComparer : IComparer<RBuildSourceFile>
{
public int Compare(RBuildSourceFile x, RBuildSourceFile y)
{
if (x.First != y.First)
{
if (x.First)
return -1;
else
return 1;
}
if (x.Extension == y.Extension)
return 0;
if (x.IsWidl)
return -1;
else if (y.IsWidl)
return 1;
if (x.IsAssembler)
return 1;
else if (y.IsAssembler)
return -1;
if (x.IsNASM)
return 1;
else if (y.IsNASM)
return -1;
return 0;
}
}
public class RBuildSourceFileCollection : List<RBuildSourceFile>
{
public bool ContainsASM
{
get
{
foreach (RBuildSourceFile file in this)
{
if ((file.IsAssembler) || (file.IsNASM))
{
return true;
}
}
// This module does not contain C++ code
return false;
}
}
}
}
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
public interface IRBuildInstallable
{
string InstallBase { get; set; }
RBuildInstallFolder InstallFolder { get; set; }
}
}
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
namespace SysGen.RBuild.Framework
{
public interface IRBuildModulesContainer
{
RBuildSourceFileCollection Modules { get; }
}
}
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
namespace SysGen.RBuild.Framework
{
public interface IRBuildNamed
{
string Name { get; }
}
}
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
namespace SysGen.RBuild.Framework
{
public interface IRBuildSourceFilesContainer
{
RBuildSourceFileCollection SourceFiles { get; }
}
}
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
class Utility
{
public static string GetSafeString (string str)
{
str = str.Replace(" ", string.Empty);
str = str.Replace(".", string.Empty);
return str;
}
}
}
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework.NotImplementedYet
{
public class RBuildModuleGroup
{
private RBuildModuleCollection m_Modules = new RBuildModuleCollection();
private string m_Name = null;
public string Name
{
get { return m_Name; }
set { m_Name = value; }
}
public RBuildModuleCollection Modules
{
get { return m_Modules; }
}
}
}
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework.NotImplementedYet
{
public class RBuildPatch
{
private string m_Filename = null;
private string m_Name = null;
public string Name
{
get { return m_Name; }
set { m_Name = value; }
}
public string FileName
{
get { return m_Filename; }
set { m_Filename = value; }
}
}
}
@@ -0,0 +1,92 @@
using System;
using System.Xml;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
public class PlatformCatalog
{
public List<RosPlatform> m_Platform = new List<RosPlatform>();
public SoftwareCatalog m_SoftwareCatalog = new SoftwareCatalog();
public PlatformCatalog()
{
}
public List<RosPlatform> Platforms
{
get { return m_Platform; }
}
public SoftwareCatalog SoftwareCatalog
{
get { return m_SoftwareCatalog; }
set { m_SoftwareCatalog = value; }
}
public RosPlatform GetPlatformByName(string name)
{
foreach (RosPlatform platform in Platforms)
{
if (platform.Name == name)
{
return platform;
}
}
throw new Exception("Platform not found in catalog");
}
public void LoadFromFile(string file)
{
XmlDocument doc = new XmlDocument();
//Load the file in to memory
doc.Load(file);
//Load modules ...
foreach (XmlNode node in doc.SelectNodes("/platforms/platform"))
{
RosPlatform platform = new RosPlatform();
platform.Name = node.Attributes["name"].InnerText;
if (node.Attributes["base"] != null)
{
platform.Base = node.Attributes["base"].InnerText;
}
m_Platform.Add(platform);
}
foreach (XmlNode comp in doc.SelectNodes("/platforms/platform"))
{
// Get the component name....
string name = comp.Attributes["name"].InnerText;
RosPlatform platform = GetPlatformByName(name);
if (platform.Base != null)
{
platform.ParentPlatform = GetPlatformByName(platform.Base);
foreach (RBuildModule module in platform.ParentModules)
{
platform.Modules.Add(module);
}
}
foreach (XmlNode dep in comp.SelectNodes("modules/module"))
{
// Gets the dependency name
name = dep.Attributes["name"].InnerText;
RBuildModule module = SoftwareCatalog.Modules.GetByName(name);
platform.Modules.Add(module);
}
}
}
}
}
@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
public class RosArchitecture
{
private string m_Name = null;
private string m_Sub = null;
private string m_Optimization = null;
public RosArchitecture ()
{
m_Name = "i386";
m_Sub = string.Empty;
m_Optimization = "pentium";
}
public string Name
{
get { return m_Name; }
set { m_Name = value; }
}
public string SubArchitecture
{
get { return m_Sub; }
set { m_Sub = value; }
}
public string Optimization
{
get { return m_Optimization; }
set { m_Optimization = value; }
}
public string SafeName
{
get { return Utility.GetSafeString(m_Name).ToUpper(); }
}
}
}
@@ -0,0 +1,209 @@
using System;
using System.Xml;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
public class RBuildOSImage
{
private RosPlatform m_Platform = null;
private RBuildLanguage m_Language = null;
private RosArchitecture m_Architecture = null;
private Dictionary<string, string> m_Properties = new Dictionary<string, string>();
private List<string> m_Defines = new List<string>();
private List<string> m_Includes = new List<string>();
private bool m_Debug = false;
//private bool m_KernelDebugger = false;
//private bool m_GDBDebugger = false;
private bool m_MakeBootCD = false;
private bool m_MakeLiveCD = false;
public RBuildOSImage()
{
Properties.Add("SARCH", "");
Properties.Add("OARCH", "pentium");
Properties.Add("OPTIMIZE", "1");
Properties.Add("MP", "0");
Properties.Add("KDBG", "0");
Properties.Add("DBG", "0");
Properties.Add("GDB", "0");
Properties.Add("NSWPAT", "0");
Properties.Add("NTLPC", "1");
Properties.Add("_WINKD_", "0");
Defines.Add ("_M_IX86");
Defines.Add ("_X86_");
Defines.Add ("__i386__");
Defines.Add ("_REACTOS_");
Includes.Add(".");
Includes.Add("include");
Includes.Add("include/psdk");
Includes.Add("include/dxsdk");
Includes.Add("include/crt");
Includes.Add("include/ddk");
Includes.Add("include/GL");
Includes.Add("include/ndk");
Includes.Add("include/reactos");
Includes.Add("include/reactos/libs");
}
public bool MakeLiveCD
{
get { return m_MakeLiveCD; }
set { m_MakeLiveCD = value; }
}
public bool MakeBootCD
{
get { return m_MakeBootCD; }
set { m_MakeBootCD = value; }
}
public RBuildLanguage Language
{
get { return m_Language; }
set { m_Language = value; }
}
public RosPlatform Platform
{
get { return m_Platform; }
set { m_Platform = value; }
}
public RosArchitecture Architecture
{
get { return m_Architecture; }
set { m_Architecture = value; }
}
public Dictionary<string, string> Properties
{
get { return m_Properties; }
}
public List<string> Defines
{
get { return m_Defines; }
}
public List<string> Includes
{
get { return m_Includes; }
}
public string ReleaseType
{
get
{
if (m_Debug)
return "DBG";
return "RELEASE";
}
}
public string ImageType
{
get
{
if (m_MakeBootCD)
return "BootCD";
return "LiveCD";
}
}
public void SaveAs(string file)
{
// Creates an XML file is not exist
using (XmlTextWriter writer = new XmlTextWriter(file, Encoding.ASCII))
{
writer.Indentation = 4;
writer.Formatting = Formatting.Indented;
// Starts a new document
writer.WriteStartDocument();
writer.WriteStartElement("project");
writer.WriteAttributeString("name", "ReactOS");
writer.WriteAttributeString("makefile", "makefile.auto");
writer.WriteAttributeString("xmlns", "xi", null, "http://www.w3.org/2001/XInclude");
writer.WriteComment("Generic Properties");
foreach (KeyValuePair<string, string> property in Properties)
{
writer.WriteStartElement("property");
writer.WriteAttributeString("name", property.Key);
writer.WriteAttributeString("value", property.Value);
writer.WriteEndElement();
}
foreach (string define in Defines)
{
writer.WriteStartElement("define");
writer.WriteAttributeString("name", define);
writer.WriteEndElement();
}
writer.WriteStartElement("xi:include");
writer.WriteAttributeString("href", "baseaddress.rbuild");
writer.WriteEndElement();
writer.WriteStartElement("xi:include");
writer.WriteAttributeString("href", "boot/bootdata/bootdata.rbuild");
writer.WriteEndElement();
writer.WriteElementString("compilerflag", "-Os");
writer.WriteElementString("compilerflag", "-ftracer");
writer.WriteElementString("compilerflag", "-momit-leaf-frame-pointer");
writer.WriteElementString("compilerflag", "-mpreferred-stack-boundary=2");
writer.WriteElementString("compilerflag", "-Wno-strict-aliasing");
writer.WriteElementString("compilerflag", "-Wpointer-arith");
writer.WriteElementString("linkerflag", "-enable-stdcall-fixup");
foreach (string include in Includes)
{
writer.WriteStartElement("include");
writer.WriteAttributeString("root", "intermediate");
writer.WriteString(include);
writer.WriteEndElement();
writer.WriteStartElement("include");
writer.WriteString(include);
writer.WriteEndElement();
}
foreach (RBuildModule module in Platform.Modules)
{
writer.WriteStartElement("xi:include");
writer.WriteAttributeString("href", module.RBuildFile);
writer.WriteEndElement();
}
writer.WriteEndElement(); //Project
writer.WriteEndDocument();
}
string a = Name;
}
public string Name
{
get {
return "";
//return string.Format("{0}_{1}{2}_{3}_{4}.iso",
// Platform.SafeName,
// Architecture.SafeName ,
// Language.CultureInfo.ThreeLetterISOLanguageName,
// ImageType,
// ReleaseType);
}
}
}
}
@@ -0,0 +1,78 @@
using System;
using System.Xml;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
public class RosPlatform
{
private List<RBuildModule> m_Modules = new List<RBuildModule>();
private string m_Name = null;
private string m_Base = null;
private RosPlatform m_ParentPlatform = null;
public RosPlatform()
{
m_Name = "ReactOS Core";
}
public string Name
{
get { return m_Name; }
set { m_Name = value; }
}
public string Base
{
get { return m_Base; }
set { m_Base = value; }
}
public RosPlatform ParentPlatform
{
get { return m_ParentPlatform; }
set { m_ParentPlatform = value; }
}
public string SafeName
{
get { return Utility.GetSafeString(m_Name); }
}
public void SaveAs(string file)
{
}
public List<RBuildModule> Modules
{
get { return m_Modules; }
}
public List<RBuildModule> ParentModules
{
get
{
List<RBuildModule> modules = new List<RBuildModule>();
if (ParentPlatform != null)
{
foreach (RBuildModule module in ParentPlatform.Modules)
{
modules.Add(module);
}
foreach (RBuildModule module in ParentPlatform.ParentModules)
{
modules.Add(module);
}
}
return modules;
}
}
}
}
@@ -0,0 +1,80 @@
using System;
using System.Xml;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
public class SoftwareCatalog
{
public RBuildModuleCollection m_Modules = new RBuildModuleCollection();
public SoftwareCatalog()
{
}
public RBuildModuleCollection Modules
{
get { return m_Modules; }
}
public void LoadFromFile(string file)
{
XmlDocument doc = new XmlDocument();
//Load the file in to memory
doc.Load(file);
//Load modules ...
foreach (XmlNode node in doc.SelectNodes("/modules/module"))
{
RBuildModule module;
module = new RBuildModule();
module.Metadata = new RBuildMetadata();
module.Name = node.Attributes["name"].Value;
//module.Base = node.Attributes["base"].Value;
module.Metadata.Description = node.Attributes["desc"].Value;
//module.Rbuild = node.Attributes["rbuild"].Value;
/*
foreach (XmlNode dep in node.SelectNodes("provides/provide"))
{
string value = dep.SelectSingleNode("value").InnerText;
string type = dep.SelectSingleNode("type").InnerText;
module.Provides.Add(value, type);
}*/
m_Modules.Add(module);
}
foreach (XmlNode comp in doc.SelectNodes("/modules/module"))
{
// Get the component name....
string componentName = comp.Attributes["name"].Value;
foreach (XmlNode dep in comp.SelectNodes("dependencies/dependency"))
{
// Gets the dependency name
string dependencyName = dep.Attributes["name"].Value;
foreach (RBuildModule dependency in m_Modules)
{
if (dependency.Name == dependencyName)
{
foreach (RBuildModule module in m_Modules)
{
if (module.Name == componentName)
{
module.Libraries.Add(dependency);
}
}
}
}
}
}
}
}
}
@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("RosFramework")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Sand")]
[assembly: AssemblyProduct("RosFramework")]
[assembly: AssemblyCopyright("Copyright © Sand 2007")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("bc0dfcae-52a0-41f1-83b6-df64128d52b7")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -0,0 +1,37 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
public class RBuildAPIInfo
{
private string m_Name;
private string m_File;
private bool m_Implemented;
public string Name
{
get { return m_Name; }
set { m_Name = value; }
}
public string File
{
get { return m_File; }
set { m_File = value; }
}
public bool Implemented
{
get { return m_Implemented; }
set { m_Implemented = value; }
}
public string HtmlDocFileName
{
get { return string.Format("{0}.htm", Name); }
}
}
}
@@ -0,0 +1,38 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
public enum AuthorRole
{
Developer,
Mantainer,
Translator
}
public class RBuildAuthor
{
private AuthorRole m_AuthorRole = AuthorRole.Developer;
private RBuildContributor m_Contributor = null;
/// <summary>
/// The underlying contributor.
/// </summary>
public RBuildContributor Contributor
{
get { return m_Contributor; }
set { m_Contributor = value; }
}
/// <summary>
/// The author role.
/// </summary>
public AuthorRole Role
{
get { return m_AuthorRole; }
set { m_AuthorRole = value; }
}
}
}
@@ -0,0 +1,106 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
/// <summary>
/// Type of registration
/// </summary>
public enum AutoRegisterType : int
{
DllRegisterServer = 1,
DllInstall = 2,
Both = 3
}
public enum SetupApiFolder : int
{
SourceDrive = 1, //(the directory from which the INF file was installed)
OS = 10, //(%SystemRoot%)
System = 11, //(%SystemRoot%\system32)
Drivers = 12, //(%SystemRoot%\system32\drivers)
Inf = 17, //(%SystemRoot%\inf)
Help = 18, //(%SystemRoot%\Help)
Fonts = 20, //(%SystemRoot%\Fonts)
Root = 24, //(%SystemDrive%)
Shared = 25, //(%ALLUSERSPROFILE%\Shared Documents)
UserProfile = 53 //(%USERPROFILE%)
}
public enum SetupApiShellFolder : int
{
AllUsersApplicationData, // 16419 %ALLUSERSPROFILE%\Application Data
AllUsersDesktop, // 16409 %ALLUSERSPROFILE%\Desktop
AllUsersMyDocuments, // 16430 %ALLUSERSPROFILE%\Documents
AllUsersMyMusic, // 16437 %ALLUSERSPROFILE%\Documents\My Music
AllUsersMyPictures, // 16438 %ALLUSERSPROFILE%\Documents\My Pictures
AllUsersMyVideos, // 16439 %ALLUSERSPROFILE%\Documents\My Videos
AllUsersFavourites, // 16415 %ALLUSERSPROFILE%\Favorites
AllUsersStartMenu, // 16406 %ALLUSERSPROFILE%\Start Menu
AllUsersStartMenuPrograms, // 16407 %ALLUSERSPROFILE%\Start Menu\Programs
AllUsersStartMenuAdministrativeTools, // 16431 %ALLUSERSPROFILE%\Start Menu\Programs\Administrative Tools
AllUsersStartMenuStartup, // 16408 %ALLUSERSPROFILE%\Start Menu\Programs\Startup
AllUsersTemplates, // 16429 %ALLUSERSPROFILE%\Templates
UserApplicationData, // 16410 %USERPROFILE%\Application Data
UserCookies, // 16417 %USERPROFILE%\Cookies
UserDesktop, // 16384 %USERPROFILE%\Desktop
UserDesktop2, // 16400 %USERPROFILE%\Desktop
UserFavourites, // 16390 %USERPROFILE%\Favorites
UserLocalSettingsApplicationData, // 16412 %USERPROFILE%\Local Settings\Application Data
UserLocalSettingsMSCDBruning, // 16443 %USERPROFILE%\Local Settings\Application Data\Microsoft\CD Burning
UserHistory, // 16418 %USERPROFILE%\Local Settings\History
UserTemporaryInternetFiles, // 16416 %USERPROFILE%\Local Settings\Temporary Internet Files
UserMyDocuments, // 16389 %USERPROFILE%\My Documents
UserMyMusic, // 16397 %USERPROFILE%\My Documents\My Music
UserMyPictures, // 16423 %USERPROFILE%\My Documents\My Pictures
UserMyVideos, // 16398 %USERPROFILE%\My Documents\My Videos
UserNetHood, // 16403 %USERPROFILE%\NetHood
UserPrintHood, // 16411 %USERPROFILE%\PrintHood
UserRecent, // 16392 %USERPROFILE%\Recent
UserSendTo, // 16393 %USERPROFILE%\SendTo
UserStartMenu, // 16395 %USERPROFILE%\Start Menu
UserStartMenuPrograms, // 16386 %USERPROFILE%\Start Menu\Programs
UserStartMenuAdministrativeTools, // 16432 %USERPROFILE%\Start Menu\Programs\Administrative Tools
UserStartMenuStartup, // 16391 %USERPROFILE%\Start Menu\Programs\Startup
UserTemplates, // 16405 %USERPROFILE%\Templates
ProgramFiles, // 16422 %ProgramFiles%
ProgramFilesCommonFiles, // 16427 %ProgramFiles%\Common Files
SystenResources, // 16440 %SystemRoot%\Resources
SystemEnglishResources // 16441 %SystemRoot%\Resources\0409
}
/// <summary>
/// An autoregister element specifies that the generated executable should be
/// registered in the registry during second stage setup.
/// </summary>
public class RBuildAutoRegister
{
private AutoRegisterType m_AutoRegisterType = AutoRegisterType.Both;
private string m_InfSection = null;
/// <summary>
/// Name of section in syssetup.inf.
/// </summary>
public string InfSection
{
get { return m_InfSection; }
set { m_InfSection = value; }
}
/// <summary>
/// Type of registration.
/// </summary>
public AutoRegisterType Type
{
get { return m_AutoRegisterType; }
set { m_AutoRegisterType = value; }
}
public int RegistrationType
{
get { return (int)Type; }
}
}
}
@@ -0,0 +1,52 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Text;
namespace SysGen.RBuild.Framework
{
/// <summary>
/// A bootstrap element specifies that the generated file should
/// be put on the bootable CD as a bootstrap file.
/// </summary>
public class RBuildBootstrapFile : RBuildCDFileBase
{
public RBuildBootstrapFile()
{
}
public RBuildBootstrapFile(string basePath , string name)
{
Base = basePath;
Name = name;
}
//public override RBuildFile CDNewFile
//{
// get
// {
// RBuildFile file = (RBuildFile)Clone();
// file.Name = NewName;
// file.Base = InstallBase;
// file.Root = PathRoot.CDOutput;
// return file;
// }
//}
//public virtual RBuildFile CDNewFile
//{
// get
// {
// RBuildFile file = (RBuildFile)Clone();
// file.Name = NewName;
// file.Base = InstallBase;
// file.Root = PathRoot.CDOutput;
// return file;
// }
//}
}
}

Some files were not shown because too many files have changed in this diff Show More