Commits

Tobias Bohnen committed ffcbd5c

  • Participants
  • Parent commits 733c9ba

Comments (0)

Files changed (39)

 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExampleBrowser", "ExampleBrowser\ExampleBrowser.csproj", "{33E464A2-1599-4D09-9D07-E2FB1B82AD1E}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EffectViewer", "EffectViewer\EffectViewer.csproj", "{F4CADA35-B4DA-4C46-8B46-0A117FDB6197}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EffectViewer", "Tools\EffectViewer\EffectViewer.csproj", "{F4CADA35-B4DA-4C46-8B46-0A117FDB6197}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CgToCode", "Tools\CgToCode\CgToCode.csproj", "{C27B64E4-7E12-4CFB-A93C-94A858D4CA28}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{5167FEBB-5201-444C-9115-F93471AC1EC3}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		{F4CADA35-B4DA-4C46-8B46-0A117FDB6197}.Release|Mixed Platforms.Build.0 = Release|x86
 		{F4CADA35-B4DA-4C46-8B46-0A117FDB6197}.Release|x86.ActiveCfg = Release|x86
 		{F4CADA35-B4DA-4C46-8B46-0A117FDB6197}.Release|x86.Build.0 = Release|x86
+		{C27B64E4-7E12-4CFB-A93C-94A858D4CA28}.Debug|Any CPU.ActiveCfg = Debug|x86
+		{C27B64E4-7E12-4CFB-A93C-94A858D4CA28}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+		{C27B64E4-7E12-4CFB-A93C-94A858D4CA28}.Debug|Mixed Platforms.Build.0 = Debug|x86
+		{C27B64E4-7E12-4CFB-A93C-94A858D4CA28}.Debug|x86.ActiveCfg = Debug|x86
+		{C27B64E4-7E12-4CFB-A93C-94A858D4CA28}.Debug|x86.Build.0 = Debug|x86
+		{C27B64E4-7E12-4CFB-A93C-94A858D4CA28}.Release|Any CPU.ActiveCfg = Release|x86
+		{C27B64E4-7E12-4CFB-A93C-94A858D4CA28}.Release|Mixed Platforms.ActiveCfg = Release|x86
+		{C27B64E4-7E12-4CFB-A93C-94A858D4CA28}.Release|Mixed Platforms.Build.0 = Release|x86
+		{C27B64E4-7E12-4CFB-A93C-94A858D4CA28}.Release|x86.ActiveCfg = Release|x86
+		{C27B64E4-7E12-4CFB-A93C-94A858D4CA28}.Release|x86.Build.0 = Release|x86
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 	EndGlobalSection
+	GlobalSection(NestedProjects) = preSolution
+		{C27B64E4-7E12-4CFB-A93C-94A858D4CA28} = {5167FEBB-5201-444C-9115-F93471AC1EC3}
+		{F4CADA35-B4DA-4C46-8B46-0A117FDB6197} = {5167FEBB-5201-444C-9115-F93471AC1EC3}
+	EndGlobalSection
 EndGlobal

