diff --git a/ANX.Framework.sln b/ANX.Framework.sln index 5602cdf9..cc889159 100644 --- a/ANX.Framework.sln +++ b/ANX.Framework.sln @@ -13,6 +13,9 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "RenderSystems", "RenderSystems", "{D421509A-9AE3-4D7E-881B-EAFED598B028}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{9B0DD48B-3912-4F33-AF3F-691AF02B73F9}" + ProjectSection(SolutionItems) = preProject + Samples\SampleCatalog.xml = Samples\SampleCatalog.xml + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VertexIndexBuffer", "Samples\VertexIndexBuffer\VertexIndexBuffer.csproj", "{F945515B-394D-4ED4-80E0-98EB59B69D24}" EndProject @@ -172,7 +175,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Metro", "Metro", "{32B91ACB EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ContentBuilder", "Tools\ContentBuilder\ContentBuilder.csproj", "{10F7894D-E8B5-4DCA-BB08-5C99FA792388}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AnxSampleBrowser", "Tools\AnxSampleBrowser\AnxSampleBrowser.csproj", "{938D5F88-B888-4B04-BEEE-EE701FBA51EF}" +EndProject Global + GlobalSection(SubversionScc) = preSolution + Svn-Managed = True + Manager = AnkhSVN - Subversion Support for Visual Studio + EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|Mixed Platforms = Debug|Mixed Platforms @@ -650,6 +659,16 @@ Global {10F7894D-E8B5-4DCA-BB08-5C99FA792388}.Release|Mixed Platforms.Build.0 = Release|x86 {10F7894D-E8B5-4DCA-BB08-5C99FA792388}.Release|x86.ActiveCfg = Release|x86 {10F7894D-E8B5-4DCA-BB08-5C99FA792388}.Release|x86.Build.0 = Release|x86 + {938D5F88-B888-4B04-BEEE-EE701FBA51EF}.Debug|Any CPU.ActiveCfg = Debug|x86 + {938D5F88-B888-4B04-BEEE-EE701FBA51EF}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {938D5F88-B888-4B04-BEEE-EE701FBA51EF}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {938D5F88-B888-4B04-BEEE-EE701FBA51EF}.Debug|x86.ActiveCfg = Debug|x86 + {938D5F88-B888-4B04-BEEE-EE701FBA51EF}.Debug|x86.Build.0 = Debug|x86 + {938D5F88-B888-4B04-BEEE-EE701FBA51EF}.Release|Any CPU.ActiveCfg = Release|x86 + {938D5F88-B888-4B04-BEEE-EE701FBA51EF}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {938D5F88-B888-4B04-BEEE-EE701FBA51EF}.Release|Mixed Platforms.Build.0 = Release|x86 + {938D5F88-B888-4B04-BEEE-EE701FBA51EF}.Release|x86.ActiveCfg = Release|x86 + {938D5F88-B888-4B04-BEEE-EE701FBA51EF}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -662,6 +681,7 @@ Global {F9177943-1590-49AE-987D-D6FAE30D96DD} = {B24A8593-562A-4A25-BB08-46C163F10F3F} {47B802CC-069D-431E-BF15-E574EDD3BA5D} = {B24A8593-562A-4A25-BB08-46C163F10F3F} {10F7894D-E8B5-4DCA-BB08-5C99FA792388} = {B24A8593-562A-4A25-BB08-46C163F10F3F} + {938D5F88-B888-4B04-BEEE-EE701FBA51EF} = {B24A8593-562A-4A25-BB08-46C163F10F3F} {5BE49183-2F6F-4527-AC90-D816911FCF90} = {D421509A-9AE3-4D7E-881B-EAFED598B028} {EB8258E0-6741-4DB9-B756-1EBDF67B1ED6} = {D421509A-9AE3-4D7E-881B-EAFED598B028} {B30DE9C2-0926-46B6-8351-9AF276C472D5} = {D421509A-9AE3-4D7E-881B-EAFED598B028} @@ -702,8 +722,4 @@ Global {2B6D0EFF-7874-495F-9226-873ED9649C60} = {1436F7C9-29D3-4FEF-8914-10B45F13D142} {2CF3FE4D-586E-4B07-8BF0-1E84B670F0AD} = {1436F7C9-29D3-4FEF-8914-10B45F13D142} EndGlobalSection - GlobalSection(SubversionScc) = preSolution - Svn-Managed = True - Manager = AnkhSVN - Subversion Support for Visual Studio - EndGlobalSection EndGlobal diff --git a/Samples/ANX.Framework.Samples.sln b/Samples/ANX.Framework.Samples.sln index eebb193c..c44acfd5 100644 --- a/Samples/ANX.Framework.Samples.sln +++ b/Samples/ANX.Framework.Samples.sln @@ -27,6 +27,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RenderTarget", "RenderTarge EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StencilBuffer", "StencilBuffer\StencilBuffer.csproj", "{41E6C2CF-51EA-4D8E-96AE-739CA3951766}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7A7D3D4E-6D4E-41D7-97E2-4F7860AA37FE}" + ProjectSection(SolutionItems) = preProject + SampleCatalog.xml = SampleCatalog.xml + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/Tools/ANX.Framework.Tools.sln b/Tools/ANX.Framework.Tools.sln index 4eb696ce..7291963f 100644 --- a/Tools/ANX.Framework.Tools.sln +++ b/Tools/ANX.Framework.Tools.sln @@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StockShaderCodeGenerator", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectConverter", "ProjectConverter\ProjectConverter.csproj", "{B5209A04-B2F8-4033-A5E7-545BE771214C}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AnxSampleBrowser", "AnxSampleBrowser\AnxSampleBrowser.csproj", "{938D5F88-B888-4B04-BEEE-EE701FBA51EF}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x86 = Debug|x86 @@ -22,9 +24,12 @@ Global {D73E5FF4-AE88-4637-8159-120FBDA564BF}.Release|x86.ActiveCfg = Release|x86 {D73E5FF4-AE88-4637-8159-120FBDA564BF}.Release|x86.Build.0 = Release|x86 {B5209A04-B2F8-4033-A5E7-545BE771214C}.Debug|x86.ActiveCfg = Debug|x86 - {B5209A04-B2F8-4033-A5E7-545BE771214C}.Debug|x86.Build.0 = Debug|x86 {B5209A04-B2F8-4033-A5E7-545BE771214C}.Release|x86.ActiveCfg = Release|x86 {B5209A04-B2F8-4033-A5E7-545BE771214C}.Release|x86.Build.0 = Release|x86 + {938D5F88-B888-4B04-BEEE-EE701FBA51EF}.Debug|x86.ActiveCfg = Debug|x86 + {938D5F88-B888-4B04-BEEE-EE701FBA51EF}.Debug|x86.Build.0 = Debug|x86 + {938D5F88-B888-4B04-BEEE-EE701FBA51EF}.Release|x86.ActiveCfg = Release|x86 + {938D5F88-B888-4B04-BEEE-EE701FBA51EF}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Tools/AnxSampleBrowser/AnxSampleBrowser.csproj b/Tools/AnxSampleBrowser/AnxSampleBrowser.csproj new file mode 100644 index 00000000..1e21efbc --- /dev/null +++ b/Tools/AnxSampleBrowser/AnxSampleBrowser.csproj @@ -0,0 +1,100 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {938D5F88-B888-4B04-BEEE-EE701FBA51EF} + WinExe + Properties + AnxSampleBrowser + AnxSampleBrowser + v4.0 + Client + 512 + + + x86 + true + full + false + ..\..\bin\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + Form + + + SampleBrowser.cs + + + + + + UserControl + + + SampleDataVisual.cs + + + SampleBrowser.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + SampleDataVisual.cs + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Tools/AnxSampleBrowser/Program.cs b/Tools/AnxSampleBrowser/Program.cs new file mode 100644 index 00000000..0253ea4e --- /dev/null +++ b/Tools/AnxSampleBrowser/Program.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; + +namespace AnxSampleBrowser +{ + static class Program + { + /// + /// Der Haupteinstiegspunkt für die Anwendung. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new AnxSampleBrowser()); + } + } +} diff --git a/Tools/AnxSampleBrowser/Properties/AssemblyInfo.cs b/Tools/AnxSampleBrowser/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..717dae79 --- /dev/null +++ b/Tools/AnxSampleBrowser/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Allgemeine Informationen über eine Assembly werden über die folgenden +// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +// die mit einer Assembly verknüpft sind. +[assembly: AssemblyTitle("ANX Sample Browser")] +[assembly: AssemblyDescription("This tool allows you to browse through the provided samples")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("ANX Developer Team")] +[assembly: AssemblyProduct("ANX Sample Browser")] +[assembly: AssemblyCopyright("Copyright © ANX Developer Team 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar +// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von +// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. +[assembly: ComVisible(false)] + +// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird +[assembly: Guid("1de3642f-9b54-4819-8bd5-18dce603c1b5")] + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern +// übernehmen, indem Sie "*" eingeben: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Tools/AnxSampleBrowser/Properties/Resources.Designer.cs b/Tools/AnxSampleBrowser/Properties/Resources.Designer.cs new file mode 100644 index 00000000..5ffae904 --- /dev/null +++ b/Tools/AnxSampleBrowser/Properties/Resources.Designer.cs @@ -0,0 +1,91 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.269 +// +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. +// +//------------------------------------------------------------------------------ + +namespace AnxSampleBrowser.Properties { + using System; + + + /// + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// + // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert + // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. + // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. + [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() { + } + + /// + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// + [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("AnxSampleBrowser.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + internal static System.Drawing.Bitmap ANX_Framework { + get { + object obj = ResourceManager.GetObject("ANX.Framework", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap button { + get { + object obj = ResourceManager.GetObject("button", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap header { + get { + object obj = ResourceManager.GetObject("header", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap sample1 { + get { + object obj = ResourceManager.GetObject("sample1", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/Tools/AnxSampleBrowser/Properties/Resources.resx b/Tools/AnxSampleBrowser/Properties/Resources.resx new file mode 100644 index 00000000..04912be1 --- /dev/null +++ b/Tools/AnxSampleBrowser/Properties/Resources.resx @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\ANX.Framework.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\header.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\button.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\sample1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/Tools/AnxSampleBrowser/Resources/ANX.Framework.png b/Tools/AnxSampleBrowser/Resources/ANX.Framework.png new file mode 100644 index 00000000..d3d63619 Binary files /dev/null and b/Tools/AnxSampleBrowser/Resources/ANX.Framework.png differ diff --git a/Tools/AnxSampleBrowser/Resources/button.png b/Tools/AnxSampleBrowser/Resources/button.png new file mode 100644 index 00000000..6aa5af52 Binary files /dev/null and b/Tools/AnxSampleBrowser/Resources/button.png differ diff --git a/Tools/AnxSampleBrowser/Resources/header.png b/Tools/AnxSampleBrowser/Resources/header.png new file mode 100644 index 00000000..86e052ee Binary files /dev/null and b/Tools/AnxSampleBrowser/Resources/header.png differ diff --git a/Tools/AnxSampleBrowser/Resources/sample1.png b/Tools/AnxSampleBrowser/Resources/sample1.png new file mode 100644 index 00000000..a7aa0ea1 Binary files /dev/null and b/Tools/AnxSampleBrowser/Resources/sample1.png differ diff --git a/Tools/AnxSampleBrowser/SampleBrowser.Designer.cs b/Tools/AnxSampleBrowser/SampleBrowser.Designer.cs new file mode 100644 index 00000000..113dc254 --- /dev/null +++ b/Tools/AnxSampleBrowser/SampleBrowser.Designer.cs @@ -0,0 +1,209 @@ +namespace AnxSampleBrowser +{ + partial class AnxSampleBrowser + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Windows Form-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this._pSamples = new System.Windows.Forms.Panel(); + this.panel1 = new System.Windows.Forms.Panel(); + this.panel2 = new System.Windows.Forms.Panel(); + this._lTitle = new System.Windows.Forms.Label(); + this._bClear = new System.Windows.Forms.Button(); + this._tSearch = new System.Windows.Forms.TextBox(); + this._bSearch = new System.Windows.Forms.Button(); + this.panel3 = new System.Windows.Forms.Panel(); + this._dCategories = new System.Windows.Forms.ComboBox(); + this._lCategorie = new System.Windows.Forms.Label(); + this._lFilter = new System.Windows.Forms.Label(); + this._cFilter = new System.Windows.Forms.CheckedListBox(); + this.panel1.SuspendLayout(); + this.panel3.SuspendLayout(); + this.SuspendLayout(); + // + // _pSamples + // + this._pSamples.AutoScroll = true; + this._pSamples.BackColor = System.Drawing.Color.Transparent; + this._pSamples.Location = new System.Drawing.Point(0, 56); + this._pSamples.Name = "_pSamples"; + this._pSamples.RightToLeft = System.Windows.Forms.RightToLeft.No; + this._pSamples.Size = new System.Drawing.Size(730, 470); + this._pSamples.TabIndex = 2; + // + // panel1 + // + this.panel1.BackColor = System.Drawing.Color.Maroon; + this.panel1.BackgroundImage = global::AnxSampleBrowser.Properties.Resources.header; + this.panel1.Controls.Add(this.panel2); + this.panel1.Controls.Add(this._lTitle); + this.panel1.Controls.Add(this._bClear); + this.panel1.Controls.Add(this._tSearch); + this.panel1.Controls.Add(this._bSearch); + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(936, 50); + this.panel1.TabIndex = 0; + // + // panel2 + // + this.panel2.BackColor = System.Drawing.Color.White; + this.panel2.BackgroundImage = global::AnxSampleBrowser.Properties.Resources.ANX_Framework; + this.panel2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.panel2.Location = new System.Drawing.Point(13, 4); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(119, 43); + this.panel2.TabIndex = 3; + // + // _lTitle + // + this._lTitle.AutoSize = true; + this._lTitle.BackColor = System.Drawing.Color.Transparent; + this._lTitle.Font = new System.Drawing.Font("Calibri", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this._lTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(157)))), ((int)(((byte)(23))))); + this._lTitle.Location = new System.Drawing.Point(138, 9); + this._lTitle.Name = "_lTitle"; + this._lTitle.Size = new System.Drawing.Size(213, 36); + this._lTitle.TabIndex = 2; + this._lTitle.Text = "Sample Browser"; + // + // _bClear + // + this._bClear.Location = new System.Drawing.Point(838, 12); + this._bClear.Name = "_bClear"; + this._bClear.Size = new System.Drawing.Size(84, 23); + this._bClear.TabIndex = 4; + this._bClear.Text = "Clear"; + this._bClear.UseVisualStyleBackColor = true; + this._bClear.Click += new System.EventHandler(this._bClear_Click); + // + // _tSearch + // + this._tSearch.Location = new System.Drawing.Point(567, 14); + this._tSearch.Name = "_tSearch"; + this._tSearch.Size = new System.Drawing.Size(159, 20); + this._tSearch.TabIndex = 1; + // + // _bSearch + // + this._bSearch.Location = new System.Drawing.Point(751, 12); + this._bSearch.Name = "_bSearch"; + this._bSearch.Size = new System.Drawing.Size(84, 23); + this._bSearch.TabIndex = 0; + this._bSearch.Text = "Search"; + this._bSearch.UseVisualStyleBackColor = true; + this._bSearch.Click += new System.EventHandler(this._bSearch_Click); + // + // panel3 + // + this.panel3.BackColor = System.Drawing.Color.Transparent; + this.panel3.Controls.Add(this._dCategories); + this.panel3.Controls.Add(this._lCategorie); + this.panel3.Controls.Add(this._lFilter); + this.panel3.Controls.Add(this._cFilter); + this.panel3.Location = new System.Drawing.Point(736, 40); + this.panel3.Name = "panel3"; + this.panel3.Size = new System.Drawing.Size(200, 486); + this.panel3.TabIndex = 1; + // + // _dCategories + // + this._dCategories.FormattingEnabled = true; + this._dCategories.Location = new System.Drawing.Point(15, 260); + this._dCategories.Name = "_dCategories"; + this._dCategories.Size = new System.Drawing.Size(171, 21); + this._dCategories.TabIndex = 3; + this._dCategories.SelectedIndexChanged += new System.EventHandler(this._dCategories_SelectedIndexChanged); + // + // _lCategorie + // + this._lCategorie.AutoSize = true; + this._lCategorie.BackColor = System.Drawing.Color.Transparent; + this._lCategorie.Font = new System.Drawing.Font("Calibri", 16F); + this._lCategorie.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(157)))), ((int)(((byte)(23))))); + this._lCategorie.Location = new System.Drawing.Point(3, 230); + this._lCategorie.Name = "_lCategorie"; + this._lCategorie.Size = new System.Drawing.Size(99, 27); + this._lCategorie.TabIndex = 2; + this._lCategorie.Text = "Categorie"; + // + // _lFilter + // + this._lFilter.AutoSize = true; + this._lFilter.BackColor = System.Drawing.Color.Transparent; + this._lFilter.Font = new System.Drawing.Font("Calibri", 16F); + this._lFilter.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(157)))), ((int)(((byte)(23))))); + this._lFilter.Location = new System.Drawing.Point(3, 17); + this._lFilter.Name = "_lFilter"; + this._lFilter.Size = new System.Drawing.Size(58, 27); + this._lFilter.TabIndex = 1; + this._lFilter.Text = "Filter"; + // + // _cFilter + // + this._cFilter.FormattingEnabled = true; + this._cFilter.Location = new System.Drawing.Point(15, 47); + this._cFilter.Name = "_cFilter"; + this._cFilter.Size = new System.Drawing.Size(171, 169); + this._cFilter.TabIndex = 0; + // + // AnxSampleBrowser + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.ButtonFace; + this.BackgroundImage = global::AnxSampleBrowser.Properties.Resources.header; + this.ClientSize = new System.Drawing.Size(934, 522); + this.Controls.Add(this._pSamples); + this.Controls.Add(this.panel1); + this.Controls.Add(this.panel3); + this.Name = "AnxSampleBrowser"; + this.Text = "Form1"; + this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); + this.panel3.ResumeLayout(false); + this.panel3.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.TextBox _tSearch; + private System.Windows.Forms.Button _bSearch; + private System.Windows.Forms.Panel panel3; + private System.Windows.Forms.Button _bClear; + private System.Windows.Forms.Label _lFilter; + private System.Windows.Forms.CheckedListBox _cFilter; + private System.Windows.Forms.Label _lTitle; + private System.Windows.Forms.Panel _pSamples; + private System.Windows.Forms.ComboBox _dCategories; + private System.Windows.Forms.Label _lCategorie; + } +} + diff --git a/Tools/AnxSampleBrowser/SampleBrowser.cs b/Tools/AnxSampleBrowser/SampleBrowser.cs new file mode 100644 index 00000000..8ff250d9 --- /dev/null +++ b/Tools/AnxSampleBrowser/SampleBrowser.cs @@ -0,0 +1,253 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.Xml; +using System.IO; + +namespace AnxSampleBrowser +{ + public partial class AnxSampleBrowser : Form + { + //list of all registered samples + private List _sampleAtlas; + public String SamplePath { get { return "../Samples/"; } } + + /// + /// Constructor of the browser + /// parses the xml and set up lists + /// + public AnxSampleBrowser() + { + + InitializeComponent(); + + //make the form fixed size + this.FormBorderStyle = FormBorderStyle.FixedDialog; + // Set the MaximizeBox to false to remove the maximize box. + this.MaximizeBox = false; + // Set the MinimizeBox to false to remove the minimize box. + this.MinimizeBox = false; + + //init sample list + _sampleAtlas = new List(); + //add default categorie (everything)... + _dCategories.Items.Add("all"); + //...and select it + _dCategories.SelectedIndex = 0; + _dCategories.DropDownStyle = ComboBoxStyle.DropDownList; + + //load out Samples.xml + parseXMl(); + + + + _cFilter.CheckOnClick = true; + for (int i = 0; i < _cFilter.Items.Count; ++i) + { + _cFilter.SetItemChecked(i, true); + } + this._cFilter.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this._cFilter_ItemCheck); + + + + + + + } + + protected override CreateParams CreateParams + { + get + { + CreateParams cp = base.CreateParams; + cp.ExStyle |= 0x02000000; + return cp; + } + } + + private void parseXMl() + { + XmlDocument sampleDescription = new XmlDocument(); + try + { + sampleDescription.Load(SamplePath+"SampleCatalog.xml"); + } + catch (FileNotFoundException ex) + { + OpenFileDialog openSampleXML = new OpenFileDialog(); + openSampleXML.Filter = "xml files (*.xml)|*.xml"; + openSampleXML.Title="Pick SampleCatalog.xml"; + if (openSampleXML.ShowDialog() == DialogResult.OK) + { + + sampleDescription.Load(openSampleXML.FileName); + } + else + { + MessageBox.Show("Samples.xml not found"); + this.Close(); + } + + } + XmlNode sampleRoot = sampleDescription.ChildNodes[1]; + + List _categorieAtlas = new List(); + + List _tagAtlas=new List(); + + foreach (XmlNode sample in sampleRoot.ChildNodes) + { + + SampleData data = new SampleData(){ + Name = sample["Name"].InnerText, + Description = sample["Description"].InnerText, + ExecPath = sample["ExecPath"].InnerText, + Categorie = sample["Categorie"].InnerText + }; + XmlNode imagePath = sample["ImagePath"]; + if (imagePath != null) + data.ImagePath = imagePath.InnerText; + else + data.ImagePath = ""; + data.Validate(); + if (!_categorieAtlas.Contains(sample["Categorie"].InnerText)) + _categorieAtlas.Add(sample["Categorie"].InnerText); + XmlNode tags = sample["Tags"]; + List dataTags=new List(); + foreach (XmlNode tag in tags.ChildNodes) + { + if (!_tagAtlas.Contains(tag.InnerText)) + _tagAtlas.Add(tag.InnerText); + dataTags.Add(tag.InnerText); + } + data.Tags = dataTags.ToArray(); + _sampleAtlas.Add(data); + addSampleDataVisual(data); + } + + _dCategories.Items.AddRange(_categorieAtlas.ToArray()); + + _cFilter.Items.AddRange(_tagAtlas.ToArray()); + + + } + + private void addAll() + { + _pSamples.Controls.Clear(); + foreach (SampleData data in _sampleAtlas) + { + addSampleDataVisual(data); + } + } + + private void addSampleDataVisual(SampleData data) + { + SampleDataVisual dataV = new SampleDataVisual(data,this); + dataV.Location = new Point(0, this._pSamples.Controls.Count * (dataV.Size.Height + 5)); + this._pSamples.Controls.Add(dataV); + } + + + private void search() + { + String[] phrases=_tSearch.Text.Split(new char[]{' ',',',';'}); + this._pSamples.Controls.Clear(); + foreach (SampleData data in _sampleAtlas) + { + bool add=false; + foreach (string phrase in phrases) + { + if (data.Name.Contains(phrase, StringComparison.OrdinalIgnoreCase) || + data.Description.Contains(phrase, StringComparison.OrdinalIgnoreCase) || + data.Categorie.Contains(phrase, StringComparison.OrdinalIgnoreCase)) + { + add = true; + break; + } + foreach (String tag in data.Tags) + { + if (tag.ToLower().Equals(phrase.ToLower())) + { + add = true; + break; + } + } + } + if (add) + addSampleDataVisual(data); + } + } + + private void pickCategorie() + { + _pSamples.Controls.Clear(); + foreach (SampleData data in _sampleAtlas) + { + if (data.Categorie.Equals(_dCategories.SelectedItem)) + addSampleDataVisual(data); + } + } + + private void filter() + { + _pSamples.Controls.Clear(); + foreach (SampleData data in _sampleAtlas) + { + foreach (String tag in data.Tags) + { + if (_cFilter.CheckedItems.Contains(tag)) + { + addSampleDataVisual(data); + break; + } + } + + } + } + + + private void _bSearch_Click(object sender, EventArgs e) + { + search(); + } + + private void _bClear_Click(object sender, EventArgs e) + { + this._tSearch.Text = ""; + addAll(); + } + + private void _dCategories_SelectedIndexChanged(object sender, EventArgs e) + { + if (_dCategories.Items.Count == 0) + return; + if (_dCategories.SelectedItem.Equals("all")) + addAll(); + else + pickCategorie(); + } + + private void _cFilter_ItemCheck(object sender, ItemCheckEventArgs e) + { + this.BeginInvoke((MethodInvoker)delegate { filter(); }); + } + + + + } + + static class StringExtender + { + public static bool Contains(this string source, string toCheck, StringComparison comp) + { + return source.IndexOf(toCheck, comp) >= 0; + } + } + +} diff --git a/Tools/AnxSampleBrowser/SampleBrowser.resx b/Tools/AnxSampleBrowser/SampleBrowser.resx new file mode 100644 index 00000000..29dcb1b3 --- /dev/null +++ b/Tools/AnxSampleBrowser/SampleBrowser.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Tools/AnxSampleBrowser/SampleData.cs b/Tools/AnxSampleBrowser/SampleData.cs new file mode 100644 index 00000000..1e5c1927 --- /dev/null +++ b/Tools/AnxSampleBrowser/SampleData.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace AnxSampleBrowser +{ + + public struct SampleData + { + public String Name { get; set; } + public String Description { get; set; } + public String ExecPath { get; set; } + public String ImagePath { get; set; } + public String Categorie { get; set; } + public String[] Tags { get; set; } + + + internal void Validate() + { + + + } + } +} diff --git a/Tools/AnxSampleBrowser/SampleDataVisual.Designer.cs b/Tools/AnxSampleBrowser/SampleDataVisual.Designer.cs new file mode 100644 index 00000000..67f82ab8 --- /dev/null +++ b/Tools/AnxSampleBrowser/SampleDataVisual.Designer.cs @@ -0,0 +1,105 @@ +namespace AnxSampleBrowser +{ + partial class SampleDataVisual + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Komponenten-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this._pImage = new System.Windows.Forms.PictureBox(); + this._lName = new System.Windows.Forms.Label(); + this._bLaunch = new System.Windows.Forms.Button(); + this._rDescription = new System.Windows.Forms.RichTextBox(); + ((System.ComponentModel.ISupportInitialize)(this._pImage)).BeginInit(); + this.SuspendLayout(); + // + // _pImage + // + this._pImage.ErrorImage = null; + this._pImage.ImageLocation = "0;0"; + this._pImage.Location = new System.Drawing.Point(481, 28); + this._pImage.Name = "_pImage"; + this._pImage.Size = new System.Drawing.Size(100, 100); + this._pImage.TabIndex = 0; + this._pImage.TabStop = false; + // + // _lName + // + this._lName.AutoSize = true; + this._lName.BackColor = System.Drawing.Color.Transparent; + this._lName.Font = new System.Drawing.Font("Calibri", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this._lName.Location = new System.Drawing.Point(3, 19); + this._lName.Name = "_lName"; + this._lName.Size = new System.Drawing.Size(64, 26); + this._lName.TabIndex = 1; + this._lName.Text = "label1"; + // + // _bLaunch + // + this._bLaunch.BackgroundImage = global::AnxSampleBrowser.Properties.Resources.button; + this._bLaunch.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this._bLaunch.Location = new System.Drawing.Point(587, 65); + this._bLaunch.Name = "_bLaunch"; + this._bLaunch.Size = new System.Drawing.Size(101, 26); + this._bLaunch.TabIndex = 2; + this._bLaunch.UseVisualStyleBackColor = true; + this._bLaunch.Click += new System.EventHandler(this._bLaunch_Click); + // + // _rDescription + // + this._rDescription.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(157)))), ((int)(((byte)(23))))); + this._rDescription.BorderStyle = System.Windows.Forms.BorderStyle.None; + this._rDescription.Font = new System.Drawing.Font("Calibri", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this._rDescription.Location = new System.Drawing.Point(8, 48); + this._rDescription.Name = "_rDescription"; + this._rDescription.Size = new System.Drawing.Size(452, 93); + this._rDescription.TabIndex = 3; + this._rDescription.Text = ""; + // + // SampleDataVisual + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackgroundImage = global::AnxSampleBrowser.Properties.Resources.sample1; + this.Controls.Add(this._pImage); + this.Controls.Add(this._rDescription); + this.Controls.Add(this._bLaunch); + this.Controls.Add(this._lName); + this.Name = "SampleDataVisual"; + this.Size = new System.Drawing.Size(700, 150); + ((System.ComponentModel.ISupportInitialize)(this._pImage)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.PictureBox _pImage; + private System.Windows.Forms.Label _lName; + private System.Windows.Forms.Button _bLaunch; + private System.Windows.Forms.RichTextBox _rDescription; + } +} diff --git a/Tools/AnxSampleBrowser/SampleDataVisual.cs b/Tools/AnxSampleBrowser/SampleDataVisual.cs new file mode 100644 index 00000000..1955c225 --- /dev/null +++ b/Tools/AnxSampleBrowser/SampleDataVisual.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.IO; + +namespace AnxSampleBrowser +{ + public partial class SampleDataVisual : UserControl + { + private SampleData _source; + private AnxSampleBrowser _parent; + + public SampleDataVisual(SampleData source,AnxSampleBrowser parent) + { + + InitializeComponent(); + //until error is gone + _pImage.Visible = false; + + _rDescription.ReadOnly = true; + _parent = parent; + _source = source; + + this._lName.Text = _source.Name; + this._rDescription.Text = _source.Description; + if (source.ImagePath.Length > 0) + { + Bitmap b = new Bitmap(source.ImagePath); + _pImage.Image = b; + + } + } + + private void _bLaunch_Click(object sender, EventArgs e) + { + try + { + System.Diagnostics.Process.Start(_parent.SamplePath + _source.ExecPath); + } + catch (Win32Exception ex) + { + MessageBox.Show("Can´t find the specified file at " + _parent.SamplePath + _source.ExecPath + '\n' + '\n' + '\n' + ex.Message,"Sample file not found"); + } + + } + + + + + } +} diff --git a/Tools/AnxSampleBrowser/SampleDataVisual.resx b/Tools/AnxSampleBrowser/SampleDataVisual.resx new file mode 100644 index 00000000..29dcb1b3 --- /dev/null +++ b/Tools/AnxSampleBrowser/SampleDataVisual.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file