diff --git a/XamlImageConverter.Exe/Program.cs b/XamlImageConverter.Exe/Program.cs index 9897705..31c6640 100644 --- a/XamlImageConverter.Exe/Program.cs +++ b/XamlImageConverter.Exe/Program.cs @@ -24,11 +24,12 @@ public class Program { if (a.Count == 0 || new[] { "-h", "help", "-help", "?", "/?", "-?" }.Any(s => a.Any(at => s == at.Trim().ToLower()))) { Console.WriteLine("XamlImageConverter 3.5 by Chris Cavanagh & Simon Egli"); Console.WriteLine("Creates snapshots, gif animations or html image maps from XAML, SVG & PSD images\n\r"); - Console.Error.WriteLine("XamlImageConverter [-x] [-w] [-s [running time]] [-r] [-v]"); + Console.Error.WriteLine("XamlImageConverter [-x] [-w] [-1] [-s [running time]] [-r] [-v]"); Console.Error.WriteLine(" [-l librarypath] [-p projectpath] configFile { configFile }"); Console.Error.WriteLine("A configFile is a xaml batch file, describing an image conversion job."); Console.Error.WriteLine("Documentation for creating a configFile can be found at"); Console.Error.WriteLine(" http://xamlimageconverter.codeplex.com."); + Console.Error.WriteLine(" -1 option: Use only one cpu core."); Console.Error.WriteLine(" -w option: Wait for key at end."); Console.Error.WriteLine(" -s option: Run as server for the HttpHandler."); Console.Error.WriteLine(" (To support 3D xaml, that doesn't render under IIS)."); @@ -55,6 +56,12 @@ public class Program { a.Remove("-w"); waitForKey = true; } + bool manycore = true; + if (a.Contains("-1")) { + a.Remove("-1"); + manycore = false; + } + bool server = false; bool test = false; @@ -104,7 +111,7 @@ public class Program { List files = new List(); foreach (var f in a) { var appRoot = projectPath; - var file = f; + var file = f; if (appRoot.EndsWith("\\")) appRoot = appRoot.Substring(0, appRoot.Length - 1); file = file.Replace("~", appRoot) .Replace("/", "\\"); @@ -130,19 +137,21 @@ public class Program { compiler.LibraryPath = libraryPath; compiler.ProjectPath = projectPath; compiler.RebuildAll = rebuildAll; + compiler.Parallel = manycore; if (log) compiler.Loggers.Add(new FileLogger()); compiler.UseService = true; compiler.Compile(files); //cserver.Compile(compiler); }); } - cserver.Start(); + cserver.Start(); } else { var compiler = new Compiler(); compiler.LibraryPath = libraryPath; compiler.ProjectPath = projectPath; compiler.RebuildAll = rebuildAll; + compiler.Parallel = manycore; compiler.SeparateAppDomain = useAppDomain; if (log) compiler.Loggers.Add(new FileLogger()); compiler.Compile(files); diff --git a/XamlImageConverter.Exe/XamlImageConverter.Exe.csproj b/XamlImageConverter.Exe/XamlImageConverter.Exe.csproj index 41cc208..4ceaa93 100644 --- a/XamlImageConverter.Exe/XamlImageConverter.Exe.csproj +++ b/XamlImageConverter.Exe/XamlImageConverter.Exe.csproj @@ -116,26 +116,9 @@ - - - ASPXCodeBehind - - - - - - - - - - - - - ASPXCodeBehind - @@ -191,6 +174,9 @@ Designer + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/XamlImageConverter.Test.Web/XamlImageConverter.Demo/CreateImages.xic.xaml b/XamlImageConverter.Test.Web/XamlImageConverter.Demo/CreateImages.xic.xaml index 5f2f307..1c28196 100644 --- a/XamlImageConverter.Test.Web/XamlImageConverter.Demo/CreateImages.xic.xaml +++ b/XamlImageConverter.Test.Web/XamlImageConverter.Demo/CreateImages.xic.xaml @@ -35,6 +35,7 @@ + diff --git a/XamlImageConverter.Test.Web/XamlImageConverter.Demo/Planet.psd b/XamlImageConverter.Test.Web/XamlImageConverter.Demo/Planet.psd new file mode 100644 index 0000000..e9cc121 Binary files /dev/null and b/XamlImageConverter.Test.Web/XamlImageConverter.Demo/Planet.psd differ diff --git a/XamlImageConverter.Test.Web/XamlImageConverter.Demo/Readme.aspx b/XamlImageConverter.Test.Web/XamlImageConverter.Demo/Readme.aspx index b7cdff1..019d9ba 100644 --- a/XamlImageConverter.Test.Web/XamlImageConverter.Demo/Readme.aspx +++ b/XamlImageConverter.Test.Web/XamlImageConverter.Demo/Readme.aspx @@ -1,4 +1,4 @@ -<%@ Page Language="C#" %> +<%@ Page Language="C#" ValidateRequest="false" %> <%@ Import Namespace="System.Xml.Linq" %> <%@ Import Namespace="Silversite.Web.UI" %> @@ -18,20 +18,33 @@
+

A direct conversion of xaml => png

<img src="Homepage.xaml?png" runat="server" />

-

A conversion of multiple images with a batch script file, and of an animated gif.

+

A PDF of the above xaml

+
<a href="Homepage.xaml?pdf">Homepage PDF</a>
+ Homepage PDF +
+ +

Rendering of multiple images with a batch script file, and of an animated gif.

<img src="CreateImages.xic.xaml?Image=Images/Homepage/animated-loader.gif" runat="server" />

A html image map created from a svg source

This map was generated from "Map of USA with state names.svg". - Note that in the current version the font is not resolved correctly.

+ Note that in the current version the SVG font is not resolved correctly.

<asp:ImageMap ID="usamap" runat="server" ImageUrl="CreateImages.xic.xaml?Image=Images/Usa.Map.png" CssClass="map" />
+ and in CreateImages.xic.xaml: +
<xic:Snapshot Image="Usa.Map.png" >
+<xic:ImageMap ID="usamap" Image="Usa.Map.png" File="Readme.aspx" >
+  <HotSpots Elements="WA,OR,CA,AK,ID,NV,AZ,UT,MT,WY,CO,NM,TX,OK,KS,NE,SD,ND,MN,IA,MO,AR,LA,WI,IL,TN,MS,MI,IN,KY,AL,FL,GA,SC,NC,VA,WV,OH,PA,MD,NJ,NY,CT,MA,VT,NH,ME,RI,DE,HI" HotSpotMode="PostBack" PostBackValue="%ID%"/>
+</xic:ImageMap>
+			  
+ @@ -120,42 +133,40 @@
-

A PDF of the above homepage

-
<asp:HyperLink runat="server" NavigateUrl="Homepage.xaml?pdf">Homepage PDF</asp:HyperLink>
- Homepage PDF -
-

Conversion of 3D content doesn't work under IIS (only on IIS6).

+

Rendering of 3D content doesn't work under IIS (only on IIS6 & IISExpress, because IIS does not run in a user session and can't access video drivers).

<img src="Kaxaml.xaml?gif&Storyboard=rotate&Frames=50&Loop=0" runat="server" />
-

Conversion of 3D content doesn't work under IIS, so here is a precompiled version.

+

Rendering of 3D content doesn't work under IIS, so here is a precompiled version.

<img src="Kaxaml.gif" runat="server" />

Direct xaml in ASP.NET.

-

-			<asp:TextBox ID="buttontext" runat="server">I'm a button</asp:TextBox><asp:Button ID="Button1" runat="server" OnClick="Update" Text="Update" />
-			<xic:XamlImage ID="dynamicbutton" runat="server" ImageUrl="Images/XamlImage.png">
-				<Button>I'm a Button</Button>
-			</xic:XamlImage>
-			<script runat="server">
-				protected void Update(object sender, EventArgs e) {
-					var dynamicbutton = (XamlImage)Page.FindControl("dynamicbutton");
-					dynamicbutton.Xaml = string.Format("<Button>{0}</Button>", buttontext.Text);
-				}
-			</script>
+		
<asp:TextBox ID="buttontext" runat="server"Width="700" Height="100" TextMode="MultiLine"><Button>I'm a button</Button></asp:TextBox>
+<asp:Button runat="server" OnClick="Update" Text="Update" />
+<xic:XamlImage ID="dynamicbutton" runat="server" Image="Images/XamlImage.png" >
+  <Button>I'm a Button</Button>
+</xic:XamlImage>
+<script runat="server">
+  protected void Update(object sender, EventArgs e) {
+	 var dynamicbutton = (XamlImage)Page.FindControl("dynamicbutton");
+	 dynamicbutton.Content = buttontext.Text;
+  }
+</script>
 		
- I'm a button + <Button>I'm a button</Button>
+ You can also insert xaml tags here.
+
diff --git a/XamlImageConverter.Test.Web/XamlImageConverter.Demo/Usa.Map - Copy.html b/XamlImageConverter.Test.Web/XamlImageConverter.Demo/Usa.Map - Copy.html deleted file mode 100644 index 49163bf..0000000 --- a/XamlImageConverter.Test.Web/XamlImageConverter.Demo/Usa.Map - Copy.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - jQuery maphilight documentation - - - - - -

The United States of America

-

This map generated from "Map of USA with state names.svg".

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/XamlImageConverter.Test.Web/XamlImageConverter.Test.Web.csproj b/XamlImageConverter.Test.Web/XamlImageConverter.Test.Web.csproj index a74deb5..9f7bb5a 100644 --- a/XamlImageConverter.Test.Web/XamlImageConverter.Test.Web.csproj +++ b/XamlImageConverter.Test.Web/XamlImageConverter.Test.Web.csproj @@ -19,7 +19,7 @@ - false + true @@ -72,7 +72,6 @@ - @@ -120,6 +119,9 @@ XamlImageConverter + + + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) @@ -148,7 +150,7 @@ False 49592 / - http://localhost/XamlImageConverter.Test.Web + http://localhost:49592/ False False diff --git a/XamlImageConverter.VSIX/Demo/CreateImages.xic.xaml b/XamlImageConverter.VSIX/Demo/CreateImages.xic.xaml index 5f2f307..1c28196 100644 --- a/XamlImageConverter.VSIX/Demo/CreateImages.xic.xaml +++ b/XamlImageConverter.VSIX/Demo/CreateImages.xic.xaml @@ -35,6 +35,7 @@ + diff --git a/XamlImageConverter.VSIX/Demo/Readme.aspx b/XamlImageConverter.VSIX/Demo/Readme.aspx index 13ce596..ec84bf3 100644 --- a/XamlImageConverter.VSIX/Demo/Readme.aspx +++ b/XamlImageConverter.VSIX/Demo/Readme.aspx @@ -1,4 +1,4 @@ -<%@ Page Language="C#" %> +<%@ Page Language="C#" ValidateRequest="false" %> <%@ Import Namespace="System.Xml.Linq" %> <%@ Import Namespace="Silversite.Web.UI" %> @@ -21,6 +21,11 @@

A direct conversion of xaml > png

<img src="Homepage.xaml?png" runat="server" />
+
+ +

A PDF of the above xaml

+
<a href="Homepage.xaml?pdf">Homepage PDF</a>
+ Homepage PDF

A conversion of multiple images with a batch script file, and of an animated gif.

@@ -33,11 +38,6 @@ Note that in the current version the font is not resolved correctly.

<asp:ImageMap ID="usamap" runat="server" ImageUrl="CreateImages.xic.xamll?image=Images/Usa.Map.png" CssClass="map" />
-
- -

A PDF of the above homepage

-
<asp:HyperLink runat="server" NavigateUrl="Homepage.xaml?pdf">Homepage PDF</asp:HyperLink>
- Homepage PDF

Conversion of 3D content doesn't work under IIS (only on IIS6).

@@ -50,27 +50,29 @@

Direct xaml in ASP.NET.

-

-			<asp:TextBox ID="buttontext" runat="server">I'm a button</asp:TextBox><asp:Button ID="Button1" runat="server" OnClick="Update" Text="Update" />
-			<xic:XamlImage ID="dynamicbutton" runat="server" ImageUrl="~/XamlImageConverter.Demo/Images/XamlImage.png">
-				<Button>I'm a Button</Button>
-			</xic:XamlImage>
-			<script runat="server">
-				protected void Update(object sender, EventArgs e) {
-					var dynamicbutton = (XamlImage)Page.FindControl("dynamicbutton");
-					dynamicbutton.Xaml = string.Format("<Button>{0}</Button>", buttontext.Text);
-				}
-			</script>
+		
<asp:TextBox ID="buttontext" runat="server"Width="700" Height="100" TextMode="MultiLine"><Button>I'm a button</Button></asp:TextBox>
+<asp:Button runat="server" OnClick="Update" Text="Update" />
+<xic:XamlImage ID="dynamicbutton" runat="server" Image="Images/XamlImage.png" >
+  <Button>I'm a Button</Button>
+</xic:XamlImage>
+<script runat="server">
+  protected void Update(object sender, EventArgs e) {
+    var dynamicbutton = (XamlImage)Page.FindControl("dynamicbutton");
+    dynamicbutton.Content = buttontext.Text;
+  }
+</script>
 		
- - I'm a button - + + <Button>I'm a button</Button>
+ You can also insert xaml tags here.
+
+
diff --git a/XamlImageConverter.VSIX/ItemTemplates/CSharp/General/XamlImageConverterConfiguration.CSharp.zip b/XamlImageConverter.VSIX/ItemTemplates/CSharp/General/XamlImageConverterConfiguration.CSharp.zip index 4e81a79..79725b8 100644 Binary files a/XamlImageConverter.VSIX/ItemTemplates/CSharp/General/XamlImageConverterConfiguration.CSharp.zip and b/XamlImageConverter.VSIX/ItemTemplates/CSharp/General/XamlImageConverterConfiguration.CSharp.zip differ diff --git a/XamlImageConverter.VSIX/ItemTemplates/CSharp/Web/XamlImageConverterConfiguration.CSharp.zip b/XamlImageConverter.VSIX/ItemTemplates/CSharp/Web/XamlImageConverterConfiguration.CSharp.zip deleted file mode 100644 index cebaecc..0000000 Binary files a/XamlImageConverter.VSIX/ItemTemplates/CSharp/Web/XamlImageConverterConfiguration.CSharp.zip and /dev/null differ diff --git a/XamlImageConverter.VSIX/ItemTemplates/VisualBasic/General/XamlImageConverterConfiguration.VB.zip b/XamlImageConverter.VSIX/ItemTemplates/VisualBasic/General/XamlImageConverterConfiguration.VB.zip index 9d0d65e..4c4ffe3 100644 Binary files a/XamlImageConverter.VSIX/ItemTemplates/VisualBasic/General/XamlImageConverterConfiguration.VB.zip and b/XamlImageConverter.VSIX/ItemTemplates/VisualBasic/General/XamlImageConverterConfiguration.VB.zip differ diff --git a/XamlImageConverter.VSIX/ItemTemplates/VisualBasic/Web/XamlImageConverterConfiguration.VB.zip b/XamlImageConverter.VSIX/ItemTemplates/VisualBasic/Web/XamlImageConverterConfiguration.VB.zip deleted file mode 100644 index 46e1dfe..0000000 Binary files a/XamlImageConverter.VSIX/ItemTemplates/VisualBasic/Web/XamlImageConverterConfiguration.VB.zip and /dev/null differ diff --git a/XamlImageConverter.VSIX/Lazy/XamlImageConverter.dll b/XamlImageConverter.VSIX/Lazy/XamlImageConverter.dll deleted file mode 100644 index 1fa6fc0..0000000 Binary files a/XamlImageConverter.VSIX/Lazy/XamlImageConverter.dll and /dev/null differ diff --git a/XamlImageConverter.VSIX/Lazy/XamlImageConverter.pdb b/XamlImageConverter.VSIX/Lazy/XamlImageConverter.pdb deleted file mode 100644 index 1d01ed5..0000000 Binary files a/XamlImageConverter.VSIX/Lazy/XamlImageConverter.pdb and /dev/null differ diff --git a/XamlImageConverter.VSIX/Lazy/XamlImageConverter.targets b/XamlImageConverter.VSIX/Lazy/XamlImageConverter.targets deleted file mode 100644 index 69356fe..0000000 --- a/XamlImageConverter.VSIX/Lazy/XamlImageConverter.targets +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - XamlImageConverterPreCompiler;$(PrepareResourcesDependsOn) - $(CoreBuildDependsOn) - - - - - - - - @(CoreBuildDependsOnItems);XamlImageConverterPostCompiler;PostBuildEvent; - - - - - $(XamlImageConverterDependsOn) - $(XamlImageConverterDependsOn) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/XamlImageConverter.VSIX/Lazy/XamlImageConverter.xsd b/XamlImageConverter.VSIX/Lazy/XamlImageConverter.xsd deleted file mode 100644 index 8b0bcdb..0000000 --- a/XamlImageConverter.VSIX/Lazy/XamlImageConverter.xsd +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/XamlImageConverter.VSIX/Templates/ProjectItem/CreateImages.xic.xaml b/XamlImageConverter.VSIX/Templates/ProjectItem/CreateImages.xic.xaml index e5aade6..5ef79c6 100644 --- a/XamlImageConverter.VSIX/Templates/ProjectItem/CreateImages.xic.xaml +++ b/XamlImageConverter.VSIX/Templates/ProjectItem/CreateImages.xic.xaml @@ -12,12 +12,12 @@ \ No newline at end of file diff --git a/XamlImageConverter.VSIX/XamlImageConverter.ItemWizard.dll b/XamlImageConverter.VSIX/XamlImageConverter.ItemWizard.dll index fcf1f85..a88646d 100644 Binary files a/XamlImageConverter.VSIX/XamlImageConverter.ItemWizard.dll and b/XamlImageConverter.VSIX/XamlImageConverter.ItemWizard.dll differ diff --git a/XamlImageConverter.VSIX/XamlImageConverter.ItemWizard.pdb b/XamlImageConverter.VSIX/XamlImageConverter.ItemWizard.pdb index 2b58285..ffd8f3b 100644 Binary files a/XamlImageConverter.VSIX/XamlImageConverter.ItemWizard.pdb and b/XamlImageConverter.VSIX/XamlImageConverter.ItemWizard.pdb differ diff --git a/XamlImageConverter.VSIX/XamlImageConverter.VSIX.csproj b/XamlImageConverter.VSIX/XamlImageConverter.VSIX.csproj index 83364d8..7697cc8 100644 --- a/XamlImageConverter.VSIX/XamlImageConverter.VSIX.csproj +++ b/XamlImageConverter.VSIX/XamlImageConverter.VSIX.csproj @@ -80,139 +80,133 @@ - - True - True - XamlImageConverter.xsd - true true - - - - + true - + true - ASPXCodeBehind - + true - + true - + true - - ASPXCodeBehind - true - - - + true - + true - + true - + true - + true - + true - + true - + true - + true - + true - + true - + true - + true - + true - + true - + true - + true - + true - + true - + true - + + + + + + + true - + true + ASPXCodeBehind - + true - + true - + true - + + ASPXCodeBehind true - + + true - + true - + true - + true - - - + true - + true + @@ -222,15 +216,13 @@ true - - + Always + true + + + Always + true + --> Always true @@ -242,15 +234,6 @@ true - - MSDataSetGenerator - XamlImageConverter1.Designer.cs - Designer - true - - - XamlImageConverter.xsd - Designer @@ -272,8 +255,8 @@ @@ -303,9 +286,7 @@ - - - + $(ProjectDir)ItemTemplates\CSharp\General\XamlImageConverterConfiguration.CSharp.zip $(ProjectDir)ItemTemplates\VisualBasic\General\XamlImageConverterConfiguration.VB.zip @@ -321,7 +302,10 @@ - + + + + @@ -339,7 +323,7 @@ + Other similar extension points exist, see Microsoft.Common.targets. --> diff --git a/XamlImageConverter.VSIX/XamlImageConverter.Web.dll b/XamlImageConverter.VSIX/XamlImageConverter.Web.dll index 660d91e..7f407f1 100644 Binary files a/XamlImageConverter.VSIX/XamlImageConverter.Web.dll and b/XamlImageConverter.VSIX/XamlImageConverter.Web.dll differ diff --git a/XamlImageConverter.VSIX/XamlImageConverter.Web.pdb b/XamlImageConverter.VSIX/XamlImageConverter.Web.pdb index 890fb78..61f8cf5 100644 Binary files a/XamlImageConverter.VSIX/XamlImageConverter.Web.pdb and b/XamlImageConverter.VSIX/XamlImageConverter.Web.pdb differ diff --git a/XamlImageConverter.VSIX/XamlImageConverter.dll b/XamlImageConverter.VSIX/XamlImageConverter.dll index 17b75e2..708cff9 100644 Binary files a/XamlImageConverter.VSIX/XamlImageConverter.dll and b/XamlImageConverter.VSIX/XamlImageConverter.dll differ diff --git a/XamlImageConverter.VSIX/XamlImageConverter.pdb b/XamlImageConverter.VSIX/XamlImageConverter.pdb index 5171953..f8b886d 100644 Binary files a/XamlImageConverter.VSIX/XamlImageConverter.pdb and b/XamlImageConverter.VSIX/XamlImageConverter.pdb differ diff --git a/XamlImageConverter.VSIX/XamlImageConverter.xsd b/XamlImageConverter.VSIX/XamlImageConverter.xsd deleted file mode 100644 index 8b0bcdb..0000000 --- a/XamlImageConverter.VSIX/XamlImageConverter.xsd +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/XamlImageConverter.VSIX/XamlImageConverterConfiguration.CSharp.zip b/XamlImageConverter.VSIX/XamlImageConverterConfiguration.CSharp.zip deleted file mode 100644 index ce0d78e..0000000 Binary files a/XamlImageConverter.VSIX/XamlImageConverterConfiguration.CSharp.zip and /dev/null differ diff --git a/XamlImageConverter.VSIX/XamlImageConverterConfiguration.VB.zip b/XamlImageConverter.VSIX/XamlImageConverterConfiguration.VB.zip deleted file mode 100644 index 0a857b4..0000000 Binary files a/XamlImageConverter.VSIX/XamlImageConverterConfiguration.VB.zip and /dev/null differ diff --git a/XamlImageConverter.VSIX/source.extension.vsixmanifest b/XamlImageConverter.VSIX/source.extension.vsixmanifest index ee2307f..63a8dd1 100644 --- a/XamlImageConverter.VSIX/source.extension.vsixmanifest +++ b/XamlImageConverter.VSIX/source.extension.vsixmanifest @@ -36,52 +36,53 @@ Features: - psd2xaml\Endogine.Codecs.Flash.dll - Icon.ico - psd2xaml\Endogine.Codecs.Photoshop.dll - psd2xaml\Endogine.dll XamlImageConverter.dll XamlImageConverter.pdb XamlImageConverter.Web.dll XamlImageConverter.Web.pdb xiconvert.exe xiconvert.pdb - gxps\gxps-9.05-win32.exe - gxps\gxps-9.07-win32.exe - ImageMagick\atl100.dll - ImageMagick\colors.xml - ImageMagick\configure.xml - ImageMagick\convert.exe - ImageMagick\delegates.xml - ImageMagick\english.xml - ImageMagick\locale.xml - ImageMagick\log.xml - ImageMagick\magic.xml - ImageMagick\mfc100.dll - ImageMagick\mime.xml - ImageMagick\msvcp100.dll - ImageMagick\msvcr100.dll - ImageMagick\policy.xml - ImageMagick\sRGB.icc - ImageMagick\type.xml - ImageMagick\type-ghostscript.xml - ImageMagick\vcomp100.dll - XamlImageConverter.pdb - XamlImageConverter.targets + Lazy\psd2xaml\Endogine.Codecs.Flash.dll + Icon.ico + Lazy\psd2xaml\Endogine.Codecs.Photoshop.dll + Lazy\psd2xaml\Endogine.dll + Lazy\gxps\gxps-9.05-win32.exe + Lazy\gxps\gxps-9.07-win32.exe + Lazy\ImageMagick\atl100.dll + Lazy\ImageMagick\colors.xml + Lazy\ImageMagick\configure.xml + Lazy\ImageMagick\convert.exe + Lazy\ImageMagick\delegates.xml + Lazy\ImageMagick\english.xml + Lazy\ImageMagick\locale.xml + Lazy\ImageMagick\log.xml + Lazy\ImageMagick\magic.xml + Lazy\ImageMagick\mfc100.dll + Lazy\ImageMagick\mime.xml + Lazy\ImageMagick\msvcp100.dll + Lazy\ImageMagick\msvcr100.dll + Lazy\ImageMagick\policy.xml + Lazy\ImageMagick\sRGB.icc + Lazy\ImageMagick\type.xml + Lazy\ImageMagick\type-ghostscript.xml + Lazy\ImageMagick\vcomp100.dll + Lazy\XamlImageConverter.pdb + Lazy\XamlImageConverter.targets Demo\blog-banner.jpg + Demo\CreateImages.xic.xaml Demo\Default.aspx Demo\generic-lines.png Demo\Homepage.xaml Demo\jquery.js Demo\jquery.maphilight.min.js + Demo\Kaxaml.gif Demo\Kaxaml.xaml - Demo\CreateImages.xic.xaml + Demo\Planet.psd Demo\Readme.apsx Demo\Tux.svg Demo\Usa.Map.html Demo\Usa.Map.svg |XamlImageConverter.ItemWizard| - XamlImageConverter.xsd ItemTemplates diff --git a/XamlImageConverter.VSIX/convert.exe b/XamlImageConverter.VSIX/xiconvert.exe similarity index 88% rename from XamlImageConverter.VSIX/convert.exe rename to XamlImageConverter.VSIX/xiconvert.exe index 915a3e5..8dcf139 100644 Binary files a/XamlImageConverter.VSIX/convert.exe and b/XamlImageConverter.VSIX/xiconvert.exe differ diff --git a/XamlImageConverter.VSIX/convert.pdb b/XamlImageConverter.VSIX/xiconvert.pdb similarity index 61% rename from XamlImageConverter.VSIX/convert.pdb rename to XamlImageConverter.VSIX/xiconvert.pdb index 96154e1..4e43135 100644 Binary files a/XamlImageConverter.VSIX/convert.pdb and b/XamlImageConverter.VSIX/xiconvert.pdb differ diff --git a/XamlImageConverter.Web/Elements.cs b/XamlImageConverter.Web/Elements.cs index 264269c..7786bfb 100644 --- a/XamlImageConverter.Web/Elements.cs +++ b/XamlImageConverter.Web/Elements.cs @@ -92,6 +92,7 @@ public class Snapshot : Group { public string Theme { get; set; } public string Skin { get; set; } public string TextMode { get; set; } + public int? Layer { get; set; } } public interface IArea { } diff --git a/XamlImageConverter.Web/HttpHandler.cs b/XamlImageConverter.Web/HttpHandler.cs index 4280abd..0e3c068 100644 --- a/XamlImageConverter.Web/HttpHandler.cs +++ b/XamlImageConverter.Web/HttpHandler.cs @@ -15,6 +15,9 @@ public class XamlBuildCheck { [NonSerialized] public static XNamespace xic = "http://schemas.johnshope.com/XamlImageConverter/2012"; public static XNamespace sb = "http://www.chriscavanagh.com/SkinBuilder"; + public static XNamespace xamlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation"; + public static XNamespace xxamlns = "http://schemas.microsoft.com/winfx/2006/xaml"; + public static XNamespace ns; public DateTime nsVersion = DateTime.MinValue, Version = DateTime.MinValue; @@ -171,22 +174,30 @@ public class Group : IDisposable { var validAttributes = new string[] { "Element", "Storyboard", "Frames", "Filmstrip", "Dpi", "RenderDpi", "Quality", "Filename", "Left", "Top", "Right", "Bottom", "Width", "Height", "Cultures", "RenderTimeout", "Page", "FitToPage", "File", "Loop", "Pause", "Skin", "Theme", "Type", "Image" }; var type = "png"; - int h = 0; - bool addhash = false, nohash = false; + int? h = 0; + bool nohash = false; foreach (var key in parameters.Keys.ToList()) { - h += Hash.Compute(key + "=" + parameters[key]); + if (validAttributes.Any(a => a == key)) { if (key == "Image" || key == "File" || key == "Filename") nohash = true; else if (key == "Type") type = parameters["Type"]; + else { + h = (h ?? 0) + Hash.Compute(key + "=" + parameters[key]); + } e.SetAttributeValue(key, parameters[key]); parameters.Remove(key); - addhash = !nohash; + } else { + h = (h ?? 0) + Hash.Compute(key + "=" + parameters[key]); + if (key == "Source") parameters.Remove(key); } } - if (addhash) { + if (h != null && !nohash) { hash = h; - e.SetAttributeValue("Hash", h); + e.SetAttributeValue("Hash", hash); + } + if (!nohash && filename != null) { + e.SetAttributeValue("File", filename + "." + type); } foreach (var key in parameters.Keys.ToList()) { @@ -213,6 +224,7 @@ public class Group : IDisposable { if (filename.EndsWith(".xic.xaml")) return XElement.Load(InFilename(filename), LoadOptions.PreserveWhitespace | LoadOptions.SetBaseUri | LoadOptions.SetLineInfo); XElement snapshot; var res = new XElement(xic+"XamlImageConverter", + new XAttribute(XNamespace.Xmlns+"xic", xic.NamespaceName), new XElement(xic+"Scene", new XAttribute("Source", filename), snapshot = new XElement(xic+"Snapshot") @@ -226,18 +238,35 @@ public class Group : IDisposable { public XElement CreateDirect(string filename, XElement e, Dictionary parameters) { XElement scene; - if (e.Name == xic+"XamlImageConverter") return e; - var res = new XElement(xic+"XamlImageConverter", - scene = new XElement(xic+"Scene", new XElement(xic+"Xaml", e)) - ); - if (parameters.ContainsKey("Image") || parameters.ContainsKey("File") || parameters.ContainsKey("Filename") || parameters.ContainsKey("Type")) { - var snapshot = new XElement(xic+"Snapshot"); - ApplyParameters(filename, snapshot, parameters); - scene.Add(snapshot); + if (e.Name != xic + "XamlImageConverter") { + XNamespace mc = "http://schemas.openxmlformats.org/markup-compatibility/2006"; + var res = new XElement(xic + "XamlImageConverter", + new XAttribute("xmlns", xamlns), + new XAttribute(XNamespace.Xmlns + "x", xxamlns.NamespaceName), + new XAttribute(XNamespace.Xmlns + "xic", xic.NamespaceName), + new XAttribute(XNamespace.Xmlns + "mc", mc.NamespaceName), + new XAttribute(XNamespace.Xmlns + "d", "http://schemas.microsoft.com/expression/blend/2008"), + new XAttribute(mc + "Ignorable", "d"), + scene = new XElement(xic + "Scene", new XElement(xic + "Xaml", e)) + ); + if (e.Name.NamespaceName == "") { + e.Name = xamlns + e.Name.LocalName; + e.SetAttributeValue(XNamespace.Xmlns + "x", xxamlns.NamespaceName); + foreach (var child in e.Descendants()) { + if (child.Name.NamespaceName == "") child.Name = xamlns + child.Name.LocalName; + } + } + if (parameters.ContainsKey("Image") || parameters.ContainsKey("File") || parameters.ContainsKey("Filename") || parameters.ContainsKey("Type")) { + var snapshot = new XElement(xic + "Snapshot"); + ApplyParameters(filename, snapshot, parameters); + scene.Add(snapshot); + } + DynamicResult = true; + if (parameters.Count > 0) return Dynamic; + return res; + } else { + return e; } - DynamicResult = true; - if (parameters.Count > 0) return Dynamic; - return res; } public XElement CreateAxd(Dictionary par) { @@ -246,9 +275,10 @@ public class Group : IDisposable { DynamicResult = false; return Dynamic; } - if (src.Trim()[0] == '#') src = (string)HttpContext.Current.Session["XamlImageConverter.Xaml:" + src]; + if (src.Trim()[0] == '#') src = (string)HttpContext.Current.Session[src]; if (!src.Trim().StartsWith("<")) return CreateDirect(src, par); - return CreateDirect("~/Images/Cache/" + Hash.Compute(src).ToString("X"), XElement.Parse(src, LoadOptions.PreserveWhitespace | LoadOptions.SetBaseUri | LoadOptions.SetLineInfo), par); + + return CreateDirect("xic.axd", XElement.Parse(src, LoadOptions.PreserveWhitespace | LoadOptions.SetBaseUri | LoadOptions.SetLineInfo), par); } } @@ -303,10 +333,8 @@ public class Hash { } } } - #else - public class Hash: Silversite.Services.Hash { - } + public class Hash: Silversite.Services.Hash { } #endif #if Silversite @@ -316,10 +344,20 @@ public class Configuration : Silversite.Configuration.Section { public bool UseSevice { get { return (bool)(this["UseService"] ?? true); } set { this["UseService"] = value; } } [ConfigurationProperty("Log", IsRequired = false, DefaultValue = true)] public bool Log { get { return (bool)(this["Log"] ?? true); } set { this["Log"] = value; } } + [ConfigurationProperty("cache", IsRequired = false, DefaultValue = null)] + public string Cache { get { return (string)this["cache"]; } set { this["cache"] = value; } } + [ConfigurationProperty("separateDomain", IsRequired = false, DefaultValue = false)] + public bool SeparateDomain { get { return (bool)(this["separateDomain"] ?? false); } set { this["separateDomain"] = value; } } + [ConfigurationProperty("gcLevel", IsRequired = false, DefaultValue = 1)] + public int GCLevel { get { return (bool)(this["gcLevel"] ?? 1); } set { this["gcLevel"] = value; } } + [ConfigurationProperty("cores", IsRequired = false, DefaultValue = null)] + public int? Cores { get { return (int?)(this["cores"]); } set { this["cores"] = value; } } + [ConfigurationProperty("parallel", IsRequired = false, DefaultValue = false)] + public bool Parallel { get { return (bool)(this["parallel"] ?? false); } set { this["parallel"] = value; } } } #endif - public class XamlImageHandler : System.Web.IHttpHandler { + public class XamlImageHandler : System.Web.IHttpHandler, System.Web.SessionState.IReadOnlySessionState { #if Silversite public static Configuration Configuration = new Configuration(); @@ -341,7 +379,6 @@ public class XamlImageHandler : System.Web.IHttpHandler { handlerInfo.Load(); handler = handlerInfo.New(); #else - var a = Assembly.LoadFrom(context.Server.MapPath("~/Bin/Lazy/XamlImageConverter.dll")); var type = a.GetType("XamlImageConverter.XamlImageHandler"); handler = (System.Web.IHttpHandler)Activator.CreateInstance(type); @@ -355,6 +392,9 @@ public class XamlImageHandler : System.Web.IHttpHandler { context.Application.Lock(); context.Application["XamlImageConverter.Configuration.UseService"] = Configuration.UseService; context.Application["XamlImageConverter.Configuration.Log"] = Configuration.Log; + context.Application["XamlImageConverter.Configuration.Cache"] = Configuration.Cache; + context.Application["XamlImageConverter.Configuration.SeparateDomain"] = Configuration.SeparateDomain; + context.Application["XamlImageConverter.Configuration.GCLevel"] = Configuration.GCLevel; context.Application.UnLock(); #endif handler.ProcessRequest(context); diff --git a/XamlImageConverter.Web/XamlControls.cs b/XamlImageConverter.Web/XamlControls.cs index efa1fa4..841b496 100644 --- a/XamlImageConverter.Web/XamlControls.cs +++ b/XamlImageConverter.Web/XamlControls.cs @@ -14,18 +14,19 @@ namespace Silversite.Web.UI { [ToolboxData("<{0}:XamlImage runat=\"server\" />")] - [ParseChildren(ChildrenAsProperties = false, DefaultProperty="XamlContent")] + [ParseChildren(ChildrenAsProperties = false)] [PersistChildren(true)] public class XamlImage: Image { - XNamespace ns = "http://schemas.johnshope.com/XamlImageConverter/2012"; - XNamespace xaml ="http://schemas.microsoft.com/winfx/2006/xaml/presentation"; - XNamespace xamlx="http://schemas.microsoft.com/winfx/2006/xaml"; + static XNamespace xic = "http://schemas.johnshope.com/XamlImageConverter/2012"; + static XNamespace xaml ="http://schemas.microsoft.com/winfx/2006/xaml/presentation"; + static XNamespace xamlx="http://schemas.microsoft.com/winfx/2006/xaml"; + const string SessionPrefix = "#XamlImageConverter.Xaml:"; protected override void OnInit(EventArgs e) { base.OnInit(e); - if (XamlContent.Count == 1 && XamlContent[0] is Literal) { - Xaml = ((Literal)XamlContent[0]).Text; + if (Controls.Count == 1 && Controls[0] is LiteralControl) { + Content = ((LiteralControl)Controls[0]).Text; } } protected override void CreateChildControls() { @@ -41,74 +42,86 @@ public class XamlImage: Image { public int? Loops { get { return (int?)ViewState["Loops"]; } set { ViewState["Loops"] = value; } } public double? Pause { get { return (double?)ViewState["Pause"]; } set { ViewState["Pause"] = value; } } public int? Dpi { get { return (int?)ViewState["Dpi"]; } set { ViewState["Dpi"] = value; } } - - public Guid Guid { get { return (Guid)(ViewState["Guid"] ?? (Guid = new Guid())); } set { ViewState["Guid"] = value; } } + public string Parameters { get { return (string)ViewState["Parameters"]; } set { ViewState["Parameters"] = value; } } + public Guid Guid { get { return (Guid)(ViewState["Guid"] ?? (Guid = System.Guid.NewGuid())); } set { ViewState["Guid"] = value; } } + public string Type { get { return (string)ViewState["Type"]; } set { ViewState["Type"] = value; } } + public string Image { get { return ImageUrl; } set { ImageUrl = value; } } + string SessionID { get { return SessionPrefix + Guid.ToString(); } } XElement element = null; public XElement XElement { - get { return element ?? (element = new XElement(Xaml)); } + get { return element ?? (element = XElement.Parse(Content)); } set { using (var w = new StringWriter()) { value.Save(w , SaveOptions.OmitDuplicateNamespaces); - Xaml = w.ToString(); + Content = w.ToString(); } } } - public string Xaml { - get { return (string)Page.Session["XamlImageConverter.Xaml:#XamlImage" + Guid.ToString()]; } - set { - if (Page.Session["XamlImageConverter.Xaml:#XamlImage" + Guid.ToString()] != value) { - Page.Session["XamlImageConverter.Xaml:#XamlImage" + Guid.ToString()] = value; - element = null; - if (XElement.Name == ns + "XamlImageConverter") { - var snapshot = XElement.Descendants() - .FirstOrDefault(x => x.Name == ns + "Snapshot" && (string.IsNullOrEmpty(ImageUrl) || (string)x.Attribute("File") == ImageUrl || (string)x.Attribute("Filename") == ImageUrl)); - if (snapshot == null) { - snapshot = XElement.Descendants() - .FirstOrDefault(x => x.Name == ns + "Snapshot"); - ImageUrl = (string)(snapshot.Attribute("File") ?? snapshot.Attribute("Filename")); - } + public string Content { get; set; } + + string Url { + get { + var sb = new StringBuilder(); + sb.Append("xic.axd?Source="); sb.Append(HttpUtility.UrlEncode(SessionID)); + var e = XElement; + if (e.Name != xic+"XamlImageConverter") { + if (!string.IsNullOrEmpty(Storyboard)) { sb.Append("&Storyboard="); sb.Append(HttpUtility.UrlEncode(Storyboard)); } + if (!string.IsNullOrEmpty(Theme)) { sb.Append("&Theme="); sb.Append(HttpUtility.UrlEncode(Theme)); } + if (!string.IsNullOrEmpty(Skin)) { sb.Append("&Skin="); sb.Append(HttpUtility.UrlEncode(Skin)); } + if (!string.IsNullOrEmpty(Cultures)) { sb.Append("&Cultures="); sb.Append(HttpUtility.UrlEncode(Cultures)); } + if (Quality.HasValue) { sb.Append("&Quality="); sb.Append(Quality.Value); } + if (Loops.HasValue) { sb.Append("&Loops="); sb.Append(Loops.Value); } + if (Pause.HasValue) { sb.Append("&Pause="); sb.Append(Pause.Value); } + if (Dpi.HasValue) { sb.Append("&Dpi="); sb.Append(Dpi.Value); } + if (!string.IsNullOrEmpty(Type)) { sb.Append("&Type="); sb.Append(HttpUtility.UrlEncode(Type)); } + /*if (e.Name.NamespaceName == "") { + e.Name = xaml + e.Name.LocalName; + e.SetAttributeValue(XNamespace.Xmlns + "x", xamlx.NamespaceName); + } + var xml = new StringBuilder(); + using (var w = System.Xml.XmlWriter.Create(xml)) { + e.Save(w); + }*/ + Page.Session[SessionID] = Content.Trim(); //xml.ToString(); + } else { + Page.Session[SessionID] = Content.Trim(); + } + + foreach (var par in (Parameters ?? "").Split(new char[] { '&' }, StringSplitOptions.RemoveEmptyEntries)) { + sb.Append("&"); + if (par.Contains('=')) { + var tokens = par.Split('='); + sb.Append(tokens[0]); + sb.Append(HttpUtility.UrlEncode(tokens[1])); } else { - if (Storyboard != null) XElement.SetAttributeValue(ns + "Storyboard", Storyboard); - if (Theme != null) XElement.SetAttributeValue(ns + "Theme", Theme); - if (Skin != null) XElement.SetAttributeValue(ns + "Skin", Skin); - if (Cultures != null) XElement.SetAttributeValue(ns + "Cultures", Cultures); - if (TextMode != null) XElement.SetAttributeValue(ns + "TextMode", TextMode); - if (Quality != null) XElement.SetAttributeValue(ns + "Quality", Quality); - if (Loops != null) XElement.SetAttributeValue(ns + "Loops", Quality); - if (Pause != null) XElement.SetAttributeValue(ns + "Pause", Quality); - if (Dpi != null) XElement.SetAttributeValue(ns + "Dpi", Quality); - if (!string.IsNullOrEmpty(ImageUrl)) { - var namewhash = Path.GetFileNameWithoutExtension(ImageUrl); - var name = Path.GetFileNameWithoutExtension(namewhash); - var hashid = Path.GetExtension(namewhash); - int id = 0; - if (!int.TryParse(hashid, out id)) name = namewhash; - XElement.SetAttributeValue(ns + "File", "__XamlImageConverter.ImageUrl" + name); - var hash = Hash.Compute(XElement.ToString(SaveOptions.DisableFormatting | SaveOptions.OmitDuplicateNamespaces)); - ImageUrl = name + "." + hash + "." + Path.GetExtension(ImageUrl); - XElement.SetAttributeValue(ns + "File", ImageUrl); - } else if (!XElement.DescendantsAndSelf().Any(x => x.Attributes().Any(a => a.Name == ns + "Normal.View"))) { - XElement.SetAttributeValue(ns + "Normal.View", ""); - } - Page.Session["XamlImageConverter.Xaml:#XamlImage" + Guid.ToString()] = value = XElement.ToString(SaveOptions.OmitDuplicateNamespaces); + sb.Append(HttpUtility.UrlEncode(par)); } } + if (!string.IsNullOrEmpty(ImageUrl)) { + var hashsb = new StringBuilder(); + hashsb.Append(Storyboard ?? ""); + hashsb.Append(Theme ?? ""); + hashsb.Append(Skin ?? ""); + hashsb.Append(Cultures ?? ""); + hashsb.Append(Type ?? ""); + hashsb.Append(Content ?? ""); + var hash = Hash.Compute(hashsb.ToString()); + hash += 10*(Quality ?? 90) + 1000*(Loops ?? 1) + (int)(10000*(Pause??0)) + 100000*(Dpi??96); + sb.Append("&Image="); sb.Append(HttpUtility.UrlEncode(Path.ChangeExtension(ImageUrl, hash.ToString("X") + Path.GetExtension(ImageUrl)))); + } + return sb.ToString(); } } - public ControlCollection XamlContent { get; set; } - - public XamlImage() { XamlContent = new ControlCollection(this); } - protected override object SaveViewState() { return base.SaveViewState(); } protected override void Render(HtmlTextWriter writer) { var oldimage = ImageUrl; - ImageUrl = "xic.axd?Image=" + ImageUrl + "&Xaml=#XamlImage" + Guid.ToString(); + ImageUrl = Url; base.Render(writer); ImageUrl = oldimage; } diff --git a/XamlImageConverter.Web/XamlImageConverter.Web.csproj b/XamlImageConverter.Web/XamlImageConverter.Web.csproj index 80f0184..0fc5fa3 100644 --- a/XamlImageConverter.Web/XamlImageConverter.Web.csproj +++ b/XamlImageConverter.Web/XamlImageConverter.Web.csproj @@ -11,6 +11,7 @@ XamlImageConverter.Web v4.5 512 + true @@ -20,6 +21,7 @@ DEBUG;TRACE prompt 4 + false pdbonly @@ -28,6 +30,7 @@ TRACE prompt 4 + false true diff --git a/XamlImageConverter/CompilerTask.cs b/XamlImageConverter/CompilerTask.cs index 66a5199..1283e44 100644 --- a/XamlImageConverter/CompilerTask.cs +++ b/XamlImageConverter/CompilerTask.cs @@ -69,6 +69,8 @@ public class XamlImageConverter: Task { compiler.LibraryPath = LibraryPath; compiler.Loggers.Add(new Logger(Log)); compiler.SeparateAppDomain = true; + compiler.Parallel = true; + compiler.GCLevel = 0; compiler.Compile(); return !Log.HasLoggedErrors; diff --git a/XamlImageConverter/Lazy/XamlImageConverter.Designer.cs b/XamlImageConverter/Lazy/XamlImageConverter.Designer.cs new file mode 100644 index 0000000..1da99cc --- /dev/null +++ b/XamlImageConverter/Lazy/XamlImageConverter.Designer.cs @@ -0,0 +1,3606 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18033 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 + +namespace XamlImageConverter.Lazy { + + + /// + ///Represents a strongly typed in-memory cache of data. + /// + [global::System.Serializable()] + [global::System.ComponentModel.DesignerCategoryAttribute("code")] + [global::System.ComponentModel.ToolboxItem(true)] + [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")] + [global::System.Xml.Serialization.XmlRootAttribute("XamlImageConverter")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")] + public partial class XamlImageConverter : global::System.Data.DataSet { + + private SceneDataTable tableScene; + + private XamlDataTable tableXaml; + + private GroupDataTable tableGroup; + + private SnapshotDataTable tableSnapshot; + + private global::System.Data.DataRelation relationScene_Xaml; + + private global::System.Data.DataRelation relationScene_Group; + + private global::System.Data.DataRelation relationGroup_Snapshot; + + private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public XamlImageConverter() { + this.BeginInit(); + this.InitClass(); + global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged); + base.Tables.CollectionChanged += schemaChangedHandler; + base.Relations.CollectionChanged += schemaChangedHandler; + this.EndInit(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected XamlImageConverter(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : + base(info, context, false) { + if ((this.IsBinarySerialized(info, context) == true)) { + this.InitVars(false); + global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged); + this.Tables.CollectionChanged += schemaChangedHandler1; + this.Relations.CollectionChanged += schemaChangedHandler1; + return; + } + string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string)))); + if ((this.DetermineSchemaSerializationMode(info, context) == global::System.Data.SchemaSerializationMode.IncludeSchema)) { + global::System.Data.DataSet ds = new global::System.Data.DataSet(); + ds.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema))); + if ((ds.Tables["Scene"] != null)) { + base.Tables.Add(new SceneDataTable(ds.Tables["Scene"])); + } + if ((ds.Tables["Xaml"] != null)) { + base.Tables.Add(new XamlDataTable(ds.Tables["Xaml"])); + } + if ((ds.Tables["Group"] != null)) { + base.Tables.Add(new GroupDataTable(ds.Tables["Group"])); + } + if ((ds.Tables["Snapshot"] != null)) { + base.Tables.Add(new SnapshotDataTable(ds.Tables["Snapshot"])); + } + this.DataSetName = ds.DataSetName; + this.Prefix = ds.Prefix; + this.Namespace = ds.Namespace; + this.Locale = ds.Locale; + this.CaseSensitive = ds.CaseSensitive; + this.EnforceConstraints = ds.EnforceConstraints; + this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add); + this.InitVars(); + } + else { + this.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema))); + } + this.GetSerializationData(info, context); + global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged); + base.Tables.CollectionChanged += schemaChangedHandler; + this.Relations.CollectionChanged += schemaChangedHandler; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] + public SceneDataTable Scene { + get { + return this.tableScene; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] + public XamlDataTable Xaml { + get { + return this.tableXaml; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] + public GroupDataTable Group { + get { + return this.tableGroup; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] + public SnapshotDataTable Snapshot { + get { + return this.tableSnapshot; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.BrowsableAttribute(true)] + [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Visible)] + public override global::System.Data.SchemaSerializationMode SchemaSerializationMode { + get { + return this._schemaSerializationMode; + } + set { + this._schemaSerializationMode = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public new global::System.Data.DataTableCollection Tables { + get { + return base.Tables; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public new global::System.Data.DataRelationCollection Relations { + get { + return base.Relations; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void InitializeDerivedDataSet() { + this.BeginInit(); + this.InitClass(); + this.EndInit(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public override global::System.Data.DataSet Clone() { + XamlImageConverter cln = ((XamlImageConverter)(base.Clone())); + cln.InitVars(); + cln.SchemaSerializationMode = this.SchemaSerializationMode; + return cln; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override bool ShouldSerializeTables() { + return false; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override bool ShouldSerializeRelations() { + return false; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void ReadXmlSerializable(global::System.Xml.XmlReader reader) { + if ((this.DetermineSchemaSerializationMode(reader) == global::System.Data.SchemaSerializationMode.IncludeSchema)) { + this.Reset(); + global::System.Data.DataSet ds = new global::System.Data.DataSet(); + ds.ReadXml(reader); + if ((ds.Tables["Scene"] != null)) { + base.Tables.Add(new SceneDataTable(ds.Tables["Scene"])); + } + if ((ds.Tables["Xaml"] != null)) { + base.Tables.Add(new XamlDataTable(ds.Tables["Xaml"])); + } + if ((ds.Tables["Group"] != null)) { + base.Tables.Add(new GroupDataTable(ds.Tables["Group"])); + } + if ((ds.Tables["Snapshot"] != null)) { + base.Tables.Add(new SnapshotDataTable(ds.Tables["Snapshot"])); + } + this.DataSetName = ds.DataSetName; + this.Prefix = ds.Prefix; + this.Namespace = ds.Namespace; + this.Locale = ds.Locale; + this.CaseSensitive = ds.CaseSensitive; + this.EnforceConstraints = ds.EnforceConstraints; + this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add); + this.InitVars(); + } + else { + this.ReadXml(reader); + this.InitVars(); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Xml.Schema.XmlSchema GetSchemaSerializable() { + global::System.IO.MemoryStream stream = new global::System.IO.MemoryStream(); + this.WriteXmlSchema(new global::System.Xml.XmlTextWriter(stream, null)); + stream.Position = 0; + return global::System.Xml.Schema.XmlSchema.Read(new global::System.Xml.XmlTextReader(stream), null); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal void InitVars() { + this.InitVars(true); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal void InitVars(bool initTable) { + this.tableScene = ((SceneDataTable)(base.Tables["Scene"])); + if ((initTable == true)) { + if ((this.tableScene != null)) { + this.tableScene.InitVars(); + } + } + this.tableXaml = ((XamlDataTable)(base.Tables["Xaml"])); + if ((initTable == true)) { + if ((this.tableXaml != null)) { + this.tableXaml.InitVars(); + } + } + this.tableGroup = ((GroupDataTable)(base.Tables["Group"])); + if ((initTable == true)) { + if ((this.tableGroup != null)) { + this.tableGroup.InitVars(); + } + } + this.tableSnapshot = ((SnapshotDataTable)(base.Tables["Snapshot"])); + if ((initTable == true)) { + if ((this.tableSnapshot != null)) { + this.tableSnapshot.InitVars(); + } + } + this.relationScene_Xaml = this.Relations["Scene_Xaml"]; + this.relationScene_Group = this.Relations["Scene_Group"]; + this.relationGroup_Snapshot = this.Relations["Group_Snapshot"]; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitClass() { + this.DataSetName = "XamlImageConverter"; + this.Prefix = "xic"; + this.Namespace = "http://schemas.johnshope.com/XamlImageConverter/2012"; + this.EnforceConstraints = true; + this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema; + this.tableScene = new SceneDataTable(); + base.Tables.Add(this.tableScene); + this.tableXaml = new XamlDataTable(); + base.Tables.Add(this.tableXaml); + this.tableGroup = new GroupDataTable(); + base.Tables.Add(this.tableGroup); + this.tableSnapshot = new SnapshotDataTable(); + base.Tables.Add(this.tableSnapshot); + global::System.Data.ForeignKeyConstraint fkc; + fkc = new global::System.Data.ForeignKeyConstraint("Scene_Xaml", new global::System.Data.DataColumn[] { + this.tableScene.Scene_IdColumn}, new global::System.Data.DataColumn[] { + this.tableXaml.Scene_IdColumn}); + this.tableXaml.Constraints.Add(fkc); + fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None; + fkc.DeleteRule = global::System.Data.Rule.Cascade; + fkc.UpdateRule = global::System.Data.Rule.Cascade; + fkc = new global::System.Data.ForeignKeyConstraint("Scene_Group", new global::System.Data.DataColumn[] { + this.tableScene.Scene_IdColumn}, new global::System.Data.DataColumn[] { + this.tableGroup.Scene_IdColumn}); + this.tableGroup.Constraints.Add(fkc); + fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None; + fkc.DeleteRule = global::System.Data.Rule.Cascade; + fkc.UpdateRule = global::System.Data.Rule.Cascade; + fkc = new global::System.Data.ForeignKeyConstraint("Group_Snapshot", new global::System.Data.DataColumn[] { + this.tableGroup.Group_IdColumn}, new global::System.Data.DataColumn[] { + this.tableSnapshot.Group_IdColumn}); + this.tableSnapshot.Constraints.Add(fkc); + fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None; + fkc.DeleteRule = global::System.Data.Rule.Cascade; + fkc.UpdateRule = global::System.Data.Rule.Cascade; + this.relationScene_Xaml = new global::System.Data.DataRelation("Scene_Xaml", new global::System.Data.DataColumn[] { + this.tableScene.Scene_IdColumn}, new global::System.Data.DataColumn[] { + this.tableXaml.Scene_IdColumn}, false); + this.relationScene_Xaml.Nested = true; + this.Relations.Add(this.relationScene_Xaml); + this.relationScene_Group = new global::System.Data.DataRelation("Scene_Group", new global::System.Data.DataColumn[] { + this.tableScene.Scene_IdColumn}, new global::System.Data.DataColumn[] { + this.tableGroup.Scene_IdColumn}, false); + this.relationScene_Group.Nested = true; + this.Relations.Add(this.relationScene_Group); + this.relationGroup_Snapshot = new global::System.Data.DataRelation("Group_Snapshot", new global::System.Data.DataColumn[] { + this.tableGroup.Group_IdColumn}, new global::System.Data.DataColumn[] { + this.tableSnapshot.Group_IdColumn}, false); + this.relationGroup_Snapshot.Nested = true; + this.Relations.Add(this.relationGroup_Snapshot); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private bool ShouldSerializeScene() { + return false; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private bool ShouldSerializeXaml() { + return false; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private bool ShouldSerializeGroup() { + return false; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private bool ShouldSerializeSnapshot() { + return false; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void SchemaChanged(object sender, global::System.ComponentModel.CollectionChangeEventArgs e) { + if ((e.Action == global::System.ComponentModel.CollectionChangeAction.Remove)) { + this.InitVars(); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) { + XamlImageConverter ds = new XamlImageConverter(); + global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); + global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); + global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny(); + any.Namespace = ds.Namespace; + sequence.Items.Add(any); + type.Particle = sequence; + global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); + if (xs.Contains(dsSchema.TargetNamespace)) { + global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); + global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); + try { + global::System.Xml.Schema.XmlSchema schema = null; + dsSchema.Write(s1); + for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) { + schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); + s2.SetLength(0); + schema.Write(s2); + if ((s1.Length == s2.Length)) { + s1.Position = 0; + s2.Position = 0; + for (; ((s1.Position != s1.Length) + && (s1.ReadByte() == s2.ReadByte())); ) { + ; + } + if ((s1.Position == s1.Length)) { + return type; + } + } + } + } + finally { + if ((s1 != null)) { + s1.Close(); + } + if ((s2 != null)) { + s2.Close(); + } + } + } + xs.Add(dsSchema); + return type; + } + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public delegate void SceneRowChangeEventHandler(object sender, SceneRowChangeEvent e); + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public delegate void XamlRowChangeEventHandler(object sender, XamlRowChangeEvent e); + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public delegate void GroupRowChangeEventHandler(object sender, GroupRowChangeEvent e); + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public delegate void SnapshotRowChangeEventHandler(object sender, SnapshotRowChangeEvent e); + + /// + ///Represents the strongly named DataTable class. + /// + [global::System.Serializable()] + [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] + public partial class SceneDataTable : global::System.Data.TypedTableBase { + + private global::System.Data.DataColumn columnOutputPath; + + private global::System.Data.DataColumn columnFile; + + private global::System.Data.DataColumn columnType; + + private global::System.Data.DataColumn columnAssembly; + + private global::System.Data.DataColumn columnSource; + + private global::System.Data.DataColumn columnScene_Id; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public SceneDataTable() { + this.TableName = "Scene"; + this.BeginInit(); + this.InitClass(); + this.EndInit(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal SceneDataTable(global::System.Data.DataTable table) { + this.TableName = table.TableName; + if ((table.CaseSensitive != table.DataSet.CaseSensitive)) { + this.CaseSensitive = table.CaseSensitive; + } + if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) { + this.Locale = table.Locale; + } + if ((table.Namespace != table.DataSet.Namespace)) { + this.Namespace = table.Namespace; + } + this.Prefix = table.Prefix; + this.MinimumCapacity = table.MinimumCapacity; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected SceneDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : + base(info, context) { + this.InitVars(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn OutputPathColumn { + get { + return this.columnOutputPath; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn FileColumn { + get { + return this.columnFile; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn TypeColumn { + get { + return this.columnType; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn AssemblyColumn { + get { + return this.columnAssembly; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn SourceColumn { + get { + return this.columnSource; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn Scene_IdColumn { + get { + return this.columnScene_Id; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + public int Count { + get { + return this.Rows.Count; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public SceneRow this[int index] { + get { + return ((SceneRow)(this.Rows[index])); + } + } + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event SceneRowChangeEventHandler SceneRowChanging; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event SceneRowChangeEventHandler SceneRowChanged; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event SceneRowChangeEventHandler SceneRowDeleting; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event SceneRowChangeEventHandler SceneRowDeleted; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void AddSceneRow(SceneRow row) { + this.Rows.Add(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public SceneRow AddSceneRow(string OutputPath, string File, string Type, string Assembly, string Source) { + SceneRow rowSceneRow = ((SceneRow)(this.NewRow())); + object[] columnValuesArray = new object[] { + OutputPath, + File, + Type, + Assembly, + Source, + null}; + rowSceneRow.ItemArray = columnValuesArray; + this.Rows.Add(rowSceneRow); + return rowSceneRow; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public override global::System.Data.DataTable Clone() { + SceneDataTable cln = ((SceneDataTable)(base.Clone())); + cln.InitVars(); + return cln; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Data.DataTable CreateInstance() { + return new SceneDataTable(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal void InitVars() { + this.columnOutputPath = base.Columns["OutputPath"]; + this.columnFile = base.Columns["File"]; + this.columnType = base.Columns["Type"]; + this.columnAssembly = base.Columns["Assembly"]; + this.columnSource = base.Columns["Source"]; + this.columnScene_Id = base.Columns["Scene_Id"]; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitClass() { + this.columnOutputPath = new global::System.Data.DataColumn("OutputPath", typeof(string), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnOutputPath); + this.columnFile = new global::System.Data.DataColumn("File", typeof(string), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnFile); + this.columnType = new global::System.Data.DataColumn("Type", typeof(string), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnType); + this.columnAssembly = new global::System.Data.DataColumn("Assembly", typeof(string), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnAssembly); + this.columnSource = new global::System.Data.DataColumn("Source", typeof(string), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnSource); + this.columnScene_Id = new global::System.Data.DataColumn("Scene_Id", typeof(int), null, global::System.Data.MappingType.Hidden); + base.Columns.Add(this.columnScene_Id); + this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] { + this.columnScene_Id}, true)); + this.columnOutputPath.Namespace = ""; + this.columnFile.Namespace = ""; + this.columnType.Namespace = ""; + this.columnAssembly.Namespace = ""; + this.columnSource.Namespace = ""; + this.columnScene_Id.AutoIncrement = true; + this.columnScene_Id.AllowDBNull = false; + this.columnScene_Id.Unique = true; + this.columnScene_Id.Prefix = "xic"; + this.Prefix = "xic"; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public SceneRow NewSceneRow() { + return ((SceneRow)(this.NewRow())); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { + return new SceneRow(builder); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Type GetRowType() { + return typeof(SceneRow); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanged(e); + if ((this.SceneRowChanged != null)) { + this.SceneRowChanged(this, new SceneRowChangeEvent(((SceneRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanging(e); + if ((this.SceneRowChanging != null)) { + this.SceneRowChanging(this, new SceneRowChangeEvent(((SceneRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleted(e); + if ((this.SceneRowDeleted != null)) { + this.SceneRowDeleted(this, new SceneRowChangeEvent(((SceneRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleting(e); + if ((this.SceneRowDeleting != null)) { + this.SceneRowDeleting(this, new SceneRowChangeEvent(((SceneRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void RemoveSceneRow(SceneRow row) { + this.Rows.Remove(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { + global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); + global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); + XamlImageConverter ds = new XamlImageConverter(); + global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); + any1.Namespace = "http://www.w3.org/2001/XMLSchema"; + any1.MinOccurs = new decimal(0); + any1.MaxOccurs = decimal.MaxValue; + any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; + sequence.Items.Add(any1); + global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); + any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; + any2.MinOccurs = new decimal(1); + any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; + sequence.Items.Add(any2); + global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); + attribute1.Name = "namespace"; + attribute1.FixedValue = ds.Namespace; + type.Attributes.Add(attribute1); + global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); + attribute2.Name = "tableTypeName"; + attribute2.FixedValue = "SceneDataTable"; + type.Attributes.Add(attribute2); + type.Particle = sequence; + global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); + if (xs.Contains(dsSchema.TargetNamespace)) { + global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); + global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); + try { + global::System.Xml.Schema.XmlSchema schema = null; + dsSchema.Write(s1); + for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) { + schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); + s2.SetLength(0); + schema.Write(s2); + if ((s1.Length == s2.Length)) { + s1.Position = 0; + s2.Position = 0; + for (; ((s1.Position != s1.Length) + && (s1.ReadByte() == s2.ReadByte())); ) { + ; + } + if ((s1.Position == s1.Length)) { + return type; + } + } + } + } + finally { + if ((s1 != null)) { + s1.Close(); + } + if ((s2 != null)) { + s2.Close(); + } + } + } + xs.Add(dsSchema); + return type; + } + } + + /// + ///Represents the strongly named DataTable class. + /// + [global::System.Serializable()] + [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] + public partial class XamlDataTable : global::System.Data.TypedTableBase { + + private global::System.Data.DataColumn columnFile; + + private global::System.Data.DataColumn columnType; + + private global::System.Data.DataColumn columnAssembly; + + private global::System.Data.DataColumn columnSource; + + private global::System.Data.DataColumn columnScene_Id; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public XamlDataTable() { + this.TableName = "Xaml"; + this.BeginInit(); + this.InitClass(); + this.EndInit(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal XamlDataTable(global::System.Data.DataTable table) { + this.TableName = table.TableName; + if ((table.CaseSensitive != table.DataSet.CaseSensitive)) { + this.CaseSensitive = table.CaseSensitive; + } + if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) { + this.Locale = table.Locale; + } + if ((table.Namespace != table.DataSet.Namespace)) { + this.Namespace = table.Namespace; + } + this.Prefix = table.Prefix; + this.MinimumCapacity = table.MinimumCapacity; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected XamlDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : + base(info, context) { + this.InitVars(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn FileColumn { + get { + return this.columnFile; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn TypeColumn { + get { + return this.columnType; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn AssemblyColumn { + get { + return this.columnAssembly; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn SourceColumn { + get { + return this.columnSource; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn Scene_IdColumn { + get { + return this.columnScene_Id; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + public int Count { + get { + return this.Rows.Count; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public XamlRow this[int index] { + get { + return ((XamlRow)(this.Rows[index])); + } + } + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event XamlRowChangeEventHandler XamlRowChanging; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event XamlRowChangeEventHandler XamlRowChanged; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event XamlRowChangeEventHandler XamlRowDeleting; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event XamlRowChangeEventHandler XamlRowDeleted; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void AddXamlRow(XamlRow row) { + this.Rows.Add(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public XamlRow AddXamlRow(string File, string Type, string Assembly, string Source, SceneRow parentSceneRowByScene_Xaml) { + XamlRow rowXamlRow = ((XamlRow)(this.NewRow())); + object[] columnValuesArray = new object[] { + File, + Type, + Assembly, + Source, + null}; + if ((parentSceneRowByScene_Xaml != null)) { + columnValuesArray[4] = parentSceneRowByScene_Xaml[5]; + } + rowXamlRow.ItemArray = columnValuesArray; + this.Rows.Add(rowXamlRow); + return rowXamlRow; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public override global::System.Data.DataTable Clone() { + XamlDataTable cln = ((XamlDataTable)(base.Clone())); + cln.InitVars(); + return cln; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Data.DataTable CreateInstance() { + return new XamlDataTable(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal void InitVars() { + this.columnFile = base.Columns["File"]; + this.columnType = base.Columns["Type"]; + this.columnAssembly = base.Columns["Assembly"]; + this.columnSource = base.Columns["Source"]; + this.columnScene_Id = base.Columns["Scene_Id"]; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitClass() { + this.columnFile = new global::System.Data.DataColumn("File", typeof(string), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnFile); + this.columnType = new global::System.Data.DataColumn("Type", typeof(string), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnType); + this.columnAssembly = new global::System.Data.DataColumn("Assembly", typeof(string), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnAssembly); + this.columnSource = new global::System.Data.DataColumn("Source", typeof(string), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnSource); + this.columnScene_Id = new global::System.Data.DataColumn("Scene_Id", typeof(int), null, global::System.Data.MappingType.Hidden); + base.Columns.Add(this.columnScene_Id); + this.columnFile.Namespace = ""; + this.columnType.Namespace = ""; + this.columnAssembly.Namespace = ""; + this.columnSource.Namespace = ""; + this.Prefix = "xic"; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public XamlRow NewXamlRow() { + return ((XamlRow)(this.NewRow())); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { + return new XamlRow(builder); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Type GetRowType() { + return typeof(XamlRow); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanged(e); + if ((this.XamlRowChanged != null)) { + this.XamlRowChanged(this, new XamlRowChangeEvent(((XamlRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanging(e); + if ((this.XamlRowChanging != null)) { + this.XamlRowChanging(this, new XamlRowChangeEvent(((XamlRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleted(e); + if ((this.XamlRowDeleted != null)) { + this.XamlRowDeleted(this, new XamlRowChangeEvent(((XamlRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleting(e); + if ((this.XamlRowDeleting != null)) { + this.XamlRowDeleting(this, new XamlRowChangeEvent(((XamlRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void RemoveXamlRow(XamlRow row) { + this.Rows.Remove(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { + global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); + global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); + XamlImageConverter ds = new XamlImageConverter(); + global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); + any1.Namespace = "http://www.w3.org/2001/XMLSchema"; + any1.MinOccurs = new decimal(0); + any1.MaxOccurs = decimal.MaxValue; + any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; + sequence.Items.Add(any1); + global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); + any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; + any2.MinOccurs = new decimal(1); + any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; + sequence.Items.Add(any2); + global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); + attribute1.Name = "namespace"; + attribute1.FixedValue = ds.Namespace; + type.Attributes.Add(attribute1); + global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); + attribute2.Name = "tableTypeName"; + attribute2.FixedValue = "XamlDataTable"; + type.Attributes.Add(attribute2); + type.Particle = sequence; + global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); + if (xs.Contains(dsSchema.TargetNamespace)) { + global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); + global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); + try { + global::System.Xml.Schema.XmlSchema schema = null; + dsSchema.Write(s1); + for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) { + schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); + s2.SetLength(0); + schema.Write(s2); + if ((s1.Length == s2.Length)) { + s1.Position = 0; + s2.Position = 0; + for (; ((s1.Position != s1.Length) + && (s1.ReadByte() == s2.ReadByte())); ) { + ; + } + if ((s1.Position == s1.Length)) { + return type; + } + } + } + } + finally { + if ((s1 != null)) { + s1.Close(); + } + if ((s2 != null)) { + s2.Close(); + } + } + } + xs.Add(dsSchema); + return type; + } + } + + /// + ///Represents the strongly named DataTable class. + /// + [global::System.Serializable()] + [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] + public partial class GroupDataTable : global::System.Data.TypedTableBase { + + private global::System.Data.DataColumn columnSet; + + private global::System.Data.DataColumn columnReset; + + private global::System.Data.DataColumn columnUndo; + + private global::System.Data.DataColumn columnLeft; + + private global::System.Data.DataColumn columnRight; + + private global::System.Data.DataColumn columnTop; + + private global::System.Data.DataColumn columnBottom; + + private global::System.Data.DataColumn columnWidth; + + private global::System.Data.DataColumn columnHeight; + + private global::System.Data.DataColumn columnElement; + + private global::System.Data.DataColumn columnOutputPath; + + private global::System.Data.DataColumn columnVersion; + + private global::System.Data.DataColumn columnCultures; + + private global::System.Data.DataColumn columnGroup_Id; + + private global::System.Data.DataColumn columnScene_Id; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public GroupDataTable() { + this.TableName = "Group"; + this.BeginInit(); + this.InitClass(); + this.EndInit(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal GroupDataTable(global::System.Data.DataTable table) { + this.TableName = table.TableName; + if ((table.CaseSensitive != table.DataSet.CaseSensitive)) { + this.CaseSensitive = table.CaseSensitive; + } + if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) { + this.Locale = table.Locale; + } + if ((table.Namespace != table.DataSet.Namespace)) { + this.Namespace = table.Namespace; + } + this.Prefix = table.Prefix; + this.MinimumCapacity = table.MinimumCapacity; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected GroupDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : + base(info, context) { + this.InitVars(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn SetColumn { + get { + return this.columnSet; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn ResetColumn { + get { + return this.columnReset; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn UndoColumn { + get { + return this.columnUndo; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn LeftColumn { + get { + return this.columnLeft; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn RightColumn { + get { + return this.columnRight; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn TopColumn { + get { + return this.columnTop; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn BottomColumn { + get { + return this.columnBottom; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn WidthColumn { + get { + return this.columnWidth; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn HeightColumn { + get { + return this.columnHeight; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn ElementColumn { + get { + return this.columnElement; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn OutputPathColumn { + get { + return this.columnOutputPath; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn VersionColumn { + get { + return this.columnVersion; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn CulturesColumn { + get { + return this.columnCultures; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn Group_IdColumn { + get { + return this.columnGroup_Id; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn Scene_IdColumn { + get { + return this.columnScene_Id; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + public int Count { + get { + return this.Rows.Count; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public GroupRow this[int index] { + get { + return ((GroupRow)(this.Rows[index])); + } + } + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event GroupRowChangeEventHandler GroupRowChanging; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event GroupRowChangeEventHandler GroupRowChanged; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event GroupRowChangeEventHandler GroupRowDeleting; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event GroupRowChangeEventHandler GroupRowDeleted; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void AddGroupRow(GroupRow row) { + this.Rows.Add(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public GroupRow AddGroupRow(string Set, string Reset, string Undo, float Left, float Right, float Top, float Bottom, float Width, float Height, string Element, string OutputPath, string Version, string Cultures, SceneRow parentSceneRowByScene_Group) { + GroupRow rowGroupRow = ((GroupRow)(this.NewRow())); + object[] columnValuesArray = new object[] { + Set, + Reset, + Undo, + Left, + Right, + Top, + Bottom, + Width, + Height, + Element, + OutputPath, + Version, + Cultures, + null, + null}; + if ((parentSceneRowByScene_Group != null)) { + columnValuesArray[14] = parentSceneRowByScene_Group[5]; + } + rowGroupRow.ItemArray = columnValuesArray; + this.Rows.Add(rowGroupRow); + return rowGroupRow; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public override global::System.Data.DataTable Clone() { + GroupDataTable cln = ((GroupDataTable)(base.Clone())); + cln.InitVars(); + return cln; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Data.DataTable CreateInstance() { + return new GroupDataTable(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal void InitVars() { + this.columnSet = base.Columns["Set"]; + this.columnReset = base.Columns["Reset"]; + this.columnUndo = base.Columns["Undo"]; + this.columnLeft = base.Columns["Left"]; + this.columnRight = base.Columns["Right"]; + this.columnTop = base.Columns["Top"]; + this.columnBottom = base.Columns["Bottom"]; + this.columnWidth = base.Columns["Width"]; + this.columnHeight = base.Columns["Height"]; + this.columnElement = base.Columns["Element"]; + this.columnOutputPath = base.Columns["OutputPath"]; + this.columnVersion = base.Columns["Version"]; + this.columnCultures = base.Columns["Cultures"]; + this.columnGroup_Id = base.Columns["Group_Id"]; + this.columnScene_Id = base.Columns["Scene_Id"]; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitClass() { + this.columnSet = new global::System.Data.DataColumn("Set", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnSet); + this.columnReset = new global::System.Data.DataColumn("Reset", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnReset); + this.columnUndo = new global::System.Data.DataColumn("Undo", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnUndo); + this.columnLeft = new global::System.Data.DataColumn("Left", typeof(float), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnLeft); + this.columnRight = new global::System.Data.DataColumn("Right", typeof(float), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnRight); + this.columnTop = new global::System.Data.DataColumn("Top", typeof(float), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnTop); + this.columnBottom = new global::System.Data.DataColumn("Bottom", typeof(float), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnBottom); + this.columnWidth = new global::System.Data.DataColumn("Width", typeof(float), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnWidth); + this.columnHeight = new global::System.Data.DataColumn("Height", typeof(float), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnHeight); + this.columnElement = new global::System.Data.DataColumn("Element", typeof(string), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnElement); + this.columnOutputPath = new global::System.Data.DataColumn("OutputPath", typeof(string), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnOutputPath); + this.columnVersion = new global::System.Data.DataColumn("Version", typeof(string), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnVersion); + this.columnCultures = new global::System.Data.DataColumn("Cultures", typeof(string), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnCultures); + this.columnGroup_Id = new global::System.Data.DataColumn("Group_Id", typeof(int), null, global::System.Data.MappingType.Hidden); + base.Columns.Add(this.columnGroup_Id); + this.columnScene_Id = new global::System.Data.DataColumn("Scene_Id", typeof(int), null, global::System.Data.MappingType.Hidden); + base.Columns.Add(this.columnScene_Id); + this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] { + this.columnGroup_Id}, true)); + this.columnSet.Prefix = "xic"; + this.columnReset.Prefix = "xic"; + this.columnUndo.Prefix = "xic"; + this.columnLeft.Namespace = ""; + this.columnRight.Namespace = ""; + this.columnTop.Namespace = ""; + this.columnBottom.Namespace = ""; + this.columnWidth.Namespace = ""; + this.columnHeight.Namespace = ""; + this.columnElement.Namespace = ""; + this.columnOutputPath.Namespace = ""; + this.columnVersion.Namespace = ""; + this.columnCultures.Namespace = ""; + this.columnGroup_Id.AutoIncrement = true; + this.columnGroup_Id.AllowDBNull = false; + this.columnGroup_Id.Unique = true; + this.columnGroup_Id.Prefix = "xic"; + this.Prefix = "xic"; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public GroupRow NewGroupRow() { + return ((GroupRow)(this.NewRow())); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { + return new GroupRow(builder); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Type GetRowType() { + return typeof(GroupRow); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanged(e); + if ((this.GroupRowChanged != null)) { + this.GroupRowChanged(this, new GroupRowChangeEvent(((GroupRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanging(e); + if ((this.GroupRowChanging != null)) { + this.GroupRowChanging(this, new GroupRowChangeEvent(((GroupRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleted(e); + if ((this.GroupRowDeleted != null)) { + this.GroupRowDeleted(this, new GroupRowChangeEvent(((GroupRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleting(e); + if ((this.GroupRowDeleting != null)) { + this.GroupRowDeleting(this, new GroupRowChangeEvent(((GroupRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void RemoveGroupRow(GroupRow row) { + this.Rows.Remove(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { + global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); + global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); + XamlImageConverter ds = new XamlImageConverter(); + global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); + any1.Namespace = "http://www.w3.org/2001/XMLSchema"; + any1.MinOccurs = new decimal(0); + any1.MaxOccurs = decimal.MaxValue; + any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; + sequence.Items.Add(any1); + global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); + any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; + any2.MinOccurs = new decimal(1); + any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; + sequence.Items.Add(any2); + global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); + attribute1.Name = "namespace"; + attribute1.FixedValue = ds.Namespace; + type.Attributes.Add(attribute1); + global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); + attribute2.Name = "tableTypeName"; + attribute2.FixedValue = "GroupDataTable"; + type.Attributes.Add(attribute2); + type.Particle = sequence; + global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); + if (xs.Contains(dsSchema.TargetNamespace)) { + global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); + global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); + try { + global::System.Xml.Schema.XmlSchema schema = null; + dsSchema.Write(s1); + for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) { + schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); + s2.SetLength(0); + schema.Write(s2); + if ((s1.Length == s2.Length)) { + s1.Position = 0; + s2.Position = 0; + for (; ((s1.Position != s1.Length) + && (s1.ReadByte() == s2.ReadByte())); ) { + ; + } + if ((s1.Position == s1.Length)) { + return type; + } + } + } + } + finally { + if ((s1 != null)) { + s1.Close(); + } + if ((s2 != null)) { + s2.Close(); + } + } + } + xs.Add(dsSchema); + return type; + } + } + + /// + ///Represents the strongly named DataTable class. + /// + [global::System.Serializable()] + [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] + public partial class SnapshotDataTable : global::System.Data.TypedTableBase { + + private global::System.Data.DataColumn columnFile; + + private global::System.Data.DataColumn columnFilename; + + private global::System.Data.DataColumn columnDpi; + + private global::System.Data.DataColumn columnFrames; + + private global::System.Data.DataColumn columnStoryboard; + + private global::System.Data.DataColumn columnFilmstrip; + + private global::System.Data.DataColumn columnQuality; + + private global::System.Data.DataColumn columnPage; + + private global::System.Data.DataColumn columnFitToPage; + + private global::System.Data.DataColumn columnLeft; + + private global::System.Data.DataColumn columnRight; + + private global::System.Data.DataColumn columnTop; + + private global::System.Data.DataColumn columnBottom; + + private global::System.Data.DataColumn columnWidth; + + private global::System.Data.DataColumn columnHeight; + + private global::System.Data.DataColumn columnElement; + + private global::System.Data.DataColumn columnOutputPath; + + private global::System.Data.DataColumn columnVersion; + + private global::System.Data.DataColumn columnCultures; + + private global::System.Data.DataColumn columnGroup_Id; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public SnapshotDataTable() { + this.TableName = "Snapshot"; + this.BeginInit(); + this.InitClass(); + this.EndInit(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal SnapshotDataTable(global::System.Data.DataTable table) { + this.TableName = table.TableName; + if ((table.CaseSensitive != table.DataSet.CaseSensitive)) { + this.CaseSensitive = table.CaseSensitive; + } + if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) { + this.Locale = table.Locale; + } + if ((table.Namespace != table.DataSet.Namespace)) { + this.Namespace = table.Namespace; + } + this.Prefix = table.Prefix; + this.MinimumCapacity = table.MinimumCapacity; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected SnapshotDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : + base(info, context) { + this.InitVars(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn FileColumn { + get { + return this.columnFile; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn FilenameColumn { + get { + return this.columnFilename; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn DpiColumn { + get { + return this.columnDpi; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn FramesColumn { + get { + return this.columnFrames; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn StoryboardColumn { + get { + return this.columnStoryboard; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn FilmstripColumn { + get { + return this.columnFilmstrip; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn QualityColumn { + get { + return this.columnQuality; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn PageColumn { + get { + return this.columnPage; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn FitToPageColumn { + get { + return this.columnFitToPage; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn LeftColumn { + get { + return this.columnLeft; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn RightColumn { + get { + return this.columnRight; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn TopColumn { + get { + return this.columnTop; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn BottomColumn { + get { + return this.columnBottom; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn WidthColumn { + get { + return this.columnWidth; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn HeightColumn { + get { + return this.columnHeight; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn ElementColumn { + get { + return this.columnElement; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn OutputPathColumn { + get { + return this.columnOutputPath; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn VersionColumn { + get { + return this.columnVersion; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn CulturesColumn { + get { + return this.columnCultures; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn Group_IdColumn { + get { + return this.columnGroup_Id; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + public int Count { + get { + return this.Rows.Count; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public SnapshotRow this[int index] { + get { + return ((SnapshotRow)(this.Rows[index])); + } + } + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event SnapshotRowChangeEventHandler SnapshotRowChanging; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event SnapshotRowChangeEventHandler SnapshotRowChanged; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event SnapshotRowChangeEventHandler SnapshotRowDeleting; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event SnapshotRowChangeEventHandler SnapshotRowDeleted; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void AddSnapshotRow(SnapshotRow row) { + this.Rows.Add(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public SnapshotRow AddSnapshotRow( + string File, + string Filename, + float Dpi, + float Frames, + string Storyboard, + string Filmstrip, + float Quality, + string Page, + bool FitToPage, + float Left, + float Right, + float Top, + float Bottom, + float Width, + float Height, + string Element, + string OutputPath, + string Version, + string Cultures, + GroupRow parentGroupRowByGroup_Snapshot) { + SnapshotRow rowSnapshotRow = ((SnapshotRow)(this.NewRow())); + object[] columnValuesArray = new object[] { + File, + Filename, + Dpi, + Frames, + Storyboard, + Filmstrip, + Quality, + Page, + FitToPage, + Left, + Right, + Top, + Bottom, + Width, + Height, + Element, + OutputPath, + Version, + Cultures, + null}; + if ((parentGroupRowByGroup_Snapshot != null)) { + columnValuesArray[19] = parentGroupRowByGroup_Snapshot[13]; + } + rowSnapshotRow.ItemArray = columnValuesArray; + this.Rows.Add(rowSnapshotRow); + return rowSnapshotRow; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public override global::System.Data.DataTable Clone() { + SnapshotDataTable cln = ((SnapshotDataTable)(base.Clone())); + cln.InitVars(); + return cln; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Data.DataTable CreateInstance() { + return new SnapshotDataTable(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal void InitVars() { + this.columnFile = base.Columns["File"]; + this.columnFilename = base.Columns["Filename"]; + this.columnDpi = base.Columns["Dpi"]; + this.columnFrames = base.Columns["Frames"]; + this.columnStoryboard = base.Columns["Storyboard"]; + this.columnFilmstrip = base.Columns["Filmstrip"]; + this.columnQuality = base.Columns["Quality"]; + this.columnPage = base.Columns["Page"]; + this.columnFitToPage = base.Columns["FitToPage"]; + this.columnLeft = base.Columns["Left"]; + this.columnRight = base.Columns["Right"]; + this.columnTop = base.Columns["Top"]; + this.columnBottom = base.Columns["Bottom"]; + this.columnWidth = base.Columns["Width"]; + this.columnHeight = base.Columns["Height"]; + this.columnElement = base.Columns["Element"]; + this.columnOutputPath = base.Columns["OutputPath"]; + this.columnVersion = base.Columns["Version"]; + this.columnCultures = base.Columns["Cultures"]; + this.columnGroup_Id = base.Columns["Group_Id"]; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitClass() { + this.columnFile = new global::System.Data.DataColumn("File", typeof(string), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnFile); + this.columnFilename = new global::System.Data.DataColumn("Filename", typeof(string), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnFilename); + this.columnDpi = new global::System.Data.DataColumn("Dpi", typeof(float), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnDpi); + this.columnFrames = new global::System.Data.DataColumn("Frames", typeof(float), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnFrames); + this.columnStoryboard = new global::System.Data.DataColumn("Storyboard", typeof(string), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnStoryboard); + this.columnFilmstrip = new global::System.Data.DataColumn("Filmstrip", typeof(string), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnFilmstrip); + this.columnQuality = new global::System.Data.DataColumn("Quality", typeof(float), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnQuality); + this.columnPage = new global::System.Data.DataColumn("Page", typeof(string), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnPage); + this.columnFitToPage = new global::System.Data.DataColumn("FitToPage", typeof(bool), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnFitToPage); + this.columnLeft = new global::System.Data.DataColumn("Left", typeof(float), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnLeft); + this.columnRight = new global::System.Data.DataColumn("Right", typeof(float), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnRight); + this.columnTop = new global::System.Data.DataColumn("Top", typeof(float), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnTop); + this.columnBottom = new global::System.Data.DataColumn("Bottom", typeof(float), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnBottom); + this.columnWidth = new global::System.Data.DataColumn("Width", typeof(float), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnWidth); + this.columnHeight = new global::System.Data.DataColumn("Height", typeof(float), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnHeight); + this.columnElement = new global::System.Data.DataColumn("Element", typeof(string), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnElement); + this.columnOutputPath = new global::System.Data.DataColumn("OutputPath", typeof(string), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnOutputPath); + this.columnVersion = new global::System.Data.DataColumn("Version", typeof(string), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnVersion); + this.columnCultures = new global::System.Data.DataColumn("Cultures", typeof(string), null, global::System.Data.MappingType.Attribute); + base.Columns.Add(this.columnCultures); + this.columnGroup_Id = new global::System.Data.DataColumn("Group_Id", typeof(int), null, global::System.Data.MappingType.Hidden); + base.Columns.Add(this.columnGroup_Id); + this.columnFile.Namespace = ""; + this.columnFilename.Namespace = ""; + this.columnDpi.Namespace = ""; + this.columnFrames.Namespace = ""; + this.columnStoryboard.Namespace = ""; + this.columnFilmstrip.Namespace = ""; + this.columnQuality.Namespace = ""; + this.columnPage.Namespace = ""; + this.columnFitToPage.Namespace = ""; + this.columnLeft.Namespace = ""; + this.columnRight.Namespace = ""; + this.columnTop.Namespace = ""; + this.columnBottom.Namespace = ""; + this.columnWidth.Namespace = ""; + this.columnHeight.Namespace = ""; + this.columnElement.Namespace = ""; + this.columnOutputPath.Namespace = ""; + this.columnVersion.Namespace = ""; + this.columnCultures.Namespace = ""; + this.Prefix = "xic"; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public SnapshotRow NewSnapshotRow() { + return ((SnapshotRow)(this.NewRow())); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { + return new SnapshotRow(builder); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Type GetRowType() { + return typeof(SnapshotRow); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanged(e); + if ((this.SnapshotRowChanged != null)) { + this.SnapshotRowChanged(this, new SnapshotRowChangeEvent(((SnapshotRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanging(e); + if ((this.SnapshotRowChanging != null)) { + this.SnapshotRowChanging(this, new SnapshotRowChangeEvent(((SnapshotRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleted(e); + if ((this.SnapshotRowDeleted != null)) { + this.SnapshotRowDeleted(this, new SnapshotRowChangeEvent(((SnapshotRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleting(e); + if ((this.SnapshotRowDeleting != null)) { + this.SnapshotRowDeleting(this, new SnapshotRowChangeEvent(((SnapshotRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void RemoveSnapshotRow(SnapshotRow row) { + this.Rows.Remove(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { + global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); + global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); + XamlImageConverter ds = new XamlImageConverter(); + global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); + any1.Namespace = "http://www.w3.org/2001/XMLSchema"; + any1.MinOccurs = new decimal(0); + any1.MaxOccurs = decimal.MaxValue; + any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; + sequence.Items.Add(any1); + global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); + any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; + any2.MinOccurs = new decimal(1); + any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; + sequence.Items.Add(any2); + global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); + attribute1.Name = "namespace"; + attribute1.FixedValue = ds.Namespace; + type.Attributes.Add(attribute1); + global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); + attribute2.Name = "tableTypeName"; + attribute2.FixedValue = "SnapshotDataTable"; + type.Attributes.Add(attribute2); + type.Particle = sequence; + global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); + if (xs.Contains(dsSchema.TargetNamespace)) { + global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); + global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); + try { + global::System.Xml.Schema.XmlSchema schema = null; + dsSchema.Write(s1); + for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) { + schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); + s2.SetLength(0); + schema.Write(s2); + if ((s1.Length == s2.Length)) { + s1.Position = 0; + s2.Position = 0; + for (; ((s1.Position != s1.Length) + && (s1.ReadByte() == s2.ReadByte())); ) { + ; + } + if ((s1.Position == s1.Length)) { + return type; + } + } + } + } + finally { + if ((s1 != null)) { + s1.Close(); + } + if ((s2 != null)) { + s2.Close(); + } + } + } + xs.Add(dsSchema); + return type; + } + } + + /// + ///Represents strongly named DataRow class. + /// + public partial class SceneRow : global::System.Data.DataRow { + + private SceneDataTable tableScene; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal SceneRow(global::System.Data.DataRowBuilder rb) : + base(rb) { + this.tableScene = ((SceneDataTable)(this.Table)); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string OutputPath { + get { + try { + return ((string)(this[this.tableScene.OutputPathColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'OutputPath\' in table \'Scene\' is DBNull.", e); + } + } + set { + this[this.tableScene.OutputPathColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string File { + get { + try { + return ((string)(this[this.tableScene.FileColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'File\' in table \'Scene\' is DBNull.", e); + } + } + set { + this[this.tableScene.FileColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string Type { + get { + try { + return ((string)(this[this.tableScene.TypeColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Type\' in table \'Scene\' is DBNull.", e); + } + } + set { + this[this.tableScene.TypeColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string Assembly { + get { + try { + return ((string)(this[this.tableScene.AssemblyColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Assembly\' in table \'Scene\' is DBNull.", e); + } + } + set { + this[this.tableScene.AssemblyColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string Source { + get { + try { + return ((string)(this[this.tableScene.SourceColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Source\' in table \'Scene\' is DBNull.", e); + } + } + set { + this[this.tableScene.SourceColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public int Scene_Id { + get { + return ((int)(this[this.tableScene.Scene_IdColumn])); + } + set { + this[this.tableScene.Scene_IdColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsOutputPathNull() { + return this.IsNull(this.tableScene.OutputPathColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetOutputPathNull() { + this[this.tableScene.OutputPathColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsFileNull() { + return this.IsNull(this.tableScene.FileColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetFileNull() { + this[this.tableScene.FileColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsTypeNull() { + return this.IsNull(this.tableScene.TypeColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetTypeNull() { + this[this.tableScene.TypeColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsAssemblyNull() { + return this.IsNull(this.tableScene.AssemblyColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetAssemblyNull() { + this[this.tableScene.AssemblyColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsSourceNull() { + return this.IsNull(this.tableScene.SourceColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetSourceNull() { + this[this.tableScene.SourceColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public XamlRow[] GetXamlRows() { + if ((this.Table.ChildRelations["Scene_Xaml"] == null)) { + return new XamlRow[0]; + } + else { + return ((XamlRow[])(base.GetChildRows(this.Table.ChildRelations["Scene_Xaml"]))); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public GroupRow[] GetGroupRows() { + if ((this.Table.ChildRelations["Scene_Group"] == null)) { + return new GroupRow[0]; + } + else { + return ((GroupRow[])(base.GetChildRows(this.Table.ChildRelations["Scene_Group"]))); + } + } + } + + /// + ///Represents strongly named DataRow class. + /// + public partial class XamlRow : global::System.Data.DataRow { + + private XamlDataTable tableXaml; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal XamlRow(global::System.Data.DataRowBuilder rb) : + base(rb) { + this.tableXaml = ((XamlDataTable)(this.Table)); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string File { + get { + try { + return ((string)(this[this.tableXaml.FileColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'File\' in table \'Xaml\' is DBNull.", e); + } + } + set { + this[this.tableXaml.FileColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string Type { + get { + try { + return ((string)(this[this.tableXaml.TypeColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Type\' in table \'Xaml\' is DBNull.", e); + } + } + set { + this[this.tableXaml.TypeColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string Assembly { + get { + try { + return ((string)(this[this.tableXaml.AssemblyColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Assembly\' in table \'Xaml\' is DBNull.", e); + } + } + set { + this[this.tableXaml.AssemblyColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string Source { + get { + try { + return ((string)(this[this.tableXaml.SourceColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Source\' in table \'Xaml\' is DBNull.", e); + } + } + set { + this[this.tableXaml.SourceColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public int Scene_Id { + get { + try { + return ((int)(this[this.tableXaml.Scene_IdColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Scene_Id\' in table \'Xaml\' is DBNull.", e); + } + } + set { + this[this.tableXaml.Scene_IdColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public SceneRow SceneRow { + get { + return ((SceneRow)(this.GetParentRow(this.Table.ParentRelations["Scene_Xaml"]))); + } + set { + this.SetParentRow(value, this.Table.ParentRelations["Scene_Xaml"]); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsFileNull() { + return this.IsNull(this.tableXaml.FileColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetFileNull() { + this[this.tableXaml.FileColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsTypeNull() { + return this.IsNull(this.tableXaml.TypeColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetTypeNull() { + this[this.tableXaml.TypeColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsAssemblyNull() { + return this.IsNull(this.tableXaml.AssemblyColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetAssemblyNull() { + this[this.tableXaml.AssemblyColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsSourceNull() { + return this.IsNull(this.tableXaml.SourceColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetSourceNull() { + this[this.tableXaml.SourceColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsScene_IdNull() { + return this.IsNull(this.tableXaml.Scene_IdColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetScene_IdNull() { + this[this.tableXaml.Scene_IdColumn] = global::System.Convert.DBNull; + } + } + + /// + ///Represents strongly named DataRow class. + /// + public partial class GroupRow : global::System.Data.DataRow { + + private GroupDataTable tableGroup; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal GroupRow(global::System.Data.DataRowBuilder rb) : + base(rb) { + this.tableGroup = ((GroupDataTable)(this.Table)); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string Set { + get { + try { + return ((string)(this[this.tableGroup.SetColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Set\' in table \'Group\' is DBNull.", e); + } + } + set { + this[this.tableGroup.SetColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string Reset { + get { + try { + return ((string)(this[this.tableGroup.ResetColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Reset\' in table \'Group\' is DBNull.", e); + } + } + set { + this[this.tableGroup.ResetColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string Undo { + get { + try { + return ((string)(this[this.tableGroup.UndoColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Undo\' in table \'Group\' is DBNull.", e); + } + } + set { + this[this.tableGroup.UndoColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public float Left { + get { + try { + return ((float)(this[this.tableGroup.LeftColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Left\' in table \'Group\' is DBNull.", e); + } + } + set { + this[this.tableGroup.LeftColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public float Right { + get { + try { + return ((float)(this[this.tableGroup.RightColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Right\' in table \'Group\' is DBNull.", e); + } + } + set { + this[this.tableGroup.RightColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public float Top { + get { + try { + return ((float)(this[this.tableGroup.TopColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Top\' in table \'Group\' is DBNull.", e); + } + } + set { + this[this.tableGroup.TopColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public float Bottom { + get { + try { + return ((float)(this[this.tableGroup.BottomColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Bottom\' in table \'Group\' is DBNull.", e); + } + } + set { + this[this.tableGroup.BottomColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public float Width { + get { + try { + return ((float)(this[this.tableGroup.WidthColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Width\' in table \'Group\' is DBNull.", e); + } + } + set { + this[this.tableGroup.WidthColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public float Height { + get { + try { + return ((float)(this[this.tableGroup.HeightColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Height\' in table \'Group\' is DBNull.", e); + } + } + set { + this[this.tableGroup.HeightColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string Element { + get { + try { + return ((string)(this[this.tableGroup.ElementColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Element\' in table \'Group\' is DBNull.", e); + } + } + set { + this[this.tableGroup.ElementColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string OutputPath { + get { + try { + return ((string)(this[this.tableGroup.OutputPathColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'OutputPath\' in table \'Group\' is DBNull.", e); + } + } + set { + this[this.tableGroup.OutputPathColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string Version { + get { + try { + return ((string)(this[this.tableGroup.VersionColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Version\' in table \'Group\' is DBNull.", e); + } + } + set { + this[this.tableGroup.VersionColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string Cultures { + get { + try { + return ((string)(this[this.tableGroup.CulturesColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Cultures\' in table \'Group\' is DBNull.", e); + } + } + set { + this[this.tableGroup.CulturesColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public int Group_Id { + get { + return ((int)(this[this.tableGroup.Group_IdColumn])); + } + set { + this[this.tableGroup.Group_IdColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public int Scene_Id { + get { + try { + return ((int)(this[this.tableGroup.Scene_IdColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Scene_Id\' in table \'Group\' is DBNull.", e); + } + } + set { + this[this.tableGroup.Scene_IdColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public SceneRow SceneRow { + get { + return ((SceneRow)(this.GetParentRow(this.Table.ParentRelations["Scene_Group"]))); + } + set { + this.SetParentRow(value, this.Table.ParentRelations["Scene_Group"]); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsSetNull() { + return this.IsNull(this.tableGroup.SetColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetSetNull() { + this[this.tableGroup.SetColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsResetNull() { + return this.IsNull(this.tableGroup.ResetColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetResetNull() { + this[this.tableGroup.ResetColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsUndoNull() { + return this.IsNull(this.tableGroup.UndoColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetUndoNull() { + this[this.tableGroup.UndoColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsLeftNull() { + return this.IsNull(this.tableGroup.LeftColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetLeftNull() { + this[this.tableGroup.LeftColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsRightNull() { + return this.IsNull(this.tableGroup.RightColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetRightNull() { + this[this.tableGroup.RightColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsTopNull() { + return this.IsNull(this.tableGroup.TopColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetTopNull() { + this[this.tableGroup.TopColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsBottomNull() { + return this.IsNull(this.tableGroup.BottomColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetBottomNull() { + this[this.tableGroup.BottomColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsWidthNull() { + return this.IsNull(this.tableGroup.WidthColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetWidthNull() { + this[this.tableGroup.WidthColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsHeightNull() { + return this.IsNull(this.tableGroup.HeightColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetHeightNull() { + this[this.tableGroup.HeightColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsElementNull() { + return this.IsNull(this.tableGroup.ElementColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetElementNull() { + this[this.tableGroup.ElementColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsOutputPathNull() { + return this.IsNull(this.tableGroup.OutputPathColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetOutputPathNull() { + this[this.tableGroup.OutputPathColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsVersionNull() { + return this.IsNull(this.tableGroup.VersionColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetVersionNull() { + this[this.tableGroup.VersionColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsCulturesNull() { + return this.IsNull(this.tableGroup.CulturesColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetCulturesNull() { + this[this.tableGroup.CulturesColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsScene_IdNull() { + return this.IsNull(this.tableGroup.Scene_IdColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetScene_IdNull() { + this[this.tableGroup.Scene_IdColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public SnapshotRow[] GetSnapshotRows() { + if ((this.Table.ChildRelations["Group_Snapshot"] == null)) { + return new SnapshotRow[0]; + } + else { + return ((SnapshotRow[])(base.GetChildRows(this.Table.ChildRelations["Group_Snapshot"]))); + } + } + } + + /// + ///Represents strongly named DataRow class. + /// + public partial class SnapshotRow : global::System.Data.DataRow { + + private SnapshotDataTable tableSnapshot; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal SnapshotRow(global::System.Data.DataRowBuilder rb) : + base(rb) { + this.tableSnapshot = ((SnapshotDataTable)(this.Table)); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string File { + get { + try { + return ((string)(this[this.tableSnapshot.FileColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'File\' in table \'Snapshot\' is DBNull.", e); + } + } + set { + this[this.tableSnapshot.FileColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string Filename { + get { + try { + return ((string)(this[this.tableSnapshot.FilenameColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Filename\' in table \'Snapshot\' is DBNull.", e); + } + } + set { + this[this.tableSnapshot.FilenameColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public float Dpi { + get { + try { + return ((float)(this[this.tableSnapshot.DpiColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Dpi\' in table \'Snapshot\' is DBNull.", e); + } + } + set { + this[this.tableSnapshot.DpiColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public float Frames { + get { + try { + return ((float)(this[this.tableSnapshot.FramesColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Frames\' in table \'Snapshot\' is DBNull.", e); + } + } + set { + this[this.tableSnapshot.FramesColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string Storyboard { + get { + try { + return ((string)(this[this.tableSnapshot.StoryboardColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Storyboard\' in table \'Snapshot\' is DBNull.", e); + } + } + set { + this[this.tableSnapshot.StoryboardColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string Filmstrip { + get { + try { + return ((string)(this[this.tableSnapshot.FilmstripColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Filmstrip\' in table \'Snapshot\' is DBNull.", e); + } + } + set { + this[this.tableSnapshot.FilmstripColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public float Quality { + get { + try { + return ((float)(this[this.tableSnapshot.QualityColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Quality\' in table \'Snapshot\' is DBNull.", e); + } + } + set { + this[this.tableSnapshot.QualityColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string Page { + get { + try { + return ((string)(this[this.tableSnapshot.PageColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Page\' in table \'Snapshot\' is DBNull.", e); + } + } + set { + this[this.tableSnapshot.PageColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool FitToPage { + get { + try { + return ((bool)(this[this.tableSnapshot.FitToPageColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'FitToPage\' in table \'Snapshot\' is DBNull.", e); + } + } + set { + this[this.tableSnapshot.FitToPageColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public float Left { + get { + try { + return ((float)(this[this.tableSnapshot.LeftColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Left\' in table \'Snapshot\' is DBNull.", e); + } + } + set { + this[this.tableSnapshot.LeftColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public float Right { + get { + try { + return ((float)(this[this.tableSnapshot.RightColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Right\' in table \'Snapshot\' is DBNull.", e); + } + } + set { + this[this.tableSnapshot.RightColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public float Top { + get { + try { + return ((float)(this[this.tableSnapshot.TopColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Top\' in table \'Snapshot\' is DBNull.", e); + } + } + set { + this[this.tableSnapshot.TopColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public float Bottom { + get { + try { + return ((float)(this[this.tableSnapshot.BottomColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Bottom\' in table \'Snapshot\' is DBNull.", e); + } + } + set { + this[this.tableSnapshot.BottomColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public float Width { + get { + try { + return ((float)(this[this.tableSnapshot.WidthColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Width\' in table \'Snapshot\' is DBNull.", e); + } + } + set { + this[this.tableSnapshot.WidthColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public float Height { + get { + try { + return ((float)(this[this.tableSnapshot.HeightColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Height\' in table \'Snapshot\' is DBNull.", e); + } + } + set { + this[this.tableSnapshot.HeightColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string Element { + get { + try { + return ((string)(this[this.tableSnapshot.ElementColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Element\' in table \'Snapshot\' is DBNull.", e); + } + } + set { + this[this.tableSnapshot.ElementColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string OutputPath { + get { + try { + return ((string)(this[this.tableSnapshot.OutputPathColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'OutputPath\' in table \'Snapshot\' is DBNull.", e); + } + } + set { + this[this.tableSnapshot.OutputPathColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string Version { + get { + try { + return ((string)(this[this.tableSnapshot.VersionColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Version\' in table \'Snapshot\' is DBNull.", e); + } + } + set { + this[this.tableSnapshot.VersionColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string Cultures { + get { + try { + return ((string)(this[this.tableSnapshot.CulturesColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Cultures\' in table \'Snapshot\' is DBNull.", e); + } + } + set { + this[this.tableSnapshot.CulturesColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public int Group_Id { + get { + try { + return ((int)(this[this.tableSnapshot.Group_IdColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'Group_Id\' in table \'Snapshot\' is DBNull.", e); + } + } + set { + this[this.tableSnapshot.Group_IdColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public GroupRow GroupRow { + get { + return ((GroupRow)(this.GetParentRow(this.Table.ParentRelations["Group_Snapshot"]))); + } + set { + this.SetParentRow(value, this.Table.ParentRelations["Group_Snapshot"]); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsFileNull() { + return this.IsNull(this.tableSnapshot.FileColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetFileNull() { + this[this.tableSnapshot.FileColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsFilenameNull() { + return this.IsNull(this.tableSnapshot.FilenameColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetFilenameNull() { + this[this.tableSnapshot.FilenameColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsDpiNull() { + return this.IsNull(this.tableSnapshot.DpiColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetDpiNull() { + this[this.tableSnapshot.DpiColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsFramesNull() { + return this.IsNull(this.tableSnapshot.FramesColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetFramesNull() { + this[this.tableSnapshot.FramesColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsStoryboardNull() { + return this.IsNull(this.tableSnapshot.StoryboardColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetStoryboardNull() { + this[this.tableSnapshot.StoryboardColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsFilmstripNull() { + return this.IsNull(this.tableSnapshot.FilmstripColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetFilmstripNull() { + this[this.tableSnapshot.FilmstripColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsQualityNull() { + return this.IsNull(this.tableSnapshot.QualityColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetQualityNull() { + this[this.tableSnapshot.QualityColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsPageNull() { + return this.IsNull(this.tableSnapshot.PageColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetPageNull() { + this[this.tableSnapshot.PageColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsFitToPageNull() { + return this.IsNull(this.tableSnapshot.FitToPageColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetFitToPageNull() { + this[this.tableSnapshot.FitToPageColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsLeftNull() { + return this.IsNull(this.tableSnapshot.LeftColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetLeftNull() { + this[this.tableSnapshot.LeftColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsRightNull() { + return this.IsNull(this.tableSnapshot.RightColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetRightNull() { + this[this.tableSnapshot.RightColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsTopNull() { + return this.IsNull(this.tableSnapshot.TopColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetTopNull() { + this[this.tableSnapshot.TopColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsBottomNull() { + return this.IsNull(this.tableSnapshot.BottomColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetBottomNull() { + this[this.tableSnapshot.BottomColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsWidthNull() { + return this.IsNull(this.tableSnapshot.WidthColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetWidthNull() { + this[this.tableSnapshot.WidthColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsHeightNull() { + return this.IsNull(this.tableSnapshot.HeightColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetHeightNull() { + this[this.tableSnapshot.HeightColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsElementNull() { + return this.IsNull(this.tableSnapshot.ElementColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetElementNull() { + this[this.tableSnapshot.ElementColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsOutputPathNull() { + return this.IsNull(this.tableSnapshot.OutputPathColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetOutputPathNull() { + this[this.tableSnapshot.OutputPathColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsVersionNull() { + return this.IsNull(this.tableSnapshot.VersionColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetVersionNull() { + this[this.tableSnapshot.VersionColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsCulturesNull() { + return this.IsNull(this.tableSnapshot.CulturesColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetCulturesNull() { + this[this.tableSnapshot.CulturesColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsGroup_IdNull() { + return this.IsNull(this.tableSnapshot.Group_IdColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetGroup_IdNull() { + this[this.tableSnapshot.Group_IdColumn] = global::System.Convert.DBNull; + } + } + + /// + ///Row event argument class + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public class SceneRowChangeEvent : global::System.EventArgs { + + private SceneRow eventRow; + + private global::System.Data.DataRowAction eventAction; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public SceneRowChangeEvent(SceneRow row, global::System.Data.DataRowAction action) { + this.eventRow = row; + this.eventAction = action; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public SceneRow Row { + get { + return this.eventRow; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataRowAction Action { + get { + return this.eventAction; + } + } + } + + /// + ///Row event argument class + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public class XamlRowChangeEvent : global::System.EventArgs { + + private XamlRow eventRow; + + private global::System.Data.DataRowAction eventAction; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public XamlRowChangeEvent(XamlRow row, global::System.Data.DataRowAction action) { + this.eventRow = row; + this.eventAction = action; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public XamlRow Row { + get { + return this.eventRow; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataRowAction Action { + get { + return this.eventAction; + } + } + } + + /// + ///Row event argument class + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public class GroupRowChangeEvent : global::System.EventArgs { + + private GroupRow eventRow; + + private global::System.Data.DataRowAction eventAction; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public GroupRowChangeEvent(GroupRow row, global::System.Data.DataRowAction action) { + this.eventRow = row; + this.eventAction = action; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public GroupRow Row { + get { + return this.eventRow; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataRowAction Action { + get { + return this.eventAction; + } + } + } + + /// + ///Row event argument class + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public class SnapshotRowChangeEvent : global::System.EventArgs { + + private SnapshotRow eventRow; + + private global::System.Data.DataRowAction eventAction; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public SnapshotRowChangeEvent(SnapshotRow row, global::System.Data.DataRowAction action) { + this.eventRow = row; + this.eventAction = action; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public SnapshotRow Row { + get { + return this.eventRow; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataRowAction Action { + get { + return this.eventAction; + } + } + } + } +} + +#pragma warning restore 1591 \ No newline at end of file diff --git a/XamlImageConverter/Lazy/XamlImageConverter.xsc b/XamlImageConverter/Lazy/XamlImageConverter.xsc new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/XamlImageConverter/Lazy/XamlImageConverter.xsc @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/XamlImageConverter/Lazy/XamlImageConverter.xss b/XamlImageConverter/Lazy/XamlImageConverter.xss new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/XamlImageConverter/Lazy/XamlImageConverter.xss @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/XamlImageConverter/Logger.cs b/XamlImageConverter/Logger.cs index c5103bb..df425df 100644 --- a/XamlImageConverter/Logger.cs +++ b/XamlImageConverter/Logger.cs @@ -24,6 +24,7 @@ public class Logger: MarshalByRefObject, ILogger { } } } + public void Flush() { } } } diff --git a/XamlImageConverter/XamlCapture/Capture.cs b/XamlImageConverter/XamlCapture/Capture.cs index d5cfeb6..d780baf 100644 --- a/XamlImageConverter/XamlCapture/Capture.cs +++ b/XamlImageConverter/XamlCapture/Capture.cs @@ -10,6 +10,7 @@ using System.Windows.Interop; using System.Windows.Threading; using System.Threading; +using System.Linq; namespace XamlImageConverter { @@ -69,26 +70,28 @@ public static class Capture { /// Clipping rectangle (optional) /// Returns a containing the snapshot public static BitmapSource GetBitmap(Snapshot snapshot) { - var scene = snapshot.Scene; - var window = snapshot.Window; - - var element = scene.Element; - var dpi = snapshot.Dpi ?? defaultDpi; - - var bitmap = new RenderTargetBitmap( - (int)Math.Round(window.ActualWidth * dpi / defaultDpi), - (int)Math.Round(window.ActualHeight * dpi / defaultDpi), - dpi, dpi, PixelFormats.Pbgra32); - - if (element != null) { - var T = element.RenderTransform; - element.RenderTransform = new MatrixTransform(Matrix.Multiply(T.Value, snapshot.Transform.Value));; - element.MeasureAndArrange(new Size(element.ActualWidth, element.ActualHeight)); - bitmap.Render(element); - element.RenderTransform = T; - } else System.Diagnostics.Debugger.Break(); - - return bitmap; + using (snapshot.ApplyStyleWithLock()) { + var scene = snapshot.Scene; + var window = snapshot.Window; + + var element = scene.Element; + var dpi = snapshot.Dpi ?? defaultDpi; + + var bitmap = new RenderTargetBitmap( + (int)Math.Round(window.ActualWidth * dpi / defaultDpi), + (int)Math.Round(window.ActualHeight * dpi / defaultDpi), + dpi, dpi, PixelFormats.Pbgra32); + + if (element != null) { + var T = element.RenderTransform; + element.RenderTransform = new MatrixTransform(Matrix.Multiply(T.Value, snapshot.Transform.Value)); ; + element.MeasureAndArrange(new Size(element.ActualWidth, element.ActualHeight)); + bitmap.Render(element); + element.RenderTransform = T; + } else System.Diagnostics.Debugger.Break(); + + return bitmap; + } } /// diff --git a/XamlImageConverter/XamlCapture/Compiler.cs b/XamlImageConverter/XamlCapture/Compiler.cs index 6e58c33..b26429e 100644 --- a/XamlImageConverter/XamlCapture/Compiler.cs +++ b/XamlImageConverter/XamlCapture/Compiler.cs @@ -13,7 +13,9 @@ using Microsoft.Build.Utilities; using Microsoft.Build.Framework; using System.Windows.Interop; +using System.Diagnostics.Contracts; using System.Windows.Threading; +using System.Threading.Tasks; namespace XamlImageConverter { //TODO: ImageMaps @@ -37,6 +39,7 @@ public interface ICompiler { bool RebuildAll { get; set; } bool UseService { get; set; } bool SeparateAppDomain { get; set; } + bool Parallel { get; set; } CultureInfo Culture { get; set; } Dictionary Parameters { get; set; } List Loggers { get; } @@ -57,19 +60,101 @@ public class Compiler: Parser, ICompiler { public bool CheckBuilding { get; set; } public bool NeedsBuildingChecked { get; set; } public bool SeparateAppDomain { get; set; } + public bool ChildAppDomain { get; set; } public bool RebuildAll { get; set; } public bool UseService { get; set; } + public bool Parallel { get; set; } + public int GCLevel { get; set; } + public Action Serve { get; set; } public CultureInfo Culture { get; set; } public Dictionary Parameters { get; set; } static int id = 0; public List Steps { get; set; } public List Processes { get; set; } + public System.Web.HttpContext Context { get; set; } public int? hash; + [NonSerialized] + public List TempPaths = new List(); + [NonSerialized] + public List TempFiles = new List(); + [NonSerialized] + public static string CurrentTheme = ""; + [NonSerialized] + public static string CurrentSkin = ""; + [NonSerialized] + public int Cpus = 1; + [NonSerialized] + public int? Cores = null; + [NonSerialized] + int CreatedImages = 0; + [NonSerialized] + DateTime Start; + [NonSerialized] + List Threads = new List(); + [NonSerialized] + public ManualResetEvent Finished = new ManualResetEvent(true); + + public void Finish() { + + foreach (var t in Threads) t.Join(); + Threads.Clear(); + + IEnumerable active; + lock (Processes) active = Processes.ToList(); + foreach (var p in active) p.WaitForExit(); + lock (Processes) Processes.Clear(); + } + + public class FileLocks: IDisposable { + static Dictionary Locks = new Dictionary(); + string path; + bool IsLocked = false, IsBlocking = false; - public void FinishWork() { foreach (var p in Processes.Where(p => !p.HasExited)) p.WaitForExit(); } + public FileLocks(string path) { + this.path = path; + lock (Locks) { + if (!Locks.ContainsKey(path)) Locks.Add(path, new object()); + } + IsBlocking = true; + Monitor.Enter(Locks[path]); + IsLocked = true; IsBlocking = false; + } + + public void Dispose() { + Monitor.Exit(Locks[path]); + IsLocked = false; + } + } + + public IDisposable FileLock(string path) { + return new FileLocks(path); + } + + public void Cleanup() { + Errors.Flush(); + + foreach (var file in TempFiles) { + System.IO.File.Delete(file); + } + TempFiles.Clear(); + + foreach (var path in TempPaths) { + try { + Directory.Delete(path, true); + } catch { } + } + TempPaths.Clear(); + + if (GCLevel > 0) System.GC.Collect(GCLevel, GCCollectionMode.Optimized); + } + + public void ImageCreated() { + lock (this) CreatedImages++; + } + public Compiler() { - NeedsBuilding = true; CheckBuilding = false; SeparateAppDomain = true; NeedsBuildingChecked = false; + NeedsBuilding = true; CheckBuilding = false; SeparateAppDomain = true; NeedsBuildingChecked = false; ChildAppDomain = false; RebuildAll = false; UseService = false; SourceFiles = new List(); Parameters = new Dictionary(); @@ -88,6 +173,10 @@ public class Compiler: Parser, ICompiler { dest.Errors.Loggers = Errors.Loggers; //dest.Errors = Errors; dest.Initialized = this.Initialized; + dest.Parallel = this.Parallel; + dest.GCLevel = this.GCLevel; + dest.Serve = this.Serve; + dest.Cores = this.Cores; } public List Loggers { get { return Errors.Loggers; } } @@ -154,17 +243,23 @@ public class Compiler: Parser, ICompiler { public bool Initialized { get { return init; } set { init = value; } } - void Init() { + /* void Init() { if (!init) { init = true; Errors.Message("XamlImageConverter 3.5 by Chris Cavanagh & David Egli"); + Cpus = Parallel ? Environment.ProcessorCount : 1; + Errors.Message("Using {0} CPU Cores.", Cpus); } - } + } */ void LoadDlls() { lock (DllLock) { + var baseDir = AppDomain.CurrentDomain.BaseDirectory; + var projDir = ProjectPath; + if (baseDir.EndsWith("\\")) baseDir = baseDir.Substring(0, baseDir.Length-1); + if (projDir.EndsWith("\\")) projDir = projDir.Substring(0, projDir.Length-1); if (dllsLoaded || string.IsNullOrEmpty(LibraryPath) || - (ProjectPath == AppDomain.CurrentDomain.BaseDirectory && AppDomain.CurrentDomain.RelativeSearchPath.Split(';').Contains(LibraryPath))) return; + (projDir == baseDir && AppDomain.CurrentDomain.RelativeSearchPath.Split(';').Contains(LibraryPath))) return; var path = Path.Combine(ProjectPath, LibraryPath); if (!string.IsNullOrEmpty(path)) { var files = Directory.GetFiles(path, "*.dll", SearchOption.AllDirectories); @@ -193,11 +288,27 @@ public class Compiler: Parser, ICompiler { */ void Compile(string filename) { - Init(); - Errors.Path = filename; + + SkinPath = ProjectPath; + bool xaml = false; + if (filename.Trim()[0] == '#') filename = (string)Context.Session[filename]; + if (filename.Trim()[0] == '<') { + var res = Parameters.TryGetValue("File", out filename) || Parameters.TryGetValue("Filename", out filename) || Parameters.TryGetValue("Image", out filename); + filename = MapPath(filename); + xaml = true; + } + + var root = new Group(); + root.Filename = filename; + root.Compiler = this; + if (!CheckBuilding) { + root.Errors.Message("XamlImageConverter 3.5 by Chris Cavanagh & David Egli"); + root.Errors.Message("Using {0} CPU Cores.", Cpus); + root.Errors.Message(Path.GetFileName(filename) + ":"); + } + if (string.IsNullOrEmpty(ProjectPath)) ProjectPath = Path.GetDirectoryName(filename); - - SkinPath = Path.Combine(ProjectPath, Path.GetDirectoryName(filename)); + SkinPath = Path.GetDirectoryName(MapPath(filename)); List directExtensions = new List { ".xaml", ".psd", ".svg", ".svgz", ".html" }; @@ -208,37 +319,163 @@ public class Compiler: Parser, ICompiler { FileInfo info = new FileInfo(filename); if (info.Exists) Version = info.LastWriteTimeUtc; } - var lowername = filename.ToLower(); - if (filename.Trim()[0] == '#') filename = (string)System.Web.HttpContext.Current.Session["XamlImageConverter.Xaml:" + filename]; - if (filename.Trim()[0] == '<') { + var ext = Path.GetExtension(filename).ToLower(); + if (xaml) { + Version = DateTime.MinValue; using (var r = new StringReader(filename)) { var xdoc = XElement.Load(r, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo | LoadOptions.SetBaseUri); - if (xdoc.Name.LocalName == "XamlImageConverter" && (xdoc.Name.NamespaceName == Parser.ns1 || xdoc.Name.NamespaceName == Parser.ns2)) config = xdoc; + if (xdoc.Name == xic+"XamlImageConverter" || xdoc.Name == sb+"SkinBuilder") config = xdoc; else config = XamlScene.CreateDirect(this, null, xdoc, Parameters); } - } else if (directExtensions.Any(x => lowername.EndsWith(x))) { + } else if (directExtensions.Any(x => ext == x)) { config = XamlScene.CreateDirect(this, filename, Parameters); } else if (filename == "xic.axd" || filename.EndsWith("\\xic.axd")) { config = XamlScene.CreateAxd(this, Parameters); } else { - config = XElement.Load(filename, LoadOptions.SetBaseUri | LoadOptions.SetLineInfo | LoadOptions.PreserveWhitespace); + using (FileLock(filename)) { + config = XElement.Load(filename, LoadOptions.SetBaseUri | LoadOptions.SetLineInfo | LoadOptions.PreserveWhitespace); + } } } catch (FileNotFoundException) { - Errors.Error("Unable to read the configuration file", "1", null); + root.Errors.Error("Unable to read the configuration file", "1", null); return; } catch (Exception ex) { - Errors.Error(ex.Message, "21", null); + root.Errors.Error(ex.Message, "21", null); return; } - if (config != null) Compile(Version, config); + if (config != null) Compile(root, Version, config); + //if (!CheckBuilding) root.ExitProcess(null); } - void Compile(DateTime Version, XElement config) { + public class StepQueue { + public int Cpus; + public Compiler Compiler; + public Group Root; + public XElement config; + public bool CheckBuilding; + public List scenes; + public Dictionary> steps = new Dictionary>(); + public Dictionary> todo = new Dictionary>(); + public Dictionary roots = new Dictionary(); + public List total = new List(); + public DateTime version; + int running, icpu; + ManualResetEvent signal = new ManualResetEvent(false); + + public StepQueue(Group root, DateTime version, XElement config, Compiler comp, List scenes, bool CheckBuilding) { + Cpus = comp.Cpus; + running = Cpus; + Compiler = comp; + Root = root; + this.version = version; + this.config = config; + this.scenes = scenes; + this.CheckBuilding = CheckBuilding; + icpu = Cpus <= 2 ? Cpus - 1 : (new Random().Next(Cpus - 2) + 1); + } + + int initialized = 0; + public void Init(int cpu) { + List s; + if (cpu == 0) { + s = scenes; + roots[0] = Root; + } else { + var root = new Group(); + root.Master = Root; + roots[cpu] = root; + s = Compiler.ParseScenes(root, version, config).ToList(); + } + //steps[cpu] = s.SelectMany(st => st.Steps()).ToList(); + steps[cpu] = new List(); + todo[cpu] = new List(); + foreach (var scene in s) { + steps[cpu].AddRange(scene.Steps()); + } + + int n; + lock (this) n = ++initialized; + + if (cpu == icpu) { + var root = new Group(); + root.Master = Root; + s = Compiler.ParseScenes(root, version, config).OfType().ToList(); + var seq = s.SelectMany(st => st.Steps()).ToList(); + var mainthread = seq.OfType() + .Where(sn => (sn.Scene.Source ?? "").EndsWith(".psd")) + .ToList(); + var sequential = seq.OfType() + .GroupBy(sn => sn.LocalFilename) + .Where(g => g.Count() > 1) + .SelectMany(g => g) + .ToList(); + sequential.RemoveAll(sn => mainthread.Contains(sn)); + var todosequential = new List(); + + n = 0; + foreach (var st in seq) { + if (sequential.Contains(st)) todosequential.Add(st); + if (st is Snapshot) { + if (!sequential.Contains(st)) { + for (int c = 0; c < Cpus; c++) { + if (c == 0 || !mainthread.Contains(st)) todo[c].Add(steps[c][n]); + } + } + } else { + for (int c = 0; c < Cpus; c++) { + if (c == 0 || !mainthread.Contains(st)) todo[c].Add(steps[c][n]); + } + if (st is Parameters) todosequential.Add(st); + } + n++; + } + + n = 0; + foreach (var st in todosequential) todo[cpu].Insert(n++, st); + if (Cpus > 1) signal.Set(); + } else { + signal.WaitOne(); + } + } + + public Group Next(int cpu) { + lock (this) { + if (todo[cpu].Count == 0) return null; + var step = todo[cpu][0]; + int n; + if (!(step is Parameters) && (n = steps[cpu].IndexOf(step)) >= 0) { + for (int c = 0; c < Cpus; c++) { + int ix = todo[c].IndexOf(steps[c][n]); + if (ix >= 0) todo[c].RemoveAt(ix); + } + } else { + todo[cpu].RemoveAt(0); + } + return (Group)step; + } + } + + public void Stop(int cpu) { + lock (this) { + roots[cpu].Finish(); + if (cpu != 0) { + List active; + lock (roots[cpu]) active = roots[cpu].LocalProcesses.ToList(); + foreach (var p in active) p.WaitForExit(); + } + running--; + if (running == 0 && !CheckBuilding) { + Root.ExitProcess(null); + } + } + } + } + + void Compile(Group root, DateTime Version, XElement config) { - Step lastStep = null; if (RebuildAll) Version = DateTime.Now.ToUniversalTime(); try { - var scenes = ParseScenes(Version, config).ToList(); + var scenes = ParseScenes(root, Version, config).ToList(); var building = CheckNeedsBuilding(scenes); @@ -258,55 +495,40 @@ public class Compiler: Parser, ICompiler { if (!building || CheckBuilding) return; LoadDlls(); - // Get flattened list of snapshots - // Could just return enumerator and parse + save per iteration, but pre-populating with ToList() - // means we can throw parsing errors etc before any snapshots are saved (so the user doesn't have - // to wait as long to see potential errors) - Steps = scenes.SelectMany(scene => scene.Steps()).ToList(); - - foreach (var step in Steps) { - lastStep = step; - //TODO collect? - //System.GC.Collect(System.GC.MaxGeneration, GCCollectionMode.Forced); - step.Process(); + + var steps = new StepQueue(root, Version, config, this, scenes, CheckBuilding); + + for (int cpu = Cpus-1; cpu >= 0; cpu--) { + var cpul = cpu; + ParameterizedThreadStart task = (state) => { // iterate over all steps + steps.Init(cpul); + var step = steps.Next(cpul); + while (step != null) { + step.Process(); + step = steps.Next(cpul); + } + steps.Stop(cpul); + }; + + if (cpul > 0) { + var thread = new Thread(new ParameterizedThreadStart(task)); + thread.SetApartmentState(ApartmentState.STA); + if (Culture != null) { thread.CurrentCulture = thread.CurrentUICulture = Culture; } + thread.Start(); + Threads.Add(thread); + } else { + task(null); + } } - // flush Dispatcher - //Dispatcher.CurrentDispatcher.Invoke((Action)(() => {}), DispatcherPriority.ApplicationIdle); - Group.Close(Processes, Errors, scenes); } catch (CompilerException cex) { - Errors.Error(cex.Message, cex.ErrorCode.ToString(), cex.XObject); + root.Errors.Error(cex.Message, cex.ErrorCode.ToString(), cex.XObject); } catch (Exception ex) { - XObject xobj = null; - if (lastStep != null && lastStep is Group) xobj = ((Group)lastStep).XElement; - Errors.Warning("An internal error occurred\n\n" + ex.Message + "\n" + ex.StackTrace, "2", xobj); + root.Errors.Warning("An internal error occurred\n\n" + ex.Message + "\n" + ex.StackTrace, "2", null); } finally { - lastStep = null; - System.GC.Collect(System.GC.MaxGeneration, GCCollectionMode.Forced); } } void RawCompile() { - /* - var dispatcher = Dispatcher.FromThread(Thread.CurrentThread); - if (dispatcher == null) { - AutoResetEvent are = new AutoResetEvent(false); - - Thread thread = new Thread((ThreadStart)delegate { - var d = Dispatcher.CurrentDispatcher; - d.UnhandledException += delegate(object sender, DispatcherUnhandledExceptionEventArgs e) { - if (!Debugger.IsAttached) e.Handled = true; - }; - are.Set(); - Dispatcher.Run(); - }); - - thread.Name = "BackgroundStaDispatcher"; - thread.SetApartmentState(ApartmentState.STA); - thread.IsBackground = true; - thread.Start(); - - are.WaitOne(); - } */ foreach (var file in SourceFiles) Compile(file); } @@ -335,6 +557,8 @@ public class Compiler: Parser, ICompiler { public long MemorySet { get { return GC.GetTotalMemory(false); } } public void Compile() { + Cpus = Cores ?? (Parallel ? Environment.ProcessorCount : 1); + if (SourceFiles != null && SourceFiles.Count > 0) { if (!ProjectPath.Contains(":")) { ProjectPath = new DirectoryInfo(Path.Combine(Environment.CurrentDirectory, ProjectPath)).FullName; } @@ -364,22 +588,25 @@ public class Compiler: Parser, ICompiler { Compiler compiler = (Compiler)domain.CreateInstanceAndUnwrap(Assembly.GetExecutingAssembly().FullName, "XamlImageConverter.Compiler"); CopyTo(compiler); compiler.SeparateAppDomain = false; + compiler.ChildAppDomain = true; //compiler.STAThread = true; compiler.Compile(); + TempFiles.AddRange(compiler.TempFiles); + TempPaths.AddRange(compiler.TempPaths); } catch (Exception ex2) { } finally { AppDomain.Unload(domain); - //GC.Collect(10, GCCollectionMode.Forced); - //GC.WaitForFullGCComplete(1000); } } } else { CoreCompile(); - //GC.Collect(10, GCCollectionMode.Forced); } - FinishWork(); - + Finish(); + if (!ChildAppDomain) { + if (Serve != null) Serve(); + Cleanup(); + } foreach (var logger in Errors.Loggers.OfType()) logger.Dispose(); } } diff --git a/XamlImageConverter/XamlCapture/Errors.cs b/XamlImageConverter/XamlCapture/Errors.cs index 5e5143e..8d61fda 100644 --- a/XamlImageConverter/XamlCapture/Errors.cs +++ b/XamlImageConverter/XamlCapture/Errors.cs @@ -5,6 +5,7 @@ using System.Xml.Linq; using System.Xml; using System.Reflection; +using System.Diagnostics.Contracts; namespace XamlImageConverter { @@ -46,6 +47,7 @@ public struct TextSpan { public interface ILogger { void Message(string path, string message, string errorNumber, TextSpan span, Severity severity); + void Flush(); } public class ConsoleLogger: MarshalByRefObject, ILogger { @@ -58,14 +60,16 @@ public class ConsoleLogger: MarshalByRefObject, ILogger { } Console.WriteLine(message); } + public void Flush() { } } public class FileLogger: MarshalByRefObject, ILogger, IDisposable { string lastPath = string.Empty; - StringBuilder text = new StringBuilder(); + Dictionary texts = new Dictionary(); public virtual void Message(string path, string message, string errorCode, TextSpan span, Severity severity) { - if (path != lastPath) Flush(path); + if (!texts.ContainsKey(path)) texts.Add(path, new StringBuilder()); + var text = texts[path]; switch (severity) { case Severity.Error: text.Append(string.Format(" Error {0} ({1},{2}): ", errorCode, span.Start.Line, span.Start.Column)); break; case Severity.Warning: text.Append(string.Format(" Warning {0} ({1},{2}): ", errorCode, span.Start.Line, span.Start.Column)); break; @@ -74,29 +78,27 @@ public class FileLogger: MarshalByRefObject, ILogger, IDisposable { text.AppendLine(" " + message); } - private void Flush(string newpath) { - if (!StringUtil.IsNullOrWhiteSpace(lastPath)) { + public void Flush() { + foreach (var file in texts.Keys) { + var text = texts[file]; var str = text.ToString(); - var logpath = lastPath + ".log"; - if (!string.IsNullOrEmpty(lastPath)) { - try { - if (str != null && str.Trim() != string.Empty) System.IO.File.WriteAllText(logpath, str); - else if (System.IO.File.Exists(logpath)) System.IO.File.Delete(logpath); - } catch { } - } - text = new StringBuilder(); + var logpath = file + ".log"; + try { + if (!string.IsNullOrEmpty(str)) System.IO.File.WriteAllText(logpath, str.Replace(Environment.NewLine, "\n").Replace("\n", Environment.NewLine)); + else if (System.IO.File.Exists(logpath)) System.IO.File.Delete(logpath); + } catch { } } - lastPath = newpath; + texts.Clear(); } public void Dispose() { - Flush(string.Empty); + Flush(); } } [Serializable] public class Errors: MarshalByRefObject { - string lastPath = string.Empty; + HashSet Paths = new HashSet(); public bool HasErrors = false; @@ -105,23 +107,30 @@ public class Errors: MarshalByRefObject { public string Path { get; set; } - private void Write(string message, string errorCode, TextSpan span, Severity severity) { - if (Path != lastPath && !StringUtil.IsNullOrWhiteSpace(Path)) { - lastPath = Path; - Write(System.IO.Path.GetFileName(Path) + ":", "", new TextSpan(), Severity.Message); - } else { - lastPath = Path; + private void Write(string path, string message, string errorCode, TextSpan span, Severity severity) { + if (path == null) return; + lock (this) { + if (!Paths.Contains(path)) Paths.Add(path); + foreach (var logger in Loggers) logger.Message(path, message, errorCode, span, severity); } - foreach (var logger in Loggers) logger.Message(Path, message, errorCode, span, severity); } - public void Message(string message) { Write(message, string.Empty, new TextSpan(), Severity.Message); } - public void Message(string message, params object[] args) { Write(string.Format(message, args), string.Empty, new TextSpan(), Severity.Message); } - public void Note(string message) { Write(message, string.Empty, new TextSpan(), Severity.Note); } - public void Note(string message, params object[] args) { Write(string.Format(message, args), string.Empty, new TextSpan(), Severity.Note); } - public void Error(string message, string errorCode, TextSpan span) { Write(message, errorCode, span, Severity.Error); } - public void Warning(string message, string errorCode, TextSpan span) { Write(message, errorCode, span, Severity.Warning); } - public void Error(string message, string errorCode, XObject xobj) { HasErrors = true; Write(message, errorCode, new TextSpan(xobj), Severity.Error); } - public void Warning(string message, string errorCode, XObject xobj) { Write(message, errorCode, new TextSpan(xobj), Severity.Warning); } + public Errors Clone(string path) { + return new Errors { Loggers = this.Loggers, Path = path }; + } + + public void LocalMessage(string path, string message) { Write(path, message, string.Empty, new TextSpan(), Severity.Message); } + public void LocalMessage(string path, string message, params object[] args) { Write(path, string.Format(message, args), string.Empty, new TextSpan(), Severity.Message); } + public void Message(string message) { Write(Path, message, string.Empty, new TextSpan(), Severity.Message); } + public void Message(string message, params object[] args) { Write(Path, string.Format(message, args), string.Empty, new TextSpan(), Severity.Message); } + public void Note(string message) { Write(Path, message, string.Empty, new TextSpan(), Severity.Note); } + public void Note(string message, params object[] args) { Write(Path, string.Format(message, args), string.Empty, new TextSpan(), Severity.Note); } + public void Error(string message, string errorCode, TextSpan span) { Write(Path, message, errorCode, span, Severity.Error); } + public void Warning(string message, string errorCode, TextSpan span) { Write(Path, message, errorCode, span, Severity.Warning); } + public void Error(string message, string errorCode, XObject xobj) { HasErrors = true; Write(Path, message, errorCode, new TextSpan(xobj), Severity.Error); } + public void Warning(string message, string errorCode, XObject xobj) { Write(Path, message, errorCode, new TextSpan(xobj), Severity.Warning); } + public void Flush() { + foreach (var log in Loggers) log.Flush(); + } } } diff --git a/XamlImageConverter/XamlCapture/Group.cs b/XamlImageConverter/XamlCapture/Group.cs index bffc225..417ebd5 100644 --- a/XamlImageConverter/XamlCapture/Group.cs +++ b/XamlImageConverter/XamlCapture/Group.cs @@ -7,6 +7,9 @@ using System.Windows.Markup; using System.Windows.Media; using System.Windows.Media.Animation; +using System.Windows.Documents; +using System.Windows.Xps; +using System.Windows.Xps.Packaging; using System.Reflection; using System.Xml.Linq; using System.IO; @@ -28,14 +31,21 @@ public class Group: Canvas { public XElement SourceElement { get; set; } public string ElementName { get; set; } public Size PreferredSize { get; set; } - public Compiler Compiler { get; set; } + Compiler compiler; + public Compiler Compiler { get { return Master.compiler; } set { Master.compiler = value; } } public List DependsOn { get; set; } public string Dependencies { set { DependsOn = (value ?? "").Split(',', ';').Select(s => s.Trim()).Where(s => !string.IsNullOrEmpty(s)).ToList(); } } public string cultures; public virtual string CulturesString { get { return Setting(g => g.cultures) ?? ""; } set { cultures = value; } } public virtual List Cultures { get { return CulturesString.Split(',', ';').Select(c => c.Trim()).Where(c => !string.IsNullOrEmpty(c)).ToList(); } } - public Errors Errors { get { return Compiler.Errors; } } public List Processes { get { return Compiler.Processes; } } + //public List LocalProcesses = new List(); + Group master; + public Group Master { get { return Root != this ? Root.Master : (master ?? (master = this)); } set { if (Root != this) Root.Master = value; else master = value; } } + List localProcesses = new List(); + public List LocalProcesses { get { return Root.localProcesses; } set { Root.localProcesses = value; } } + public int processCount = 1; + public int ProcessCount { get { return Master.processCount; } set { Master.processCount = value; } } public string Theme { get; set; } public string Skin { get; set; } public System.Windows.Media.TextRenderingMode? TextRenderingMode { get; set; } @@ -44,17 +54,71 @@ public class Group: Canvas { public string OutputPath { get; set; } public DateTime Version { get; set; } public virtual bool ParseChildren { get { return true; } } + public int? Layer { get; set; } public string TempPath { get; set; } string filename; public virtual string Filename { get { return filename; } set { filename = value; localFilename = null; } } - public static List TempPaths = new List(); - public static List TempFiles = new List(); - static string CurrentTheme = null, CurrentSkin = null; + public List TempPaths { get { return Compiler.TempPaths; } } + public List TempFiles { get { return Compiler.TempFiles; } } + public string CurrentTheme { get { return Compiler.CurrentTheme; } set { lock (Compiler) Compiler.CurrentTheme = value; } } + public string CurrentSkin { get { return Compiler.CurrentSkin; } set { lock (Compiler) Compiler.CurrentSkin = value; } } //public static Group Root = new Group(); public ResourceDictionary SkinResources = null; public string XamlFile = null; public string XamlPath = null; public bool IsScene { get; set; } + public int CreatedImages = 0; + public DateTime Start = DateTime.Now; + Errors errors = null; + public Errors Errors { get { return Root.errors ?? (Root.errors = Compiler.Errors.Clone(Master.Filename)); } set { Root.errors = value; } } + Dictionary xpsDocs; + public Dictionary XpsDocs { get { return Root.xpsDocs ?? (Root.xpsDocs = new Dictionary()); } set { Root.xpsDocs = value; } } + + public IDisposable FileLock(string path) { return Compiler.FileLock(path); } + + public void ImageCreated() { + lock (Master) Master.CreatedImages++; + } + + public System.Diagnostics.Process NewProcess(string exe, string args = "", string workingdir = null) { + lock (Processes) + lock (Master) { + System.Diagnostics.Process p = null; + if (exe != null) { + p = new System.Diagnostics.Process(); + workingdir = workingdir ?? Path.GetDirectoryName(exe); + var pinfo = p.StartInfo; + pinfo.FileName = exe; + pinfo.CreateNoWindow = true; + pinfo.Arguments = args; + pinfo.UseShellExecute = false; + pinfo.RedirectStandardOutput = true; + pinfo.RedirectStandardError = true; + pinfo.RedirectStandardInput = true; + pinfo.WorkingDirectory = workingdir; + p.EnableRaisingEvents = true; + Processes.Add(p); + } + LocalProcesses.Add(p); + ProcessCount++; + return p; + } + } + + public void ExitProcess(System.Diagnostics.Process p) { + lock (Processes) + lock (Master) { + if (p != null) { + Processes.Remove(p); + LocalProcesses.Remove(p); + } + ProcessCount--; + if (ProcessCount == 0) { + var time = DateTime.Now - Master.Start; + Errors.Message("{0} Images rendered in {1:G3} seconds.", Master.CreatedImages, time.TotalSeconds); + } + } + } public Group scene = null; public Group Scene { @@ -67,19 +131,20 @@ public class Group: Canvas { return scene; } } - public Group Root { get { return Scene.Parent; } } + public Group Root { get { return Scene != null ? Scene.Parent : this; } } public Group Parent { get { return (Group)base.Parent; } } public string CreateTempPath(string file) { TempPath = System.IO.Path.GetTempPath(); var name = System.IO.Path.GetFileName(file); - TempPath = System.IO.Path.Combine(TempPath, name + "." + DateTime.Now.Ticks.ToString()); + var guid = Guid.NewGuid(); + TempPath = System.IO.Path.Combine(TempPath, name + "." + DateTime.Now.Ticks.ToString() + "." + guid.ToString()); if (!System.IO.Directory.Exists(TempPath)) System.IO.Directory.CreateDirectory(TempPath); TempPaths.Add(TempPath); Scene.XamlPath = TempPath; return System.IO.Path.Combine(TempPath, System.IO.Path.ChangeExtension(name, ".xaml")); } - + public IEnumerable Ancestors { get { var g = this; @@ -104,127 +169,153 @@ public class Group: Canvas { } else if (!IsScene) { // load Group or Snapshot element = Parent.Element; } else { // load Scene - ApplyStyle(); - - if (Source != null) { + using (ApplyStyleWithLock()) { - string xaml = null, file = null, directXaml = null, session = null; - FileInfo info; - DateTime version; + if (Source != null) { - if (Source.Trim().StartsWith("<")) directXaml = Source; - else if (Source.Trim().StartsWith("#")) { - session = Source; - directXaml = (string)System.Web.HttpContext.Current.Session["XamlImageConverter.Xaml:" + session]; - } else { - info = new FileInfo(Compiler.MapPath(Source)); - file = info.FullName; - version = info.LastWriteTimeUtc; - } - - bool psd = false; - if (session == null && (psd = Source.ToLower().EndsWith(".psd")) || Source.ToLower().EndsWith(".swf")) { + string xaml = null, file = null, directXaml = null, session = null; + FileInfo info; + DateTime version; - xaml = CreateTempPath(file); - - var apath = AppDomain.CurrentDomain.BaseDirectory; - var rpath = (";" + AppDomain.CurrentDomain.RelativeSearchPath) - .Split(';') - .FirstOrDefault(p => File.Exists(Path.Combine(apath, p, "Lazy\\psd2xaml\\Endogine.dll"))); - Type doctype; - if (psd) { - var a = Assembly.LoadFrom(Path.Combine(apath, rpath, "Lazy\\psd2xaml\\Endogine.dll")); - a = Assembly.LoadFrom(Path.Combine(apath, rpath, "Lazy\\psd2xaml\\Endogine.Codecs.Photoshop.dll")); - doctype = a.GetType("Endogine.Codecs.Photoshop.Document"); + if (Source.Trim().StartsWith("<")) directXaml = Source; + else if (Source.Trim().StartsWith("#")) { + session = Source; + directXaml = (string)Compiler.Context.Session[session]; } else { - var a = Assembly.LoadFrom(Path.Combine(apath, rpath, "Lazy\\psd2xaml\\Endogine.dll")); - a = Assembly.LoadFrom(Path.Combine(apath, rpath, "Lazy\\psd2xaml\\Endogine.Codecs.Flash.dll")); - doctype = a.GetType("Endogine.Codecs.Flash.Document"); + info = new FileInfo(Compiler.MapPath(Source)); + file = info.FullName; + using (FileLock(file)) { + version = info.LastWriteTimeUtc; + } } - dynamic doc = Activator.CreateInstance(doctype, file); - doc.SaveXaml(xaml); - file = xaml; - } + bool psd = false; + if (session == null && (psd = Source.ToLower().EndsWith(".psd")) || Source.ToLower().EndsWith(".swf")) { + + xaml = CreateTempPath(file); + + var apath = AppDomain.CurrentDomain.BaseDirectory; + var rpath = (";" + AppDomain.CurrentDomain.RelativeSearchPath) + .Split(';') + .FirstOrDefault(p => File.Exists(Path.Combine(apath, p, "Lazy\\psd2xaml\\Endogine.dll"))); + if (Layer == null) { + try { + Type doctype; + apath = Path.Combine(apath, rpath, "Lazy\\psd2xaml\\"); + using (FileLock(apath)) { + if (psd) { + var a = Assembly.LoadFrom(apath + "Endogine.dll"); + a = Assembly.LoadFrom(apath + "Endogine.Codecs.Photoshop.dll"); + doctype = a.GetType("Endogine.Codecs.Photoshop.Document"); + } else { + var a = Assembly.LoadFrom(apath + "Endogine.dll"); + a = Assembly.LoadFrom(apath + "Endogine.Codecs.Flash.dll"); + doctype = a.GetType("Endogine.Codecs.Flash.Document"); + } + } - if (session == null && Source.ToLower().EndsWith(".svg")) { - element = SvgConvert.ConvertUtility.LoadSvg(file); - } else { - if (directXaml != null) {// file is direct xaml - using (var sr = new StringReader(directXaml)) - using (var r = System.Xml.XmlReader.Create(sr, new System.Xml.XmlReaderSettings() { CloseInput = true })) { - element = XamlReader.Load(r) as FrameworkElement; + dynamic doc = Activator.CreateInstance(doctype, file); + using (FileLock(file)) doc.SaveXaml(xaml); + file = xaml; + } catch { + Layer = 0; + } + } + if (Layer != null) { + /* apath = Path.Combine(apath, rpath, "Lazy\\ImageMagick\\"); + var p = NewProcess(apath + "convert.exe", string.Format("{0}[{1}] {2}", file, Layer.Value, xaml + ".png")); + p.Start(); + p.WaitForExit(); + var xamlns = Compiler.xamlns; + var xdoc = new XElement(xamlns+"Page", + new XAttribute(XNamespace.Xmlns+"x", Compiler.xxamlns.NamespaceName), + new XElement(xamlns+"Canvas", + new XElement(xamlns+"Rectangle" + */ + // ConvertFromPSD(file, xaml, apath); } + } + + if (session == null && Source.ToLower().EndsWith(".svg")) { + using (FileLock(file)) element = SvgConvert.ConvertUtility.LoadSvg(file); } else { - Scene.XamlFile = file; - - using (var stream = File.OpenRead(file)) { - if (Source.ToLower().EndsWith(".xaml") || Source.ToLower().EndsWith(".psd") || Source.ToLower().EndsWith(".svg")) { - ParserContext context; - if (string.IsNullOrEmpty(XamlElement.BaseUri)) context = new ParserContext { BaseUri = new Uri("file:///" + file) }; - else context = new ParserContext { BaseUri = new Uri(XamlElement.BaseUri) }; - element = XamlReader.Load(stream, context) as FrameworkElement; - } else { - throw new CompilerException("Input format not supported.", 20, XElement); + if (directXaml != null) {// file is direct xaml + using (var sr = new StringReader(directXaml)) + using (var r = System.Xml.XmlReader.Create(sr, new System.Xml.XmlReaderSettings() { CloseInput = true })) { + element = XamlReader.Load(r) as FrameworkElement; + } + } else { + Scene.XamlFile = file; + + using (FileLock(file)) + using (var stream = File.OpenRead(file)) { + if (Source.ToLower().EndsWith(".xaml") || Source.ToLower().EndsWith(".psd") || Source.ToLower().EndsWith(".svg")) { + ParserContext context; + if (string.IsNullOrEmpty(XamlElement.BaseUri)) context = new ParserContext { BaseUri = new Uri("file:///" + file) }; + else context = new ParserContext { BaseUri = new Uri(XamlElement.BaseUri) }; + element = XamlReader.Load(stream, context) as FrameworkElement; + } else { + throw new CompilerException("Input format not supported.", 20, XElement); + } } } } - } - } else { - string assemblyName = AssemblyName; - string typeName = TypeName; - // (assemblyName != null) assemblyName = Compiler.MapPath(assemblyName); - Assembly assembly; - Type type = null; - if (typeName != null) { - if (assemblyName != null) { - try { - var assemblies = AppDomain.CurrentDomain.GetAssemblies(); - assembly = assemblies.FirstOrDefault(a => a.FullName == assemblyName || (new Uri(a.CodeBase)).LocalPath == Compiler.MapPath(assemblyName)); - if (assembly == null) { - lock (Compiler.DllLock) { - if (assemblyName.Contains(':') || assemblyName.Contains('/') || assemblyName.Contains('\\') || assemblyName.Contains('~')) assembly = Assembly.LoadFrom(Compiler.MapPath(assemblyName)); - else assembly = Assembly.Load(assemblyName); + } else { + string assemblyName = AssemblyName; + string typeName = TypeName; + // (assemblyName != null) assemblyName = Compiler.MapPath(assemblyName); + Assembly assembly; + Type type = null; + if (typeName != null) { + if (assemblyName != null) { + try { + var assemblies = AppDomain.CurrentDomain.GetAssemblies(); + assembly = assemblies.FirstOrDefault(a => a.FullName == assemblyName || (new Uri(a.CodeBase)).LocalPath == Compiler.MapPath(assemblyName)); + if (assembly == null) { + lock (Compiler.DllLock) { + if (assemblyName.Contains(':') || assemblyName.Contains('/') || assemblyName.Contains('\\') || assemblyName.Contains('~')) assembly = Assembly.LoadFrom(Compiler.MapPath(assemblyName)); + else assembly = Assembly.Load(assemblyName); + } + } + if (assembly != null) { + int i = TypeName.IndexOf(','); + if (i > -1) typeName = typeName.Substring(0, i); + type = assembly.GetType(typeName); } + } catch { + throw new CompilerException(string.Format("Error loading assembly {0}.", assemblyName), 12, XamlElement); } - if (assembly != null) { - int i = TypeName.IndexOf(','); - if (i > -1) typeName = typeName.Substring(0, i); - type = assembly.GetType(typeName); + } else { + try { + type = Type.GetType(typeName, false); + if (type == null) { + var assemblies = AppDomain.CurrentDomain.GetAssemblies(); + type = assemblies.Reverse().SelectMany(a => a.GetTypes()).FirstOrDefault(t => t.FullName == typeName); + } + } catch { + throw new CompilerException(string.Format("Invalid type name {0}.", typeName), 13, XamlElement); } - } catch { - throw new CompilerException(string.Format("Error loading assembly {0}.", assemblyName), 12, XamlElement); } - } else { - try { - type = Type.GetType(typeName, false); - if (type == null) { - var assemblies = AppDomain.CurrentDomain.GetAssemblies(); - type = assemblies.Reverse().SelectMany(a => a.GetTypes()).FirstOrDefault(t => t.FullName == typeName); + if (type != null) { + try { + element = Activator.CreateInstance(type) as FrameworkElement; + } catch (Exception ex) { + throw new CompilerInnerException(string.Format("Error creating type {0}.", typeName), 14, XamlElement, ex); } - } catch { - throw new CompilerException(string.Format("Invalid type name {0}.", typeName), 13, XamlElement); - } - } - if (type != null) { - try { - element = Activator.CreateInstance(type) as FrameworkElement; - } catch (Exception ex) { - throw new CompilerInnerException(string.Format("Error creating type {0}.", typeName), 14, XamlElement, ex); + } else { + throw new CompilerException(string.Format("Type {0} not found.", typeName), 15, XamlElement); } + } else if (InnerXaml != null) { + element = XamlReader.Load(InnerXaml.CreateReader()) as FrameworkElement; } else { - throw new CompilerException(string.Format("Type {0} not found.", typeName), 15, XamlElement); + element = null; } - } else if (InnerXaml != null) { - element = XamlReader.Load(InnerXaml.CreateReader()) as FrameworkElement; - } else { - element = null; } - } - if (element != null) { - element.MeasureAndArrange(PreferredSize); - ApplyStyle(); + if (element != null) { + element.MeasureAndArrange(PreferredSize); + ApplyStyle(); + } } } @@ -258,82 +349,147 @@ public class Group: Canvas { } } - public FrameworkElement ElementClone() { - /*// save original - var old = Scene.element; + public FrameworkElement VisualClone() { + // save original + var old = Scene.Element; // reload xaml - Scene.element = null; - Scene.LoadElement(); + element = null; window = null; + foreach (var p in Ancestors) { p.element = null; p.window = null; } + Scene.Load(); // apply parameters foreach (var p in Scene.Flatten().TakeWhile(g => g != this).OfType()) p.Process(); - // save copy - var clone = Element; - // clear elements - element = null; - foreach (var p in AncestorGroups) p.element = null; + // clone into a Rectangle's Brush + var clone = Scene.Element; + var bounds = Window.Bounds(Scene.Window); + + var brush = new VisualBrush(clone); + brush.AutoLayoutContent = true; + brush.Stretch = Stretch.None; + brush.AlignmentX = AlignmentX.Left; + brush.AlignmentY = AlignmentY.Top; + brush.Viewbox = new Rect(bounds.Left/Scene.Element.ActualWidth, bounds.Top/Scene.Element.ActualHeight, 1, 1); + + var img = new System.Windows.Shapes.Rectangle(); + img.Width = bounds.Width; + img.Height = bounds.Height; + img.Fill = brush; + + // clear clone + element = null; window = null; + foreach (var p in Ancestors) { p.element = null; p.window = null; } // restore original Scene.element = old; - // remove clone from logical & visual tree - //clone.Disconnect(); - */ - foreach (var p in Ancestors) ClearStyle(p.Element); + return img; + } - using (var m = new MemoryStream()) { - XamlWriter.Save(Element, m); - m.Seek(0, SeekOrigin.Begin); - return (FrameworkElement)XamlReader.Load(m); + public string Xaml(object e) { + var stringWriter = new StringWriter(new StringBuilder()); + var xmlTextWriter = new System.Xml.XmlTextWriter(stringWriter) { Formatting = System.Xml.Formatting.Indented }; + XamlWriter.Save(e, xmlTextWriter); + return stringWriter.ToString(); + } + + static List Locks = new List(); + static object Lock = new object(); + static object lock2 = new object(); + + public class ThemeLock : IDisposable { + public string Theme; + public ThemeLock() { Theme = ""; } + public ThemeLock(string theme) { + System.Threading.Monitor.Enter(this); + Theme = theme; + bool otherTheme = false; + lock (Lock) { + otherTheme = Locks.Count > 0 && Locks[0].Theme != Theme; + if (!otherTheme) { + lock (lock2) Locks.Add(this); + } else { + List locks; + lock (lock2) { + locks = Locks.ToList(); + } + foreach (var tlock in locks) lock (tlock) ; + } + } } + public void Dispose() { + lock (lock2) { + Locks.Remove(this); + System.Threading.Monitor.Exit(this); + } + } + } + public IDisposable ApplyStyleWithLock() { + var theme = Setting(g => g.Theme); + var tlock = new ThemeLock(theme); + ApplyStyle(); + return tlock; } public void ApplyStyle() { - // Set OS Theme - var theme = Setting(g => g.Theme); - if (CurrentTheme != theme) { - if (theme == null || theme.Equals("default", StringComparison.OrdinalIgnoreCase)) { - if (!(string.IsNullOrEmpty(CurrentTheme) && CurrentTheme.Equals("default", StringComparison.OrdinalIgnoreCase))) { - NorthHorizon.Samples.SystemThemeChange.ThemeHelper.Reset(); - Errors.Message("Resetting OS Theme."); - } - } else { - if (!theme.Equals(CurrentTheme, StringComparison.OrdinalIgnoreCase)) { - var tokens = theme.ToLower().Split('.'); - var themename = tokens.First(); - var style = tokens.Skip(1).FirstOrDefault() ?? "normalcolor"; - NorthHorizon.Samples.SystemThemeChange.ThemeHelper.SetTheme(themename, style); - Errors.Message("Setting OS Theme to " + theme); + lock (CurrentTheme) { + // Set OS Theme + var theme = Setting(g => g.Theme); + if (CurrentTheme != theme && !string.IsNullOrWhiteSpace(theme)) { + if (theme == null || theme.Equals("default", StringComparison.OrdinalIgnoreCase)) { + if (!(string.IsNullOrEmpty(CurrentTheme) && CurrentTheme.Equals("default", StringComparison.OrdinalIgnoreCase))) { + NorthHorizon.Samples.SystemThemeChange.ThemeHelper.Reset(); + Errors.Message("Resetting OS Theme."); + } + } else { + if (!theme.Equals(CurrentTheme, StringComparison.OrdinalIgnoreCase)) { + var tokens = theme.ToLower().Split('.'); + var themename = tokens.First(); + var style = tokens.Skip(1).FirstOrDefault() ?? "normalcolor"; + NorthHorizon.Samples.SystemThemeChange.ThemeHelper.SetTheme(themename, style); + Errors.Message("Setting OS Theme to " + theme); + } } + CurrentTheme = theme; } - CurrentTheme = theme; } - // apply Skin - var skin = Ancestor(g => g.Skin != null) ?? Scene; - if (CurrentSkin != skin.Skin) { - var res = skin.SkinResources; - if (res == null) { - try { - var url = new Uri(skin.Skin); - Stream source; - if (url.Scheme == null) source = new FileStream(Compiler.MapPath(skin.Skin), FileMode.Open, FileAccess.Read); - else if (url.IsFile) source = new FileStream(url.LocalPath, FileMode.Open, FileAccess.Read); - else { - var web = new System.Net.WebClient(); - source = web.OpenRead(url); - } - using (source) { - skin.SkinResources = res = (ResourceDictionary)XamlReader.Load(source); + lock (CurrentSkin) { + // apply Skin + var skin = Ancestor(g => g.Skin != null) ?? Scene; + if (CurrentSkin != skin.Skin && !string.IsNullOrWhiteSpace(skin.Skin)) { + var res = skin.SkinResources; + if (res == null) { + try { + var url = new Uri(skin.Skin); + Stream source; + IDisposable flock = null; + try { + if (url.Scheme == null) { + var spath = Compiler.MapPath(skin.Skin); + flock = FileLock(spath); + source = new FileStream(spath, FileMode.Open, FileAccess.Read); + } else if (url.IsFile) { + flock = FileLock(url.LocalPath); + source = new FileStream(url.LocalPath, FileMode.Open, FileAccess.Read); + } else { + var web = new System.Net.WebClient(); + source = web.OpenRead(url); + } + using (source) { + skin.SkinResources = res = (ResourceDictionary)XamlReader.Load(source); + } + } catch { + } finally { + if (flock != null) flock.Dispose(); + } + if (Scene.SkinResources == null) Scene.SkinResources = Application.Current.Resources; + Application.Current.Resources = res; + } catch (Exception ex) { + Errors.Error(string.Format("Error loading Skin {0}.", skin.Skin), "28", skin.XElement ?? XElement); } - if (Scene.SkinResources == null) Scene.SkinResources = Application.Current.Resources; - Application.Current.Resources = res; - } catch (Exception ex) { - Errors.Error(string.Format("Error loading Skin {0}.", skin.Skin), "28", skin.XElement ?? XElement); } + CurrentSkin = skin.Skin; } - CurrentSkin = skin.Skin; } - if (element != null) { TextOptions.SetTextHintingMode(Element, TextHintingMode.Fixed); var rendering = Setting(g => g.TextRenderingMode); @@ -432,33 +588,80 @@ public class Group: Canvas { public IEnumerable Steps() { return Flatten(); } - public void Cleanup() { - if (!string.IsNullOrEmpty(TempPath)) { - element = null; - if (!TempPaths.Contains(TempPath)) { - TempPaths.Add(TempPath); - TempPath = null; + public void Cleanup() { } + + public void SaveXps() { + foreach (var key in XpsDocs.Keys.ToList()) { + var doc = XpsDocs[key]; + + var dir = Path.GetDirectoryName(key); + if (!Directory.Exists(dir)) Directory.CreateDirectory(dir); + if (File.Exists(key)) File.Delete(key); + + using (FileLock(key)) + using (var xpsd = new XpsDocument(key, FileAccess.ReadWrite)) { + // var fds = xpsd.AddFixedDocumentSequence(); + // var w = fds.AddFixedDocument(); + var xw = XpsDocument.CreateXpsDocumentWriter(xpsd); + xw.Write(doc); + //xpsd.Close(); } - } - } - public static void Close(List Processes, Errors errors, IEnumerable scenes) { - Snapshot.SaveXps(Processes, errors); - ImageMagickEncoder.SaveAll(Processes, errors); + XpsDocs.Remove(key); - foreach (var scene in scenes) scene.Cleanup(); + string final; - foreach (var p in Processes) p.WaitForExit(); + if (key.EndsWith("._temp.xps")) { // convert xps to final format + TempFiles.Add(key); + var filename = key.Substring(0, key.Length - "._temp.xps".Length); + var ext = Path.GetExtension(filename); + string device, exe; - foreach (var file in TempFiles) System.IO.File.Delete(file); + //TODO ps2write doesn't work!? Use ghostscript to convert pdf to ps. - AppDomain.CurrentDomain.DomainUnload += (sender, args) => { - foreach (var path in TempPaths) { - try { - Directory.Delete(path, true); - } catch { } + if (ext == ".pdf") { + device = "pdfwrite"; + exe = "gxps-9.05-win32.exe"; + } else { + device = "ps2write"; + exe = "gxps-9.07-win32.exe"; + } + var apath = AppDomain.CurrentDomain.BaseDirectory; + var rpath = (";" + AppDomain.CurrentDomain.RelativeSearchPath) + .Split(';') + .FirstOrDefault(p => File.Exists(Path.Combine(apath, p, "Lazy\\psd2xaml\\Endogine.dll"))); + exe = Path.Combine(apath, rpath, "Lazy\\gxps\\" + exe); + //if (!File.Exists(exe)) exe = Path.Combine(path, @"\gxps.exe"); + var args = string.Format("-sDEVICE={0} -dNOPAUSE \"-sOutputFile={1}\" \"{2}\"", device, filename, key); + var process = NewProcess(exe, args, Path.GetDirectoryName(filename)); + //var keylock = FileLock(key); + //var filelock = FileLock(filename); + process.Exited += (sender, arg) => { + //filelock.Dispose(); + //keylock.Dispose(); + final = filename; + var info = new FileInfo(final); + Errors.Message("Created {0} ({1} pages, {2:f2} MB)", info.Name, doc.Pages.Count, (double)info.Length / (1024 * 1024)); + ImageCreated(); + ExitProcess(process); + }; + process.Start(); + } else { + final = key; + using (FileLock(final)) { + var info = new FileInfo(final); + Errors.Message("Created {0} ({1} pages, {2:f2} MB)", info.Name, doc.Pages.Count, (double)info.Length / (1024 * 1024)); + } + ImageCreated(); } - }; + } + } + + public void Finish() { + SaveXps(); + //ImageMagickEncoder.SaveAll(Processes, compiler.Errors); + + Cleanup(); } string localFilename = null; @@ -505,16 +708,23 @@ public class Group: Canvas { public DateTime OutputVersion { get { if (LocalFilename.Contains(',') || LocalFilename.Contains(';')) { + var locks = LocalFilename.Split(new char[] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries) + .Select(file => FileLock(file)); + return Version = new DateTime(LocalFilename.Split(new char[] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries) .Max(file => { FileInfo info = new FileInfo(file); if (info.Exists) return info.LastWriteTimeUtc.Ticks; else return DateTime.MinValue.Ticks; })); + + foreach (var file in locks) file.Dispose(); } else { FileInfo info = new FileInfo(LocalFilename); - if (info.Exists) return Version = info.LastWriteTimeUtc; - else return Version = DateTime.MinValue; + using (FileLock(LocalFilename)) { + if (info.Exists) return Version = info.LastWriteTimeUtc; + else return Version = DateTime.MinValue; + } } } } @@ -522,7 +732,9 @@ public class Group: Canvas { public void EnsureOutputDir() { foreach (var file in LocalFilename.Split(new char[] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries)) { var dir = Path.GetDirectoryName(file); - if (!Directory.Exists(dir)) Directory.CreateDirectory(dir); + using (FileLock(dir)) { + if (!Directory.Exists(dir)) Directory.CreateDirectory(dir); + } } } @@ -548,6 +760,8 @@ public class Group: Canvas { try { if (NeedsBuilding) Save(); else Errors.Note(string.Format("{0} is up to date.", Filename)); + } catch (CompilerException cex) { + Errors.Error(cex.Message, cex.ErrorCode.ToString(), cex.XObject); } catch (Exception ex) { Errors.Warning("An internal error occurred\n\n" + ex.Message + "\n" + ex.StackTrace, "2", XElement); } diff --git a/XamlImageConverter/XamlCapture/Hash.cs b/XamlImageConverter/XamlCapture/Hash.cs index e4a233f..b6bd8ab 100644 --- a/XamlImageConverter/XamlCapture/Hash.cs +++ b/XamlImageConverter/XamlCapture/Hash.cs @@ -13,7 +13,7 @@ public class Cache { public static string Path { get; set; } - static XNamespace ns = Parser.ns1; + static XNamespace ns = Parser.xic; public static string File(string id, XElement xaml, string type = null, string path = null) { var e = xaml.DescendantsAndSelf(ns + id).FirstOrDefault(); diff --git a/XamlImageConverter/XamlCapture/ImageMagickEncoder.cs b/XamlImageConverter/XamlCapture/ImageMagickEncoder.cs index a122de2..dfe33e5 100644 --- a/XamlImageConverter/XamlCapture/ImageMagickEncoder.cs +++ b/XamlImageConverter/XamlCapture/ImageMagickEncoder.cs @@ -92,8 +92,9 @@ class IntermediateFile { var ext = Path.GetExtension(pdf).ToUpper().TrimStart('.'); var adjoin = " "; if (IntermediateFiles[pdf].Count > 1) adjoin = " -adjoin "; + //var pinfo = new System.Diagnostics.ProcessStartInfo(exe, (GlobalOptions ?? "") + adjoin + sb.ToString() + "\"" + pdf + "\""); var process = Process.Start(exe, (GlobalOptions ?? "") + adjoin + sb.ToString() + "\"" + pdf + "\""); - Processes.Add(process); + lock (Processes) Processes.Add(process); var tpdf = pdf; var tempFiles = IntermediateFiles[tpdf]; process.Exited += (sedner, args) => { diff --git a/XamlImageConverter/XamlCapture/ImageMap.cs b/XamlImageConverter/XamlCapture/ImageMap.cs index f9481ec..d4dcfd1 100644 --- a/XamlImageConverter/XamlCapture/ImageMap.cs +++ b/XamlImageConverter/XamlCapture/ImageMap.cs @@ -300,7 +300,7 @@ private class Renderer: UIElement { } public IEnumerable Areas() { - var group = new DrawingGroup(); + /* var group = new DrawingGroup(); group.Transform = Transform.Identity; if (Element is Drawing) { group.Children.Add((Drawing)Element); @@ -310,6 +310,20 @@ private class Renderer: UIElement { var onRender = type.GetMethod("OnRender", System.Reflection.BindingFlags.InvokeMethod | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); onRender.Invoke(Element, new object[] { group.Open() }); } else Errors.Error(string.Format("Unsupported Elementtype {0}.", Element.GetType().FullName), "27", Area); + */ + DrawingGroup group = new DrawingGroup(); + if (Element is Drawing) { + if (Element is DrawingGroup) group = (DrawingGroup)Element; + else { + group = new DrawingGroup(); + group.Transform = Transform.Identity; + group.Children.Add((Drawing)Element); + } + } else if (Element is Visual) { + group = VisualTreeHelper.GetDrawing((Visual)Element); + } else { + Errors.Error(string.Format("Unsupported Elementtype {0}.", Element.GetType().FullName), "27", Area); + } // compute transform var ta = TransformToAncestor(Scene.Element, Element); @@ -604,6 +618,7 @@ private class Renderer: UIElement { System.IO.File.WriteAllText(file, str.ToString(), Encoding.UTF8); Errors.Message("Created {0} html image map.", Path.GetFileName(file)); + ImageCreated(); } } } diff --git a/XamlImageConverter/XamlCapture/Parameters.cs b/XamlImageConverter/XamlCapture/Parameters.cs index 65dea9a..607d686 100644 --- a/XamlImageConverter/XamlCapture/Parameters.cs +++ b/XamlImageConverter/XamlCapture/Parameters.cs @@ -18,6 +18,7 @@ public class Parameters : Group, Step { Dictionary values = new Dictionary(); Dictionary xobjects = new Dictionary(); + public bool First = true; public Parameters() { } @@ -87,12 +88,14 @@ public Parameters(XElement element) return xobjects.ContainsKey(key) ? xobjects[key] : null; } - static Dictionary> undoStack = new Dictionary>(); + static Dictionary> undoStack = new Dictionary>(); public Stack UndoStack { get { - if (Scene == null) return null; - if (!undoStack.ContainsKey(Scene)) undoStack[Scene] = new Stack(); - return undoStack[Scene]; + lock (undoStack) { + if (Scene == null) return null; + if (!undoStack.ContainsKey(Scene.Element)) undoStack.Add(Scene.Element, new Stack()); + return undoStack[Scene.Element]; + } } } @@ -129,6 +132,7 @@ public Parameters(XElement element) public FrameworkElement Apply(FrameworkElement element) { var undo = new Parameters(); undo.Compiler = Compiler; + undo.First = First; foreach (var p in values) { string elemName, propName, depPropName = null; Split(p.Key, out elemName, out propName); @@ -158,7 +162,7 @@ public Parameters(XElement element) } else { fieldInfo = t.GetField(propName, BindingFlags.FlattenHierarchy | BindingFlags.Public); if (fieldInfo == null) { - Errors.Error(string.Format(" Set {0}: Element {1} has no property {2}.", p.Key, elemName, propName), "3", XObject(p.Key)); + if (First) Errors.Error(string.Format(" Set {0}: Element {1} has no property {2}.", p.Key, elemName, propName), "3", XObject(p.Key)); } pType = fieldInfo.GetType(); } @@ -168,7 +172,7 @@ public Parameters(XElement element) if (value is string) value = converter.ConvertFromInvariantString(value as string); else value = converter.ConvertFrom(value); } else { - Errors.Error(string.Format(" Set {0}: Cannot convert from {1} to {2}.", p.Key, vType.Name, pType.Name), "4", XObject(p.Key)); + if (First) Errors.Error(string.Format(" Set {0}: Cannot convert from {1} to {2}.", p.Key, vType.Name, pType.Name), "4", XObject(p.Key)); continue; } } @@ -179,9 +183,9 @@ public Parameters(XElement element) undo[p.Key] = fieldInfo.GetValue(elem); fieldInfo.SetValue(elem, value); } - Errors.Message(" {0}={1}", p.Key, value.ToString()); + if (First) Errors.Message(" {0}={1}", p.Key, value.ToString()); } else { - Errors.Error(string.Format(" Set {0}: There is no element {1}.", p.Key, elemName), "5", XObject(p.Key)); + if (First) Errors.Error(string.Format(" Set {0}: There is no element {1}.", p.Key, elemName), "5", XObject(p.Key)); } } if (UndoStack != null) UndoStack.Push(undo); @@ -197,22 +201,28 @@ public Parameters(XElement element) } public override void Process() { - Errors.Message("Set"); + First = First && Compiler.Cpus == 1; + if (First) Errors.Message("Set"); Apply(); + First = false; } } public class Undo: Parameters { public override void Process() { - Errors.Message("Undo"); + First = First && Compiler.Cpus == 1; + if (First) Errors.Message("Undo"); Undo(); + First = false; } } public class Reset: Parameters { public override void Process() { - Errors.Message("Reset"); + First = First && Compiler.Cpus == 1; + if (First) Errors.Message("Reset"); Reset(); + First = false; } } diff --git a/XamlImageConverter/XamlCapture/Parser.cs b/XamlImageConverter/XamlCapture/Parser.cs index 7667179..7c0f269 100644 --- a/XamlImageConverter/XamlCapture/Parser.cs +++ b/XamlImageConverter/XamlCapture/Parser.cs @@ -25,14 +25,14 @@ public class Parser: MarshalByRefObject { public Compiler Compiler { get { return this as Compiler; } } [NonSerialized] - public static string ns1 = "http://schemas.johnshope.com/XamlImageConverter/2012"; + public static XNamespace xic = "http://schemas.johnshope.com/XamlImageConverter/2012"; [NonSerialized] - public static string ns2 ="http://www.chriscavanagh.com/SkinBuilder"; - + public static XNamespace sb = "http://www.chriscavanagh.com/SkinBuilder"; [NonSerialized] - public static XNamespace xic = ns1; + public static XNamespace xamlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation"; [NonSerialized] - public static XNamespace sb = ns2; + public static XNamespace xxamlns = "http://schemas.microsoft.com/winfx/2006/xaml"; + [NonSerialized] public XNamespace ns; @@ -57,8 +57,7 @@ public class Parser: MarshalByRefObject { /// /// Configuration element /// Returns a collection of snapshot bitmaps - public IEnumerable ParseScenes(DateTime Version, XElement config) { - var Root = new Group(); + public IEnumerable ParseScenes(Group Root, DateTime Version, XElement config) { Root.XElement = config; Root.Compiler = Compiler; ns = config.Name.Namespace; @@ -71,24 +70,24 @@ public class Parser: MarshalByRefObject { if (x.Name == ns+"Scene") { Group scene = null; try { - scene = ParseScene(Version, x); + scene = ParseScene(Root, Version, x); } catch (CompilerInnerException ex) { - Errors.Error(ex.Message + "\n" + ex.InnerException.Message + "\n" + ex.InnerException.StackTrace, ex.ErrorCode.ToString(), ex.XObject); + Root.Errors.Error(ex.Message + "\n" + ex.InnerException.Message + "\n" + ex.InnerException.StackTrace, ex.ErrorCode.ToString(), ex.XObject); } catch (CompilerException ex) { - Errors.Error(ex.Message, ex.ErrorCode.ToString(), ex.XObject); + Root.Errors.Error(ex.Message, ex.ErrorCode.ToString(), ex.XObject); } catch (Exception ex) { - Errors.Warning("An internal parsing error occurred\n\n" + ex.Message + "\n" + ex.StackTrace, "2", x); + Root.Errors.Warning("An internal parsing error occurred\n\n" + ex.Message + "\n" + ex.StackTrace, "2", x); } if (scene != null) { Root.Children.Add(scene); yield return scene; } } else { - Errors.Error("Invalid element " + x.Name.LocalName, "24", x); + Root.Errors.Error("Invalid element " + x.Name.LocalName, "24", x); } } } else { - Errors.Error("Invalid namespace " + config.Name.NamespaceName, "25", config); + Root.Errors.Error("Invalid namespace " + config.Name.NamespaceName, "25", config); } } @@ -97,7 +96,7 @@ public class Parser: MarshalByRefObject { /// /// A collection of snapshot configuration elements /// Returns a list of s - public Group ParseScene(DateTime Version, XElement x) { + public Group ParseScene(Group Root, DateTime Version, XElement x) { var scene = new Group() { Compiler = Compiler, XElement = x, IsScene = true }; var xaml = x.Elements(ns+"Xaml").SingleOrDefault(); @@ -168,7 +167,7 @@ public class Parser: MarshalByRefObject { foreach (var node in x.Nodes().Where(node => !(node is XElement || node is XComment || (node is XText && (string.IsNullOrWhiteSpace(((XText)node).Value) || node.NodeType == System.Xml.XmlNodeType.Whitespace || node.NodeType == System.Xml.XmlNodeType.SignificantWhitespace))))) { - Errors.Error(string.Format("Invalid content {0}", node.ToString(SaveOptions.DisableFormatting | SaveOptions.OmitDuplicateNamespaces)), "23", node); + Root.Errors.Error(string.Format("Invalid content {0}", node.ToString(SaveOptions.DisableFormatting | SaveOptions.OmitDuplicateNamespaces)), "23", node); } return scene; @@ -201,17 +200,17 @@ public class Parser: MarshalByRefObject { } foreach (var node in x.Nodes().Where(node => !(node is XElement || node is XComment || (node is XText && (string.IsNullOrWhiteSpace(((XText)node).Value) || node.NodeType == System.Xml.XmlNodeType.Whitespace || node.NodeType == System.Xml.XmlNodeType.SignificantWhitespace))))) { - Errors.Error(string.Format("Invalid content {0}", node.ToString(SaveOptions.DisableFormatting | SaveOptions.OmitDuplicateNamespaces)), "23", node); + container.Errors.Error(string.Format("Invalid content {0}", node.ToString(SaveOptions.DisableFormatting | SaveOptions.OmitDuplicateNamespaces)), "23", node); } } return item; } - public void ValidAttributes(XElement x, params string[] names) { + public void ValidAttributes(XElement x, Group container, params string[] names) { foreach (var a in x.Attributes()) { if (!names.Contains(a.Name.LocalName)) { - Errors.Error("Invalid attribute " + a.Name.LocalName, "22", a); + container.Errors.Error("Invalid attribute " + a.Name.LocalName, "22", a); } } } @@ -240,10 +239,11 @@ public class Parser: MarshalByRefObject { Loop = (int?)x.Attribute("Loop") ?? 1, Pause = (double?)x.Attribute("Pause") ?? 0, Type = (string)x.Attribute("Type"), - Hash = (int?)x.Attribute("Hash") + Hash = (int?)x.Attribute("Hash"), + Layer = (int?)x.Attribute("Layer") }; - ValidAttributes(x, "Element", "Storyboard", "Frames", "Filmstrip", "Dpi", "Quality", "Filename", "Left", "Top", "Right", "Bottom", "Width", "Height", "Cultures", "Page", "FitToPage", - "File", "Loop", "Pause", "Skin", "Theme", "TextMode", "Type", "Image", "Culture", "Hash"); + ValidAttributes(x, container, "Element", "Storyboard", "Frames", "Filmstrip", "Dpi", "Quality", "Filename", "Left", "Top", "Right", "Bottom", "Width", "Height", "Cultures", "Page", "FitToPage", + "File", "Loop", "Pause", "Skin", "Theme", "TextMode", "Type", "Image", "Culture", "Hash", "Layer"); break; case "ImageMap": case "Map": @@ -287,18 +287,18 @@ public class Parser: MarshalByRefObject { break; case "Undo": result = new Undo(); - ValidAttributes(x); + ValidAttributes(x, container); break; case "Reset": result = new Reset(); - ValidAttributes(x); + ValidAttributes(x, container); break; case "Group": result = new Group { OutputPath = (string)x.Attribute("OutputPath") }; - ValidAttributes(x, "Element", "OutputPath", "Left", "Top", "Right", "Bottom", "Width", "Height", "Skin", "Theme", "TextMode"); + ValidAttributes(x, container, "Element", "OutputPath", "Left", "Top", "Right", "Bottom", "Width", "Height", "Skin", "Theme", "TextMode"); break; default: - Errors.Error("Invalid element " + x.Name.LocalName, "20", x); + container.Errors.Error("Invalid element " + x.Name.LocalName, "20", x); result = new Group(); break; } diff --git a/XamlImageConverter/XamlCapture/Snapshot.cs b/XamlImageConverter/XamlCapture/Snapshot.cs index 2b361fd..e6faf6f 100644 --- a/XamlImageConverter/XamlCapture/Snapshot.cs +++ b/XamlImageConverter/XamlCapture/Snapshot.cs @@ -51,7 +51,6 @@ public class Snapshot: Group, Step { } set { base.Filename = value; } } - /// /// Save a snapshot of a WPF element /// @@ -67,8 +66,6 @@ public class Snapshot: Group, Step { } } - static Dictionary XpsDocs = new Dictionary(); - double ParseLength(string token) { double res = 0; if (token.EndsWith("mm") && double.TryParse(token.Substring(0, token.Length-2), out res)) return res*3.779528; @@ -79,7 +76,7 @@ public class Snapshot: Group, Step { return res; } - public Size GetSize() { + public Size GetSize(FrameworkElement element) { Size size = new Size(96 * 8.3, 96 * 11.7); // A4; if (!string.IsNullOrEmpty(Page)) { var page = Page.ToLower(); @@ -124,10 +121,7 @@ public class Snapshot: Group, Step { case "ledger": return new Size(96 * 11, 96 * 17); case "tabloid": return new Size(96 * 17, 96 * 11); default: - FrameworkElement e; - if (string.IsNullOrEmpty(ElementName)) e = Scene.Element as FrameworkElement; - else e = Element as FrameworkElement; - return e.DesiredSize; + return Element.DesiredSize; } } return size; @@ -135,9 +129,11 @@ public class Snapshot: Group, Step { private void SaveXpsPage(string filename) { + var clone = VisualClone(); + if (!XpsDocs.ContainsKey(filename)) { var d = new FixedDocument(); - d.DocumentPaginator.PageSize = GetSize(); + d.DocumentPaginator.PageSize = GetSize(clone); XpsDocs.Add(filename, d); } var doc = XpsDocs[filename]; @@ -146,9 +142,10 @@ public class Snapshot: Group, Step { var pg = new FixedPage(); var canvas = new Canvas(); - var clone = ElementClone(); clone.MeasureAndArrange(new Size(clone.ActualWidth, clone.ActualHeight)); + var width = clone.Width; + var height = clone.Height; canvas.Children.Add(clone); canvas.Width = size.Width; @@ -163,38 +160,17 @@ public class Snapshot: Group, Step { ((IAddChild)cont).AddChild(pg); - cont.Measure(size); - cont.Arrange(new Rect(new Point(), size)); - cont.UpdateLayout(); - - var left = Canvas.GetLeft(this); - var right = Canvas.GetRight(this); - var top = Canvas.GetTop(this); - var bottom = Canvas.GetBottom(this); - var width = Width; - var height = Height; - - if (!double.IsNaN(left) && !double.IsNaN(right)) { width = right - left; right = double.NaN; } - if (!double.IsNaN(top) && !double.IsNaN(bottom)) { height = bottom - top; bottom = double.NaN; } - if (!double.IsNaN(width) && !double.IsNaN(right)) { left = clone.DesiredSize.Width - right - width; right = double.NaN; } - if (!double.IsNaN(height) && !double.IsNaN(bottom)) { top = clone.DesiredSize.Height - bottom - height; bottom = double.NaN; } - if (double.IsNaN(left)) left = 0; - if (double.IsNaN(top)) top = 0; - if (double.IsNaN(width)) width = clone.ActualWidth; - if (double.IsNaN(height)) height = clone.ActualHeight; - Canvas.SetTop(clone, (size.Height - height) / 2); - Canvas.SetLeft(clone, (size.Width - width) / 2); - var clip = new RectangleGeometry(); - clip.Rect = new Rect(left, top, width, height); - clone.Clip = clip; - double zoom = 1; if (FitToPage) zoom = Math.Min(size.Width / width, size.Height / height); if (zoom != 1) { - canvas.RenderTransform = new ScaleTransform(zoom, zoom); - canvas.RenderTransformOrigin = new Point(size.Width / 2, size.Height / 2); + clone.RenderTransform = new MatrixTransform(zoom, 0, 0, zoom, 0, 0); + width *= zoom; + height *= zoom; } + Canvas.SetLeft(clone, (size.Width - width) / 2); + Canvas.SetTop(clone, (size.Height - height) / 2); + cont.Measure(size); cont.Arrange(new Rect(new Point(), size)); cont.UpdateLayout(); @@ -218,37 +194,42 @@ public class Snapshot: Group, Step { } ext = ext.ToLower(); - if (ext == ".eps" || ext == ".ps" || ext == ".pdf") SaveXpsPage(filename + "._temp.xps"); - else if (ext == ".xps") SaveXpsPage(filename); + if (ext == ".eps" || ext == ".ps" || ext == ".pdf") { + TempFiles.Add(XpsTempFile); + SaveXpsPage(filename + "._temp.xps"); + } else if (ext == ".xps") SaveXpsPage(filename); else if (ext == ".xaml") { - var element = Element ?? Scene; - var xamlsave = false; - if (Element == null) { - if (Scene.XamlPath != null) { - DirectoryCopy(Scene.XamlPath, Path.GetDirectoryName(filename)); - File.Move(Path.Combine(Path.GetDirectoryName(filename), Path.GetFileName(Scene.XamlFile)), filename); - File.WriteAllText(LocalFilename, File.ReadAllText(filename).Replace(Scene.XamlPath + "\\", "")); - } else if (Scene.XamlFile != null) File.Copy(Scene.XamlFile, filename); - else if (Scene.Source.ToLower().EndsWith(".svg") || Scene.Source.ToLower().EndsWith(".svgz")) { - SvgConvert.ConvertUtility.ConvertSvg(Compiler.MapPath(Scene.Source), filename); - } else xamlsave = true; - } else { - xamlsave = true; - } - if (xamlsave) { - var settings = new System.Xml.XmlWriterSettings(); - settings.CheckCharacters = true; - settings.CloseOutput = true; - settings.Encoding = Encoding.UTF8; - settings.Indent = true; - settings.IndentChars = " "; - using (var w = System.Xml.XmlWriter.Create(filename, settings)) { - try { - XamlWriter.Save(element, w); - } catch { } + using (FileLock(filename)) { + var xamlsave = false; + if (Element == Scene.Element) { + if (Scene.XamlPath != null) { + DirectoryCopy(Scene.XamlPath, Path.GetDirectoryName(filename)); + File.Move(Path.Combine(Path.GetDirectoryName(filename), Path.GetFileName(Scene.XamlFile)), filename); + File.WriteAllText(filename, File.ReadAllText(filename).Replace(Scene.XamlPath + "\\", "")); + } else if (Scene.XamlFile != null) { + File.Copy(Scene.XamlFile, filename); + } else if (Scene.Source.ToLower().EndsWith(".svg") || Scene.Source.ToLower().EndsWith(".svgz")) { + SvgConvert.ConvertUtility.ConvertSvg(Compiler.MapPath(Scene.Source), filename); + } else xamlsave = true; + } else { + xamlsave = true; + } + if (xamlsave) { + var settings = new System.Xml.XmlWriterSettings(); + settings.CheckCharacters = true; + settings.CloseOutput = true; + settings.Encoding = Encoding.UTF8; + settings.Indent = true; + settings.IndentChars = " "; + using (var w = System.Xml.XmlWriter.Create(filename, settings)) { + try { + XamlWriter.Save(Element, w); + } catch { } + } } + Errors.Message("Created {0} ({1} MB RAM used)", Path.GetFileName(Filename), System.Environment.WorkingSet / (1024 * 1024)); + ImageCreated(); } - Errors.Message("Created {0} ({1} MB RAM used)", Path.GetFileName(Filename), System.Environment.WorkingSet / (1024 * 1024)); } else { Bitmaps = Capture.GetBitmaps(this).ToList(); var encoder = CreateEncoder(filename, Quality, Dpi); @@ -256,7 +237,7 @@ public class Snapshot: Group, Step { if (Filmstrip) encoder.Frames.Add(BitmapFrame.Create(MakeFilmstrip(Bitmaps, Dpi))); else foreach (var b in Bitmaps) encoder.Frames.Add(BitmapFrame.Create(b)); - encoder.Save(filename); + using (FileLock(filename)) encoder.Save(filename); if (Loop != 1 && ext == ".gif") { string file = Path.GetFileName(filename); @@ -269,23 +250,20 @@ public class Snapshot: Group, Step { var args = " -loop " + Loop; if (Pause != 0) args += " -pause " + Pause; args += " " + file + " " + file; - var pinfo = new System.Diagnostics.ProcessStartInfo(exe); - pinfo.CreateNoWindow = true; - pinfo.Arguments = args; - pinfo.UseShellExecute = false; - pinfo.RedirectStandardOutput = true; - pinfo.RedirectStandardError = true; - pinfo.RedirectStandardInput = true; - pinfo.WorkingDirectory = Path.GetDirectoryName(filename); - var process = System.Diagnostics.Process.Start(pinfo); - Processes.Add(process); + var process = NewProcess(exe, args, Path.GetDirectoryName(filename)); + //var filelock = FileLock(filename); var filename2 = file; var frames = Bitmaps.Count(); process.Exited += (sender, args2) => { Errors.Message("Created {0} ({1}{2} MB RAM used)", filename2, (frames != 1) ? frames.ToString() + " frames, " : "", System.Environment.WorkingSet / (1024 * 1024)); + //filelock.Dispose(); + ImageCreated(); + ExitProcess(process); }; + process.Start(); } else { Errors.Message("Created {0} ({1}{2} MB RAM used)", Path.GetFileName(Filename), (Bitmaps.Count() != 1) ? Bitmaps.Count().ToString() + " frames, " : "", System.Environment.WorkingSet / (1024 * 1024)); + ImageCreated(); } } @@ -295,69 +273,7 @@ public class Snapshot: Group, Step { return this; } - public static void SaveXps(List Processes, Errors errors) { - foreach (var key in XpsDocs.Keys.ToList()) { - var doc = XpsDocs[key]; - var dir = Path.GetDirectoryName(key); - if (!Directory.Exists(dir)) Directory.CreateDirectory(dir); - if (File.Exists(key)) File.Delete(key); - - using (XpsDocument xpsd = new XpsDocument(key, FileAccess.ReadWrite)) { - // var fds = xpsd.AddFixedDocumentSequence(); - // var w = fds.AddFixedDocument(); - var xw = XpsDocument.CreateXpsDocumentWriter(xpsd); - xw.Write(doc); - //xpsd.Close(); - } - - XpsDocs.Remove(key); - - string final; - - if (key.EndsWith("._temp.xps")) { // convert xps to final format - TempFiles.Add(key); - var filename = key.Substring(0, key.Length - "._temp.xps".Length); - var ext = Path.GetExtension(filename); - string device, exe; - - //TODO ps2write doesn't work!? Use ghostscript to convert pdf to ps. - - if (ext == ".pdf") { - device = "pdfwrite"; - exe = "gxps-9.05-win32.exe"; - } else { - device = "ps2write"; - exe = "gxps-9.07-win32.exe"; - } - var apath = AppDomain.CurrentDomain.BaseDirectory; - var rpath = (";" + AppDomain.CurrentDomain.RelativeSearchPath) - .Split(';') - .FirstOrDefault(p => File.Exists(Path.Combine(apath, p, "Lazy\\psd2xaml\\Endogine.dll"))); - exe = Path.Combine(apath, rpath, "Lazy\\gxps\\" + exe); - //if (!File.Exists(exe)) exe = Path.Combine(path, @"\gxps.exe"); - var pinfo = new System.Diagnostics.ProcessStartInfo(exe); - pinfo.CreateNoWindow = true; - pinfo.Arguments = string.Format("-sDEVICE={0} -dNOPAUSE \"-sOutputFile={1}\" \"{2}\"", device, filename, key); - pinfo.UseShellExecute = false; - pinfo.RedirectStandardOutput = true; - pinfo.RedirectStandardError = true; - pinfo.RedirectStandardInput = true; - pinfo.WorkingDirectory = Path.GetDirectoryName(filename); - var process = System.Diagnostics.Process.Start(pinfo); - process.Exited += (sender, args) => { - final = filename; - var info = new FileInfo(final); - errors.Message("Created {0} ({1} pages, {2:f2} MB)", info.Name, doc.Pages.Count, (double)info.Length / (1024 * 1024)); - }; - Processes.Add(process); - } else { - final = key; - var info = new FileInfo(final); - errors.Message("Created {0} ({1} pages, {2:f2} MB)", info.Name, doc.Pages.Count, (double)info.Length / (1024*1024)); - } - } - } /// /// Create a based on the target file extension diff --git a/XamlImageConverter/XamlCapture/WPFExtensions.cs b/XamlImageConverter/XamlCapture/WPFExtensions.cs index 17a525b..80c0e5d 100644 --- a/XamlImageConverter/XamlCapture/WPFExtensions.cs +++ b/XamlImageConverter/XamlCapture/WPFExtensions.cs @@ -161,6 +161,7 @@ public static class WPFExtensions { public static Rect Bounds(this FrameworkElement e, FrameworkElement from) { var bounds = new Rect(0, 0, e.ActualWidth, e.ActualHeight); + if (from == null) return bounds; var t = e.TransformToVisual(from); if (t != Transform.Identity) bounds = t.TransformBounds(bounds); return bounds; diff --git a/XamlImageConverter/XamlCapture/XamlScene.cs b/XamlImageConverter/XamlCapture/XamlScene.cs index 7293f38..c3a2d3f 100644 --- a/XamlImageConverter/XamlCapture/XamlScene.cs +++ b/XamlImageConverter/XamlCapture/XamlScene.cs @@ -15,8 +15,8 @@ public static class XamlScene { public static void ApplyParameters(Compiler compiler, XElement e, string filename, Dictionary parameters) { var type = "png"; - int hash = 0; - bool addhash = false, nohash = false; + int? hash = null; + bool nohash = false; foreach (var key in parameters.Keys.ToList()) { @@ -24,18 +24,16 @@ public static class XamlScene { if (key == "Image" || key == "File" || key == "Filename") nohash = true; else if (key == "Type") type = parameters["Type"]; else { - addhash = !nohash; - hash += Hash.Compute(key + "=" + parameters[key]); + hash = (hash ?? 0) + Hash.Compute(key + "=" + parameters[key]); } e.SetAttributeValue(key, parameters[key]); parameters.Remove(key); - addhash = !nohash; } else { - addhash = !nohash; - hash += Hash.Compute(key + "=" + parameters[key]); + hash = (hash ?? 0) + Hash.Compute(key + "=" + parameters[key]); + if (key == "Source") parameters.Remove(key); } } - if (addhash) { + if (hash != null && !nohash) { compiler.hash = hash; e.SetAttributeValue("Hash", hash); } @@ -47,13 +45,17 @@ public static class XamlScene { public static XElement CreateDirect(Compiler compiler, string filename, Dictionary parameters) { if (filename.EndsWith(".xic.xaml")) { foreach (var key in validAttributes) parameters.Remove(key); - return XElement.Load(compiler.MapPath(filename), LoadOptions.PreserveWhitespace | LoadOptions.SetBaseUri | LoadOptions.SetLineInfo); + filename = compiler.MapPath(filename); + using (compiler.FileLock(filename)) { + return XElement.Load(filename, LoadOptions.PreserveWhitespace | LoadOptions.SetBaseUri | LoadOptions.SetLineInfo); + } } XElement snapshot; var res = new XElement(xic + "XamlImageConverter", - new XElement(xic + "Scene", + new XAttribute(XNamespace.Xmlns+"xic", xic.NamespaceName), + new XElement(xic+"Scene", new XAttribute("Source", filename), - snapshot = new XElement(xic + "Snapshot") + snapshot = new XElement(xic+"Snapshot") ) ); ApplyParameters(compiler, snapshot, null, parameters); @@ -62,17 +64,32 @@ public static class XamlScene { public static XElement CreateDirect(Compiler compiler, string filename, XElement e, Dictionary parameters) { XElement scene; - if (e.Name == xic + "XamlImageConverter") return e; - var res = new XElement(xic + "XamlImageConverter", - scene = new XElement(xic + "Scene", new XElement(xic + "Xaml", e)) - ); - if (parameters.ContainsKey("Image") || parameters.ContainsKey("File") || parameters.ContainsKey("Filename") || parameters.ContainsKey("Type")) { - var snapshot = new XElement(xic + "Snapshot"); - ApplyParameters(compiler, snapshot, filename, parameters); - scene.Add(snapshot); + if (e.Name != xic + "XamlImageConverter") { + XNamespace mc = "http://schemas.openxmlformats.org/markup-compatibility/2006"; + var res = new XElement(xic + "XamlImageConverter", + new XAttribute("xmlns", Parser.xamlns), + new XAttribute(XNamespace.Xmlns+"x", Parser.xxamlns.NamespaceName), + new XAttribute(XNamespace.Xmlns+"xic", xic.NamespaceName), + new XAttribute(XNamespace.Xmlns+"mc", mc.NamespaceName), + new XAttribute(XNamespace.Xmlns+"d", "http://schemas.microsoft.com/expression/blend/2008"), + new XAttribute(mc+"Ignorable", "d"), + scene = new XElement(xic+"Scene", new XElement(xic+"Xaml", e)) + ); + if (e.Name.NamespaceName == "") { + e.Name = Parser.xamlns + e.Name.LocalName; + foreach (var child in e.Descendants()) { + if (child.Name.NamespaceName == "") child.Name = Parser.xamlns + child.Name.LocalName; + } + } + if (parameters.ContainsKey("Image") || parameters.ContainsKey("File") || parameters.ContainsKey("Filename") || parameters.ContainsKey("Type")) { + var snapshot = new XElement(xic + "Snapshot"); + ApplyParameters(compiler, snapshot, filename, parameters); + scene.Add(snapshot); + } + return res; + } else { + return e; } - - return res; } public static XElement CreateAxd(Compiler compiler, Dictionary par) { @@ -81,9 +98,9 @@ public static class XamlScene { compiler.Errors.Error("Source cannot be empty.", "32", new TextSpan()); return null; } - if (src.Trim()[0] == '#') src = (string)System.Web.HttpContext.Current.Session["XamlImageConverter.Xaml:" + src]; + if (src.Trim()[0] == '#') src = (string)compiler.Context.Session[src]; if (!src.Trim().StartsWith("<")) return CreateDirect(compiler, src, par); - return CreateDirect(compiler, XamlImageHandler.Cache + "/" + Hash.Compute(src).ToString("X") , XElement.Parse(src, LoadOptions.PreserveWhitespace | LoadOptions.SetBaseUri | LoadOptions.SetLineInfo), par); + return CreateDirect(compiler, "xic.axd" , XElement.Parse(src, LoadOptions.PreserveWhitespace | LoadOptions.SetBaseUri | LoadOptions.SetLineInfo), par); } } } diff --git a/XamlImageConverter/XamlImageConverter.csproj b/XamlImageConverter/XamlImageConverter.csproj index 718b3f0..78af045 100644 --- a/XamlImageConverter/XamlImageConverter.csproj +++ b/XamlImageConverter/XamlImageConverter.csproj @@ -63,6 +63,7 @@ 3.5 + @@ -104,6 +105,17 @@ + + XamlImageConverter.xsd + + + MSDataSetGenerator + XamlImageConverter.Designer.cs + Designer + + + XamlImageConverter.xsd + @@ -602,6 +614,11 @@ + + True + True + XamlImageConverter.xsd + @@ -673,6 +690,7 @@ PreserveNewest + Designer PreserveNewest diff --git a/XamlImageConverter/XamlImageHandler.cs b/XamlImageConverter/XamlImageHandler.cs index 7456f9a..88992cb 100644 --- a/XamlImageConverter/XamlImageHandler.cs +++ b/XamlImageConverter/XamlImageHandler.cs @@ -11,21 +11,23 @@ namespace XamlImageConverter { [Configuration.ConfigurationSection(Name = "XamlImageConverter")] public class HttpHandlerConfiguration: Configuration.ConfigurationSection { - [ConfigurationProperty("useService", IsRequired = false, DefaultValue = false)] public bool UseSevice { get { return (bool)(this["useService"] ?? true); } set { this["useService"] = value; } } - [ConfigurationProperty("log", IsRequired = false, DefaultValue = true)] public bool Log { get { return (bool)(this["log"] ?? true); } set { this["log"] = value; } } - [ConfigurationProperty("cache", IsRequired = false, DefaultValue = null)] public string Cache { get { return (string)this["cache"]; } set { this["cache"] = value; } } - [ConfigurationProperty("separateDomain", IsRequired = false, DefaultValue = false)] public bool SeparateDomain { get { return (bool)(this["separateDomain"] ?? false); } set { this["separateDomain"] = value; } } + [ConfigurationProperty("gcLevel", IsRequired = false, DefaultValue = 1)] + public int GCLevel { get { return (int)(this["gcLevel"] ?? 1); } set { this["gcLevel"] = value; } } + [ConfigurationProperty("cores", IsRequired = false, DefaultValue = null)] + public int? Cores { get { return (int?)(this["cores"]); } set { this["cores"] = value; } } + [ConfigurationProperty("parallel", IsRequired = false, DefaultValue = false)] + public bool Parallel { get { return (bool)(this["parallel"] ?? false); } set { this["parallel"] = value; } } } - public class XamlImageHandler: System.Web.IHttpHandler { + public class XamlImageHandler: System.Web.IHttpHandler, System.Web.SessionState.IReadOnlySessionState { public XamlImageHandler(): base() { } @@ -33,6 +35,9 @@ public class XamlImageHandler: System.Web.IHttpHandler { public static bool Log { get; set; } public static string Cache { get; set; } public static bool SeparateDomain { get; set; } + public int GCLevel { get; set; } + public int? Cores { get; set; } + public bool Parallel { get; set; } public static bool CustomConfig = false; public bool IsReusable { @@ -47,23 +52,66 @@ public class XamlImageHandler: System.Web.IHttpHandler { var log = (bool?)app["XamlImageConverter.Configuration.Log"]; var cache = (string)app["XamlImageConverter.Configuration.Cache"]; var domain = (bool?)app["XamlImageConverter.Configuration.SeparateDomain"]; + var gclevel = (int?)app["XamlImageConverter.Configuration.GCLevel"]; + var cores = (int?)app["XamlImageConverter.Configuration.Cores"]; + var parallel = (bool?)app["XamlImageConverter.Configuration.Parallel"]; app.UnLock(); if (useService.HasValue || log.HasValue || cache != null || domain.HasValue) { if (useService.HasValue) UseService = useService.Value; if (log.HasValue) Log = log.Value; if (cache != null) Cache = cache; if (domain.HasValue) SeparateDomain = domain.Value; + if (gclevel.HasValue) GCLevel = gclevel.Value; + if (cores.HasValue) Cores = cores.Value; + if (parallel.HasValue) Parallel = parallel.Value; } else { var c = new HttpHandlerConfiguration(); UseService = c.UseSevice; Log = c.Log; Cache = c.Cache; SeparateDomain = c.SeparateDomain; + GCLevel = c.GCLevel; } CustomConfig = true; } } + public static Dictionary Locks = new Dictionary(); + + + public void Serve(System.Web.HttpContext context, string ext, string name, string image) { + switch (ext) { + case "bmp": context.Response.ContentType = "image/bmp"; break; + case "png": context.Response.ContentType = "image/png"; break; + case "jpg": + case "jpeg": context.Response.ContentType = "image/jpeg"; break; + case "tif": + case "tiff": context.Response.ContentType = "image/tiff"; break; + case "gif": context.Response.ContentType = "image/gif"; break; + case "wdp": context.Response.ContentType = "image/vnd.ms-photo"; break; + case "pdf": + context.Response.AppendHeader("content-disposition", "attachment; filename=" + name); + context.Response.ContentType = "application/pdf"; break; + case "xps": + context.Response.AppendHeader("content-disposition", "attachment; filename=" + name); + context.Response.ContentType = "application/vnd.ms-xpsdocument"; break; + case "eps": + case "ps": + context.Response.AppendHeader("content-disposition", "attachment; filename=" + name); + context.Response.ContentType = "application/postscript"; break; + case "psd": + context.Response.AppendHeader("content-disposition", "attachment; filename=" + name); + context.Response.ContentType = "image/photoshop"; break; + case "svg": + case "svgz": context.Response.ContentType = "image/svg+xml"; break; + case "xaml": context.Response.ContentType = "application/xaml+xml"; break; + default: break; + } + if (System.IO.File.Exists(image)) context.Response.WriteFile(image); + else context.Response.StatusCode = 404; + context.Response.End(); + } + public void ProcessRequest(System.Web.HttpContext context) { try { var filename = context.Request.AppRelativeCurrentExecutionFilePath; @@ -79,7 +127,7 @@ public class XamlImageHandler: System.Web.IHttpHandler { image = image ?? filename + "." + ext; par.Add("Type", ext); } else direct = image == null; - } else direct = true; + } else if (ext != ".axd") direct = true; var name = System.IO.Path.GetFileName(image); image = context.Server.MapPath(image); @@ -103,50 +151,34 @@ public class XamlImageHandler: System.Web.IHttpHandler { compiler.SeparateAppDomain = !UseService && SeparateDomain; compiler.UseService = UseService; compiler.Parameters = par; + compiler.Context = context; + compiler.Parallel = Parallel; + compiler.Cores = Cores; + compiler.GCLevel = GCLevel; if (Log) compiler.Loggers.Add(new FileLogger()); if (!string.IsNullOrEmpty(cultureid)) { compiler.Culture = CultureInfo.GetCultureInfo(cultureid); } - compiler.Compile(); - - if (compiler.hash.HasValue) { - image = System.IO.Path.ChangeExtension(image, "." + compiler.hash.Value.ToString("X") + System.IO.Path.GetExtension(image)); + compiler.Serve = () => { + if (compiler.hash.HasValue) { + image = System.IO.Path.ChangeExtension(image, "." + compiler.hash.Value.ToString("X") + System.IO.Path.GetExtension(image)); + } + Serve(context, ext, name, image); + }; + + var lockpath = skinpath; + if (lockpath.EndsWith("xic.axd")) lockpath = lockpath + image; + lock (Locks) { if (!Locks.ContainsKey(skinpath)) Locks.Add(lockpath, new object()); } + lock (Locks[lockpath]) { + compiler.Compile(); } - } - switch (ext) { - case "bmp": context.Response.ContentType = "image/bmp"; break; - case "png": context.Response.ContentType = "image/png"; break; - case "jpg": - case "jpeg": context.Response.ContentType = "image/jpeg"; break; - case "tif": - case "tiff": context.Response.ContentType = "image/tiff"; break; - case "gif": context.Response.ContentType = "image/gif"; break; - case "wdp": context.Response.ContentType = "image/vnd.ms-photo"; break; - case "pdf": - context.Response.AppendHeader("content-disposition", "attachment; filename=" + name); - context.Response.ContentType = "application/pdf"; break; - case "xps": - context.Response.AppendHeader("content-disposition", "attachment; filename=" + name); - context.Response.ContentType = "application/vnd.ms-xpsdocument"; break; - case "eps": - case "ps": - context.Response.AppendHeader("content-disposition", "attachment; filename=" + name); - context.Response.ContentType = "application/postscript"; break; - case "psd": - context.Response.AppendHeader("content-disposition", "attachment; filename=" + name); - context.Response.ContentType = "image/photoshop"; break; - case "svg": - case "svgz": context.Response.ContentType = "image/svg+xml"; break; - case "xaml": context.Response.ContentType = "application/xaml+xml"; break; - default: break; + } else { + Serve(context, ext, name, image); } - if (System.IO.File.Exists(image)) context.Response.WriteFile(image); - else context.Response.StatusCode = 404; - } catch (Exception ex) { context.Response.StatusCode = 500; + context.Response.End(); } - context.Response.End(); } } }