File CgNet/WrapperObject.cs

     {
         #region Constructors
 
-        internal WrapperObject(IntPtr handle)
+        protected WrapperObject(IntPtr handle)
         {
             if (handle == IntPtr.Zero)
             {

File EffectViewer/Analyzer.cs

-namespace EffectViewer
-{
-    using System;
-    using System.IO;
-    using System.Windows.Forms;
-
-    using CgNet;
-
-    using CgNet.GL;
-
-    class Analyzer
-    {
-        #region Fields
-
-        private readonly Context context;
-        private readonly TreeView treeView;
-
-        #endregion Fields
-
-        #region Constructors
-
-        public Analyzer(TreeView treeView)
-        {
-            this.treeView = treeView;
-            this.context = Context.Create();
-            this.context.ParameterSettingMode = ParameterSettingMode.Deferred;
-            this.context.RegisterStates();
-        }
-
-        #endregion Constructors
-
-        #region Methods
-
-        #region Public Methods
-
-        public void Analyse(string file)
-        {
-            if (File.Exists(file))
-            {
-                var effect = this.context.CreateEffectFromFile(file, null);
-                if (effect == null)
-                {
-                    ErrorType error;
-                    MessageBox.Show(Cg.GetLastErrorString(out error));
-                    return;
-                }
-
-                // Techniques
-                var techsNode = new TreeNode("Techniques");
-                foreach (var technique in effect.Techniques)
-                {
-                    var techNode = new TreeNode(string.IsNullOrEmpty(technique.Name) ? techsNode.Nodes.Count.ToString() : technique.Name);
-
-                    // Passes
-                    var passesNode = new TreeNode("Passes");
-                    foreach (var pass in technique.Passes)
-                    {
-                        var passNode = new TreeNode(string.IsNullOrEmpty(pass.Name) ? passesNode.Nodes.Count.ToString() : pass.Name);
-
-                        // Programs
-                        var programsNode = new TreeNode("Programs");
-                        var vertexProgram = pass.GetProgram(Domain.VertexDomain);
-                        if (vertexProgram != null)
-                        {
-                            programsNode.Nodes.Add(vertexProgram.GetProgramString(SourceType.ProgramEntry));
-                        }
-                        var fragmentProgram = pass.GetProgram(Domain.FragmentDomain);
-                        if (fragmentProgram != null)
-                        {
-                            programsNode.Nodes.Add(fragmentProgram.GetProgramString(SourceType.ProgramEntry));
-                        }
-                        var geometryProgram = pass.GetProgram(Domain.GeometryDomain);
-                        if (geometryProgram != null)
-                        {
-                            programsNode.Nodes.Add(geometryProgram.GetProgramString(SourceType.ProgramEntry));
-                        }
-
-                        if (programsNode.Nodes.Count > 0)
-                        {
-                            passNode.Nodes.Add(programsNode);
-                        }
-
-                        passesNode.Nodes.Add(passNode);
-                    }
-
-                    if (passesNode.Nodes.Count > 0)
-                    {
-                        techNode.Nodes.Add(passesNode);
-                    }
-
-                    techsNode.Nodes.Add(techNode);
-                }
-
-                this.treeView.Nodes.Add(techsNode);
-            }
-        }
-
-        public void Destroy()
-        {
-            this.context.Dispose();
-        }
-
-        #endregion Public Methods
-
-        #endregion Methods
-    }
-}

File EffectViewer/EffectViewer.csproj

-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
-    <ProductVersion>8.0.30703</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{F4CADA35-B4DA-4C46-8B46-0A117FDB6197}</ProjectGuid>
-    <OutputType>WinExe</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>EffectViewer</RootNamespace>
-    <AssemblyName>EffectViewer</AssemblyName>
-    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
-    <FileAlignment>512</FileAlignment>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
-    <PlatformTarget>x86</PlatformTarget>
-    <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|x86' ">
-    <PlatformTarget>x86</PlatformTarget>
-    <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.Core" />
-    <Reference Include="System.Xml.Linq" />
-    <Reference Include="System.Data.DataSetExtensions" />
-    <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="Form1.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="Form1.Designer.cs">
-      <DependentUpon>Form1.cs</DependentUpon>
-    </Compile>
-    <Compile Include="Program.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="Analyzer.cs" />
-    <EmbeddedResource Include="Form1.resx">
-      <DependentUpon>Form1.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>
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\CgNet\CgNet.csproj">
-      <Project>{8F858C68-C03F-4394-8FDE-B6BA2B9EBA99}</Project>
-      <Name>CgNet</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(MSBuildToolsPath)\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>

File EffectViewer/Form1.Designer.cs

-namespace EffectViewer
-{
-    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.textBox1 = new System.Windows.Forms.TextBox();
-            this.button1 = new System.Windows.Forms.Button();
-            this.button2 = new System.Windows.Forms.Button();
-            this.treeView1 = new System.Windows.Forms.TreeView();
-            this.SuspendLayout();
-            // 
-            // textBox1
-            // 
-            this.textBox1.Location = new System.Drawing.Point(12, 12);
-            this.textBox1.Name = "textBox1";
-            this.textBox1.Size = new System.Drawing.Size(307, 20);
-            this.textBox1.TabIndex = 0;
-            // 
-            // button1
-            // 
-            this.button1.Location = new System.Drawing.Point(325, 10);
-            this.button1.Name = "button1";
-            this.button1.Size = new System.Drawing.Size(25, 23);
-            this.button1.TabIndex = 1;
-            this.button1.Text = "...";
-            this.button1.UseVisualStyleBackColor = true;
-            this.button1.Click += new System.EventHandler(this.button1_Click);
-            // 
-            // button2
-            // 
-            this.button2.Location = new System.Drawing.Point(356, 10);
-            this.button2.Name = "button2";
-            this.button2.Size = new System.Drawing.Size(75, 23);
-            this.button2.TabIndex = 2;
-            this.button2.Text = "Load";
-            this.button2.UseVisualStyleBackColor = true;
-            this.button2.Click += new System.EventHandler(this.button2_Click);
-            // 
-            // treeView1
-            // 
-            this.treeView1.Location = new System.Drawing.Point(13, 39);
-            this.treeView1.Name = "treeView1";
-            this.treeView1.Size = new System.Drawing.Size(418, 300);
-            this.treeView1.TabIndex = 3;
-            // 
-            // Form1
-            // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(443, 351);
-            this.Controls.Add(this.treeView1);
-            this.Controls.Add(this.button2);
-            this.Controls.Add(this.button1);
-            this.Controls.Add(this.textBox1);
-            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
-            this.Name = "Form1";
-            this.Text = "Form1";
-            this.ResumeLayout(false);
-            this.PerformLayout();
-
-        }
-
-        #endregion
-
-        private System.Windows.Forms.TextBox textBox1;
-        private System.Windows.Forms.Button button1;
-        private System.Windows.Forms.Button button2;
-        private System.Windows.Forms.TreeView treeView1;
-    }
-}
-

File EffectViewer/Form1.cs

-namespace EffectViewer
-{
-    using System;
-    using System.Windows.Forms;
-
-    public partial class Form1 : Form
-    {
-        #region Fields
-
-        private readonly Analyzer analyzer;
-
-        #endregion Fields
-
-        #region Constructors
-
-        public Form1()
-        {
-            InitializeComponent();
-            this.analyzer = new Analyzer(this.treeView1);
-        }
-
-        #endregion Constructors
-
-        #region Methods
-
-        #region Private Methods
-
-        private void button1_Click(object sender, EventArgs e)
-        {
-            using (var ofd = new OpenFileDialog())
-            {
-                ofd.RestoreDirectory = true;
-                ofd.Multiselect = false;
-                if (ofd.ShowDialog() == DialogResult.OK)
-                {
-                    this.textBox1.Text = ofd.FileName;
-                }
-            }
-        }
-
-        private void button2_Click(object sender, EventArgs e)
-        {
-            this.analyzer.Analyse(this.textBox1.Text);
-        }
-
-        #endregion Private Methods
-
-        #endregion Methods
-    }
-}

File EffectViewer/Form1.resx

-<?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>

File EffectViewer/Program.cs

-namespace EffectViewer
-{
-    using System;
-    using System.Windows.Forms;
-
-    static class Program
-    {
-        #region Methods
-
-        #region Private Static Methods
-
-        /// <summary>
-        /// The main entry point for the application.
-        /// </summary>
-        [STAThread]
-        static void Main()
-        {
-            Application.EnableVisualStyles();
-            Application.SetCompatibleTextRenderingDefault(false);
-            Application.Run(new Form1());
-        }
-
-        #endregion Private Static Methods
-
-        #endregion Methods
-    }
-}

File EffectViewer/Properties/AssemblyInfo.cs

-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("ShaderStats")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Microsoft")]
-[assembly: AssemblyProduct("ShaderStats")]
-[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
-[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("12568866-845b-4a50-a386-643cd2ae540e")]
-
-// 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 Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]

File EffectViewer/Properties/Resources.Designer.cs

-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:4.0.30319.1
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace EffectViewer.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", "4.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("EffectViewer.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;
-            }
-        }
-    }
-}

