From 28333a398173effcdf96204ce6cf1e62c6068c93 Mon Sep 17 00:00:00 2001 From: Tebjan Halm Date: Fri, 11 Nov 2011 21:43:41 +0100 Subject: [PATCH] added XMLOutput/XMLOutputTester.csproj to test the file writing --- Samples/XMLOutput/Form1.Designer.cs | 109 ++++++++++++++++ Samples/XMLOutput/Form1.cs | 60 +++++++++ Samples/XMLOutput/Form1.resx | 123 ++++++++++++++++++ Samples/XMLOutput/Program.cs | 21 +++ Samples/XMLOutput/Properties/AssemblyInfo.cs | 36 +++++ .../Properties/Resources.Designer.cs | 71 ++++++++++ Samples/XMLOutput/Properties/Resources.resx | 117 +++++++++++++++++ .../XMLOutput/Properties/Settings.Designer.cs | 30 +++++ .../XMLOutput/Properties/Settings.settings | 7 + Samples/XMLOutput/XMLOutputTester.csproj | 91 +++++++++++++ 10 files changed, 665 insertions(+) create mode 100644 Samples/XMLOutput/Form1.Designer.cs create mode 100644 Samples/XMLOutput/Form1.cs create mode 100644 Samples/XMLOutput/Form1.resx create mode 100644 Samples/XMLOutput/Program.cs create mode 100644 Samples/XMLOutput/Properties/AssemblyInfo.cs create mode 100644 Samples/XMLOutput/Properties/Resources.Designer.cs create mode 100644 Samples/XMLOutput/Properties/Resources.resx create mode 100644 Samples/XMLOutput/Properties/Settings.Designer.cs create mode 100644 Samples/XMLOutput/Properties/Settings.settings create mode 100644 Samples/XMLOutput/XMLOutputTester.csproj diff --git a/Samples/XMLOutput/Form1.Designer.cs b/Samples/XMLOutput/Form1.Designer.cs new file mode 100644 index 0000000..3b28322 --- /dev/null +++ b/Samples/XMLOutput/Form1.Designer.cs @@ -0,0 +1,109 @@ +namespace XMLOutputTester +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.textBox1 = new System.Windows.Forms.TextBox(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); + this.button1 = new System.Windows.Forms.Button(); + this.tableLayoutPanel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.SuspendLayout(); + // + // textBox1 + // + this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.textBox1.Location = new System.Drawing.Point(3, 3); + this.textBox1.Multiline = true; + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(470, 501); + this.textBox1.TabIndex = 0; + // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.ColumnCount = 2; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.58324F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 49.41676F)); + this.tableLayoutPanel1.Controls.Add(this.textBox1, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.pictureBox1, 1, 0); + this.tableLayoutPanel1.Controls.Add(this.button1, 0, 1); + this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + this.tableLayoutPanel1.RowCount = 2; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(943, 537); + this.tableLayoutPanel1.TabIndex = 1; + // + // pictureBox1 + // + this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.pictureBox1.Location = new System.Drawing.Point(479, 3); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(461, 501); + this.pictureBox1.TabIndex = 1; + this.pictureBox1.TabStop = false; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(3, 510); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(94, 23); + this.button1.TabIndex = 2; + this.button1.Text = "Save"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(943, 537); + this.Controls.Add(this.tableLayoutPanel1); + this.Name = "Form1"; + this.Text = "Form1"; + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.PictureBox pictureBox1; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.SaveFileDialog saveFileDialog1; + } +} + diff --git a/Samples/XMLOutput/Form1.cs b/Samples/XMLOutput/Form1.cs new file mode 100644 index 0000000..9a4dcfb --- /dev/null +++ b/Samples/XMLOutput/Form1.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.IO; +using System.Windows.Forms; +using Svg; +using System.Xml; +using Svg.Transforms; + +namespace XMLOutputTester +{ + public partial class Form1 : Form + { + private SvgDocument FSvgDoc; + + public Form1() + { + InitializeComponent(); + + + FSvgDoc = new SvgDocument + { + Width = 500, + Height = 500 + }; + + FSvgDoc.ViewBox = new SvgViewBox(-250, -250, 500, 500); + + var group = new SvgGroup(); + FSvgDoc.Children.Add(group); + + group.Children.Add(new SvgCircle + { + Radius = 100, + Fill = new SvgColourServer(Color.Red), + Stroke = new SvgColourServer(Color.Black), + StrokeWidth = 2 + }); + + var stream = new MemoryStream(); + FSvgDoc.Write(stream); + textBox1.Text = Encoding.UTF8.GetString(stream.GetBuffer()); + + pictureBox1.Image = FSvgDoc.Draw(); + } + + private void button1_Click(object sender, EventArgs e) + { + saveFileDialog1.Filter = "(SVG)|*.svg"; + if(saveFileDialog1.ShowDialog() == DialogResult.OK) + { + FSvgDoc.Write(saveFileDialog1.FileName); + } + } + } +} diff --git a/Samples/XMLOutput/Form1.resx b/Samples/XMLOutput/Form1.resx new file mode 100644 index 0000000..e06d131 --- /dev/null +++ b/Samples/XMLOutput/Form1.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/Samples/XMLOutput/Program.cs b/Samples/XMLOutput/Program.cs new file mode 100644 index 0000000..0c979d9 --- /dev/null +++ b/Samples/XMLOutput/Program.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; + +namespace XMLOutputTester +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/Samples/XMLOutput/Properties/AssemblyInfo.cs b/Samples/XMLOutput/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..5d5c24e --- /dev/null +++ b/Samples/XMLOutput/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +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("XMLOutputTester")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("XMLOutputTester")] +[assembly: AssemblyCopyright("Copyright © Microsoft 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("97db38e0-08e8-45c0-a4e3-b497681dcc34")] + +// 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")] diff --git a/Samples/XMLOutput/Properties/Resources.Designer.cs b/Samples/XMLOutput/Properties/Resources.Designer.cs new file mode 100644 index 0000000..effba4e --- /dev/null +++ b/Samples/XMLOutput/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.235 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace XMLOutputTester.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // 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() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("XMLOutputTester.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/Samples/XMLOutput/Properties/Resources.resx b/Samples/XMLOutput/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/Samples/XMLOutput/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Samples/XMLOutput/Properties/Settings.Designer.cs b/Samples/XMLOutput/Properties/Settings.Designer.cs new file mode 100644 index 0000000..b791edd --- /dev/null +++ b/Samples/XMLOutput/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.235 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace XMLOutputTester.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; + } + } + } +} diff --git a/Samples/XMLOutput/Properties/Settings.settings b/Samples/XMLOutput/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/Samples/XMLOutput/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/XMLOutput/XMLOutputTester.csproj b/Samples/XMLOutput/XMLOutputTester.csproj new file mode 100644 index 0000000..c097e56 --- /dev/null +++ b/Samples/XMLOutput/XMLOutputTester.csproj @@ -0,0 +1,91 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {8CEEB917-63E2-4AE7-B0D1-50A840050975} + WinExe + Properties + XMLOutputTester + XMLOutputTester + v3.5 + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + {886A98C5-37C0-4E8B-885E-30C1D2F98B47} + Svg + + + + + \ No newline at end of file -- GitLab