File EffectViewer/Properties/Resources.resx

-<?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>

File EffectViewer/Properties/Settings.Designer.cs

-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:4.0.30319.1
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace EffectViewer.Properties {
-    
-    
-    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.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;
-            }
-        }
-    }
-}

File EffectViewer/Properties/Settings.settings

-<?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>

File ExampleBrowser/Examples/OpenTK/Basic/BumpMapWall.cs

 {
     using System;
 
-    using All = global::OpenTK.Graphics.OpenGL.All;
-
-    using BeginMode = global::OpenTK.Graphics.OpenGL.BeginMode;
-
     using CgNet;
     using CgNet.GL;
 
-    using ClearBufferMask = global::OpenTK.Graphics.OpenGL.ClearBufferMask;
-
-    using EnableCap = global::OpenTK.Graphics.OpenGL.EnableCap;
-
     using ExampleBrowser.Data;
 
-    using GL = global::OpenTK.Graphics.OpenGL.GL;
-
     using global::OpenTK;
-    using global::OpenTK.Graphics;
+    using global::OpenTK.Graphics.OpenGL;
     using global::OpenTK.Input;
-
-    using MatrixMode = global::OpenTK.Graphics.OpenGL.MatrixMode;
-
-    using PixelFormat = global::OpenTK.Graphics.OpenGL.PixelFormat;
-
-    using PixelInternalFormat = global::OpenTK.Graphics.OpenGL.PixelInternalFormat;
-
-    using PixelStoreParameter = global::OpenTK.Graphics.OpenGL.PixelStoreParameter;
-
-    using PixelType = global::OpenTK.Graphics.OpenGL.PixelType;
-
-    using TextureParameterName = global::OpenTK.Graphics.OpenGL.TextureParameterName;
-
-    using TextureTarget = global::OpenTK.Graphics.OpenGL.TextureTarget;
+    using Glu = global::OpenTK.Graphics.Glu;
 
     [ExampleDescription(NodePath = "OpenTK/Basic/21 Bump Map Wall")]
     public class BumpMapWall : Example

File ExampleBrowser/Examples/OpenTK/Basic/ParticleSystem.cs

 {
     using System;
 
-    using BeginMode = global::OpenTK.Graphics.OpenGL.BeginMode;
-
-    using BlendingFactorDest = global::OpenTK.Graphics.OpenGL.BlendingFactorDest;
-
-    using BlendingFactorSrc = global::OpenTK.Graphics.OpenGL.BlendingFactorSrc;
-
     using CgNet;
     using CgNet.GL;
 
-    using ClearBufferMask = global::OpenTK.Graphics.OpenGL.ClearBufferMask;
-
-    using EnableCap = global::OpenTK.Graphics.OpenGL.EnableCap;
-
-    using GL = global::OpenTK.Graphics.OpenGL.GL;
-
     using global::OpenTK;
-    using global::OpenTK.Graphics;
+    using global::OpenTK.Graphics.OpenGL;
     using global::OpenTK.Input;
-
-    using MatrixMode = global::OpenTK.Graphics.OpenGL.MatrixMode;
-
-    using TextureUnit = global::OpenTK.Graphics.OpenGL.TextureUnit;
-
+    using Glu = global::OpenTK.Graphics.Glu;
     [ExampleDescription(NodePath = "OpenTK/Basic/15 Particle System")]
     public class ParticleSystem : Example
     {

File ExampleBrowser/Examples/OpenTK/Basic/VertexProgram.cs

             CgGL.SetOptimalOptions(this.vertexProfile);
 
             this.vertexProgram =
-                CgContext.CreateProgramFromFile(
+                this.CgContext.CreateProgramFromFile(
                     ProgramType.Source, /* Program in human-readable form */
                     VertexProgramFileName, /* Name of file containing program */
                     this.vertexProfile, /* Profile: OpenGL ARB vertex program */

File ExampleBrowser/Program.cs

         [STAThread]
         static void Main()
         {
+            OpenTK.Toolkit.Init();
             Application.EnableVisualStyles();
             Application.SetCompatibleTextRenderingDefault(false);
             Application.Run(new ExampleSelector());

File Tools/CgToCode/CgToCode.csproj

+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{C27B64E4-7E12-4CFB-A93C-94A858D4CA28}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>CgToCode</RootNamespace>
+    <AssemblyName>CgToCode</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <PlatformTarget>x86</PlatformTarget>
+    <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|x86' ">
+    <PlatformTarget>x86</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="OpenTK, Version=1.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
+      <HintPath>..\..\CgNet\bin\Debug\OpenTK.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <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="Converter.cs" />
+    <Compile Include="Form1.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Form1.Designer.cs">
+      <DependentUpon>Form1.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <EmbeddedResource Include="Form1.resx">
+      <DependentUpon>Form1.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>
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\CgNet\CgNet.csproj">
+      <Project>{8F858C68-C03F-4394-8FDE-B6BA2B9EBA99}</Project>
+      <Name>CgNet</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\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>

File Tools/CgToCode/Converter.cs

+namespace CgToCode
+{
+    using System;
+    using System.CodeDom;
+    using System.CodeDom.Compiler;
+    using System.Collections.Generic;
+    using System.Globalization;
+    using System.IO;
+    using System.Reflection;
+
+    using CgNet;
+
+    using Microsoft.CSharp;
+    using Microsoft.VisualBasic;
+
+    public sealed class Converter : IDisposable
+    {
+        #region Fields
+
+        private readonly Context context;
+        private readonly CodeDomProvider provider;
+
+        #endregion Fields
+
+        #region Constructors
+
+        public Converter()
+        {
+            this.context = Context.Create();
+            this.provider = new CSharpCodeProvider();
+        }
+
+        #endregion Constructors
+
+        #region Methods
+
+        #region Public Methods
+
+        public void Convert(string file, string entrypoint, ProfileType profile, string className, string namespaceName, string destFolder)
+        {
+            var programText = File.ReadAllText(file);
+
+            var program = context.CreateProgram(ProgramType.Source, programText, profile, entrypoint, null);
+            var text = this.GenerateCode(program, className, namespaceName);
+            program.Dispose();
+
+            using (var sw = new StreamWriter(Path.Combine(destFolder, className + "." + provider.FileExtension)))
+            {
+                sw.Write(text);
+                sw.Flush();
+            }
+        }
+
+        public void Dispose()
+        {
+            GC.SuppressFinalize(this);
+            this.context.Dispose();
+        }
+
+        #endregion Public Methods
+
+        #region Private Static Methods
+
+        private static CodeConstructor CreateConstructor(CodeTypeDeclaration codeTypeDeclaration)
+        {
+            var codeConstructor = new CodeConstructor
+                                  {
+                                      Attributes = MemberAttributes.Public
+                                  };
+
+            // 'context' parameter
+            codeConstructor.Parameters.Add(new CodeParameterDeclarationExpression(new CodeTypeReference("Context"), "context"));
+
+            codeTypeDeclaration.Members.Add(codeConstructor);
+            return codeConstructor;
+        }
+
+        private static void CreateFields(CodeTypeDeclaration codeTypeDeclaration, CodeConstructor codeConstructor, CgNet.Program program)
+        {
+            string programProfile = program.Profile.ToString();
+            string programString = program.GetProgramString(SourceType.CompiledProgram);
+            string programEntry = program.GetProgramString(SourceType.ProgramEntry);
+
+            // 'program' field
+            var programField = new CodeMemberField("Program", "program");
+            codeTypeDeclaration.Members.Add(programField);
+            var programExp = new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), "program");
+
+            // 'programSource' field
+            var programSourceField = new CodeMemberField(typeof(string), "programSource");
+            codeTypeDeclaration.Members.Add(programSourceField);
+            var programSourceExp = new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), "programSource");
+
+            // assign 'programSource'
+            codeConstructor.Statements.Add(
+                new CodeAssignStatement(programSourceExp, new CodePrimitiveExpression(programString)));
+
+            // assing 'program'
+            codeConstructor.Statements.Add(
+                new CodeAssignStatement(programExp,
+                                        new CodeMethodInvokeExpression(
+                                            new CodeVariableReferenceExpression("context"),
+                                            "CreateProgram",
+                                            new CodeTypeReferenceExpression("ProgramType.Object"),
+                                            programSourceExp,
+                                            new CodeMethodReferenceExpression(new CodeTypeReferenceExpression("ProfileType"), programProfile),
+                                            new CodePrimitiveExpression(programEntry),
+                                            new CodePrimitiveExpression(null))));
+
+            // load program
+            codeConstructor.Statements.Add(new CodeMethodInvokeExpression(programExp, "Load"));
+        }
+
+        private static void CreateMethods(CodeTypeDeclaration codeTypeDeclaration, string programProfile)
+        {
+            var programExp = new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), "program");
+
+            // 'Dispose' method
+            var dispose = new CodeMemberMethod
+                          {
+                              Name = "Dispose",
+                              Attributes = MemberAttributes.Public | MemberAttributes.Final
+                          };
+            dispose.Statements.Add(new CodeMethodInvokeExpression(programExp, "Dispose"));
+            dispose.Statements.Add(new CodeMethodInvokeExpression(new CodeTypeReferenceExpression("GC"), "SuppressFinalize", new CodeThisReferenceExpression()));
+            codeTypeDeclaration.Members.Add(dispose);
+
+            // 'Bind' method
+            var bind = new CodeMemberMethod
+                       {
+                           Name = "Bind",
+                           Attributes = MemberAttributes.Public | MemberAttributes.Final
+                       };
+            bind.Statements.Add(new CodeMethodInvokeExpression(programExp, "Bind"));
+            codeTypeDeclaration.Members.Add(bind);
+
+            // 'EnableProfile' method
+            var enableProfile = new CodeMemberMethod
+                                {
+                                    Name = "EnableProfile",
+                                    Attributes = MemberAttributes.Public | MemberAttributes.Final
+                                };
+            enableProfile.Statements.Add(new CodeMethodInvokeExpression(new CodeTypeReferenceExpression("CgGL"), "EnableProfile", new CodeMethodReferenceExpression(new CodeTypeReferenceExpression("ProfileType"), programProfile)));
+            codeTypeDeclaration.Members.Add(enableProfile);
+
+            // 'DisableProfile' method
+            var disableProfile = new CodeMemberMethod
+                                 {
+                                     Name = "DisableProfile",
+                                     Attributes = MemberAttributes.Public | MemberAttributes.Final
+                                 };
+            disableProfile.Statements.Add(new CodeMethodInvokeExpression(new CodeTypeReferenceExpression("CgGL"), "DisableProfile", new CodeMethodReferenceExpression(new CodeTypeReferenceExpression("ProfileType"), programProfile)));
+            codeTypeDeclaration.Members.Add(disableProfile);
+        }
+
+        private static void CreateNameSpaces(CodeCompileUnit codeCompileUnit, string namespaceName)
+        {
+            var codeNamespace = new CodeNamespace(namespaceName);
+            codeNamespace.Imports.AddRange(new[] { new CodeNamespaceImport("System"), new CodeNamespaceImport("CgNet"), new CodeNamespaceImport("CgNet.GL") });
+            codeCompileUnit.Namespaces.Add(codeNamespace);
+        }
+
+        private static void CreateProperties(CodeTypeDeclaration codeTypeDeclaration, CodeMemberMethod codeConstructor, IEnumerable<ParameterDef> paras)
+        {
+            var programExp = new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), "program");
+            foreach (var para in paras)
+            {
+                var propertyType = new CodeTypeReference(para.Type);
+                var property = new CodeMemberProperty
+                               {
+                                   Type = propertyType,
+                                   Name = CultureInfo.InvariantCulture.TextInfo.ToTitleCase(para.Name),
+                                   Attributes = MemberAttributes.Public | MemberAttributes.Final
+                               };
+
+                // creating backing field
+                var field = new CodeMemberField("Parameter", para.Name);
+                codeTypeDeclaration.Members.Add(field);
+                var fieldExp = new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), para.Name);
+
+                // assign backing field in constructor
+                var fieldAssign = new CodeAssignStatement(
+                    fieldExp,
+                    new CodeMethodInvokeExpression(
+                        programExp,
+                        "GetNamedParameter",
+                        new CodePrimitiveExpression(para.Name)));
+                codeConstructor.Statements.Add(fieldAssign);
+
+                // Getter
+                CodeStatement getValueExp;
+                if (para.IsArray)
+                {
+                    property.GetStatements.Add(
+                        new CodeVariableDeclarationStatement(propertyType, "buffer",
+                                                             new CodeArrayCreateExpression(propertyType, para.ArraySize)));
+
+                    var methodCall = new CodeMethodInvokeExpression(
+                        fieldExp,
+                        "GetValue",
+                        new CodeDirectionExpression(FieldDirection.Ref, new CodeVariableReferenceExpression("buffer")));
+
+                    property.GetStatements.Add(methodCall);
+
+                    getValueExp = new CodeMethodReturnStatement(new CodeVariableReferenceExpression("buffer"));
+                }
+                else
+                {
+                    getValueExp = new CodeMethodReturnStatement(
+                        new CodeMethodInvokeExpression(
+                            new CodeMethodReferenceExpression(
+                                fieldExp,
+                                "GetValue",
+                                new[]
+                                {
+                                    propertyType
+                                })));
+                }
+
+                property.GetStatements.Add(getValueExp);
+
+                // Setter
+                CodeMethodInvokeExpression setValueExp;
+                if (para.IsArray)
+                {
+                    setValueExp = new CodeMethodInvokeExpression(
+                        fieldExp,
+                        "SetValue",
+                        new CodeVariableReferenceExpression("value"));
+                }
+                else
+                {
+                    setValueExp = new CodeMethodInvokeExpression(
+                        fieldExp,
+                        "Set",
+                        new CodeVariableReferenceExpression("value"));
+                }
+
+                property.SetStatements.Add(setValueExp);
+
+                codeTypeDeclaration.Members.Add(property);
+            }
+        }
+
+        private static CodeTypeDeclaration CreateType(CodeCompileUnit codeCompileUnit, string className)
+        {
+            var codeTypeDeclaration = new CodeTypeDeclaration(className)
+                                      {
+                                          TypeAttributes = TypeAttributes.Sealed
+                                      };
+            codeTypeDeclaration.BaseTypes.Add(new CodeTypeReference("IDisposable"));
+            codeCompileUnit.Namespaces[0].Types.Add(codeTypeDeclaration);
+            return codeTypeDeclaration;
+        }
+
+        private static IEnumerable<ParameterDef> GetParameters(CgNet.Program program)
+        {
+            var retValue = new List<ParameterDef>();
+
+            var para = program.GetFirstParameter(NameSpace.Program);
+            while (para != null)
+            {
+                if (para.Variability == Variability.Uniform)
+                {
+                    bool isArray = false;
+                    int arraySize = 0;
+                    var type = para.Type;
+                    Type clrType = null;
+
+                    if (type == ParameterType.Array)
+                    {
+                        isArray = true;
+                        type = para.BaseType;
+                        arraySize = para.Rows * para.Columns;
+                        var totalSize = para.GetArrayTotalSize();
+                        if (totalSize > 0)
+                        {
+                            arraySize *= totalSize;
+                        }
+                    }
+
+                    switch (type)
+                    {
+                        case ParameterType.Float:
+                            clrType = isArray ? typeof(float[]) : typeof(float);
+                            break;
+                        case ParameterType.Double:
+                            clrType = isArray ? typeof(double[]) : typeof(double);
+                            break;
+                        case ParameterType.Int:
+                            clrType = isArray ? typeof(int[]) : typeof(int);
+                            break;
+                    }
+
+                    retValue.Add(new ParameterDef
+                                 {
+                                     Name = para.Name,
+                                     Type = clrType,
+                                     IsArray = isArray,
+                                     ArraySize = arraySize,
+                                 });
+                }
+
+                para = para.NextParameter;
+            }
+
+            return retValue;
+        }
+
+        #endregion Private Static Methods
+
+        #region Private Methods
+
+        private string GenerateCode(CgNet.Program program, string className, string namespaceName)
+        {
+            var codeCompileUnit = new CodeCompileUnit();
+
+            CreateNameSpaces(codeCompileUnit, namespaceName);
+            var codeTypeDeclaration = CreateType(codeCompileUnit, className);
+            var codeConstructor = CreateConstructor(codeTypeDeclaration);
+            CreateFields(codeTypeDeclaration, codeConstructor, program);
+            CreateProperties(codeTypeDeclaration, codeConstructor, GetParameters(program));
+            CreateMethods(codeTypeDeclaration, program.Profile.ToString());
+
+            using (var tw = new StringWriter())
+            {
+                var codeGeneratorOptions = new CodeGeneratorOptions
+                {
+                    BracingStyle = "C"
+                };
+
+                this.provider.GenerateCodeFromCompileUnit(codeCompileUnit, tw, codeGeneratorOptions);
+                tw.Flush();
+                return tw.ToString();
+            }
+        }
+
+        #endregion Private Methods
+
+        #endregion Methods
+
+        #region Nested Types
+
+        private sealed class ParameterDef
+        {
+            #region Properties
+
+            #region Public Properties
+
+            public int ArraySize
+            {
+                get;
+                set;
+            }
+
+            public bool IsArray
+            {
+                get;
+                set;
+            }
+
+            public string Name
+            {
+                get;
+                set;
+            }
+
+            public Type Type
+            {
+                get;
+                set;
+            }
+
+            #endregion Public Properties
+
+            #endregion Properties
+        }
+
+        #endregion Nested Types
+    }
+}

File Tools/CgToCode/Form1.Designer.cs

+namespace CgToCode
+{
+    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.button2 = new System.Windows.Forms.Button();
+            this.button1 = new System.Windows.Forms.Button();
+            this.textBox1 = new System.Windows.Forms.TextBox();
+            this.textBox2 = new System.Windows.Forms.TextBox();
+            this.label1 = new System.Windows.Forms.Label();
+            this.SuspendLayout();
+            // 
+            // button2
+            // 
+            this.button2.Location = new System.Drawing.Point(356, 12);
+            this.button2.Name = "button2";
+            this.button2.Size = new System.Drawing.Size(75, 23);
+            this.button2.TabIndex = 5;
+            this.button2.Text = "Load";
+            this.button2.UseVisualStyleBackColor = true;
+            this.button2.Click += new System.EventHandler(this.button2_Click);
+            // 
+            // button1
+            // 
+            this.button1.Location = new System.Drawing.Point(325, 12);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(25, 23);
+            this.button1.TabIndex = 4;
+            this.button1.Text = "...";
+            this.button1.UseVisualStyleBackColor = true;
+            this.button1.Click += new System.EventHandler(this.button1_Click);
+            // 
+            // textBox1
+            // 
+            this.textBox1.Location = new System.Drawing.Point(12, 12);
+            this.textBox1.Name = "textBox1";
+            this.textBox1.Size = new System.Drawing.Size(307, 20);
+            this.textBox1.TabIndex = 3;
+            this.textBox1.Text = "test.cg";
+            // 
+            // textBox2
+            // 
+            this.textBox2.Location = new System.Drawing.Point(13, 60);
+            this.textBox2.Name = "textBox2";
+            this.textBox2.Size = new System.Drawing.Size(306, 20);
+            this.textBox2.TabIndex = 6;
+            this.textBox2.Text = "main";
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(13, 39);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(57, 13);
+            this.label1.TabIndex = 7;
+            this.label1.Text = "Entrypoint:";
+            // 
+            // Form1
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(436, 102);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.textBox2);
+            this.Controls.Add(this.button2);
+            this.Controls.Add(this.button1);
+            this.Controls.Add(this.textBox1);
+            this.Name = "Form1";
+            this.Text = "Form1";
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Button button2;
+        private System.Windows.Forms.Button button1;
+        private System.Windows.Forms.TextBox textBox1;
+        private System.Windows.Forms.TextBox textBox2;
+        private System.Windows.Forms.Label label1;
+
+    }
+}
+

File Tools/CgToCode/Form1.cs

+namespace CgToCode
+{
+    using System;
+    using System.Windows.Forms;
+
+    using CgNet;
+
+    public partial class Form1 : Form
+    {
+        #region Fields
+
+        private Converter converter = new Converter();
+
+        #endregion Fields
+
+        #region Constructors
+
+        public Form1()
+        {
+            InitializeComponent();
+        }
+
+        #endregion Constructors
+
+        #region Methods
+
+        #region Private Methods
+
+        private void button1_Click(object sender, EventArgs e)
+        {
+            using (var ofd = new OpenFileDialog())
+            {
+                ofd.InitialDirectory = Environment.CurrentDirectory;
+                ofd.RestoreDirectory = true;
+                ofd.Multiselect = false;
+                if (ofd.ShowDialog() == DialogResult.OK)
+                {
+                    this.textBox1.Text = ofd.FileName;
+                }
+            }
+        }
+
+        private void button2_Click(object sender, EventArgs e)
+        {
+            this.converter.Convert(this.textBox1.Text, this.textBox2.Text, ProfileType.Arbvp1, "Test", "TestNamespace", Environment.CurrentDirectory);
+        }
+
+        #endregion Private Methods
+
+        #endregion Methods
+    }
+}

File Tools/CgToCode/Form1.resx

+<?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>

File Tools/CgToCode/Program.cs

+namespace CgToCode
+{
+    using System;
+    using System.Windows.Forms;
+
+    static class Program
+    {
+        #region Methods
+
+        #region Private Static Methods
+
+        /// <summary>
+        /// The main entry point for the application.
+        /// </summary>
+        [STAThread]
+        static void Main()
+        {
+            Application.EnableVisualStyles();
+            Application.SetCompatibleTextRenderingDefault(false);
+            Application.Run(new Form1());
+        }
+
+        #endregion Private Static Methods
+
+        #endregion Methods
+    }
+}

File Tools/CgToCode/Properties/AssemblyInfo.cs

+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("CgToCSharp")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Tobias Bohnen")]
+[assembly: AssemblyProduct("CgToCSharp")]
+[assembly: AssemblyCopyright("Copyright © Tobias Bohnen 2011")]
+[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("0a521313-b0c8-456f-9392-0bda81af9699")]
+
+// 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 Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

File Tools/CgToCode/Properties/Resources.Designer.cs

+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.225
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace CgToCode.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", "4.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("CgToCode.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;
+            }
+        }
+    }
+}

File Tools/CgToCode/Properties/Resources.resx

+<?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>

File Tools/CgToCode/Properties/Settings.Designer.cs

+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.225
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>