Commit f10b0336 authored by Eric Domke's avatar Eric Domke
Browse files

Various Parsing Bug Fixes

- Implemented .Net 3.5 support mostly by removing ISvgEventCaller
functionality in .Net 3.5 build
- Added ability to parse colors such as rgb(#%, #%, #%)
- Fix issues with calculating the next coordinate after a close figure
and a relative move
- Allow the std. deviation in a gaussian blur to be a float.
- Allow "none" for a unit collection
- Allow gradients to reference other gradients defined later in the SVG
- Fix href attribute bug on the SVG use element
- Adding a descendants convenience methods (similar to the Xml to Linq
API)
- Removed non-functional property from the SvgDescription class to
encourage use of the Content property instead
parent 9643cc69
......@@ -53,16 +53,18 @@
this.open.Image = ((System.Drawing.Image)(resources.GetObject("open.Image")));
this.open.ImageTransparentColor = System.Drawing.Color.Magenta;
this.open.Name = "open";
this.open.Size = new System.Drawing.Size(53, 22);
this.open.Size = new System.Drawing.Size(56, 22);
this.open.Text = "Open";
this.open.Click += new System.EventHandler(this.open_Click);
//
// svgImage
//
this.svgImage.Dock = System.Windows.Forms.DockStyle.Left;
this.svgImage.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.svgImage.Location = new System.Drawing.Point(0, 25);
this.svgImage.Name = "svgImage";
this.svgImage.Size = new System.Drawing.Size(565, 449);
this.svgImage.Size = new System.Drawing.Size(735, 449);
this.svgImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.svgImage.TabIndex = 1;
this.svgImage.TabStop = false;
......@@ -73,11 +75,13 @@
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(571, 25);
this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBox1.Location = new System.Drawing.Point(741, 25);
this.textBox1.MaxLength = 327670;
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(477, 446);
this.textBox1.Size = new System.Drawing.Size(307, 446);
this.textBox1.TabIndex = 2;
this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
//
......@@ -96,6 +100,7 @@
((System.ComponentModel.ISupportInitialize)(this.svgImage)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
......
<svg version="1.1" xmlns:user="urn:user-scripts" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:aras="http://www.aras.com" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<marker id="Triangle" viewBox="0 0 10 6" refX="22" refY="3" markerWidth="10" markerHeight="6" markerUnits="userSpaceOnUse" orient="auto" style="fill:#999;">
<path d="M 0 0 L 10 3 L 0 6 z" />
</marker>
</defs>
<rect style="fill:yellow" x="754" y="282" width="36" height="36" />
<path id="path_A135EC81DDA143DC9D28767B2A41B31D" style="stroke: rgb(52%, 52%, 52%); fill:none; stroke-width: 2px; marker-end: url(#Triangle);" d="M45,212 L109,212" />
<path id="path_6FF994F1BC9F4841950F977A737DDBB8" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M109,212 L246,351" />
<path id="path_E75FD0879CE14583AFBD46320DBCC608" style="stroke: rgb(52%, 52%, 52%); fill:none; stroke-width: 2px; marker-end: url(#Triangle);" d="M109,212 L246,212" />
<path id="path_FA30736F915A4D328A0052667C5F4CF5" style="stroke: rgb(52%, 52%, 52%); fill:none; stroke-width: 2px; marker-end: url(#Triangle);&#xA; opacity: 0;&#xA; " d="M109,212 L246,212" />
<path id="path_98C289D25D164A979817EFAEE13CFE5F" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M246,212 L217,183 L153,183 L109,212" />
<path id="path_72A7FAFD32E048D791AC1BEFCFCEC9D0" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M246,212 L400,212" />
<path id="path_81970D2DC1D04D529CEE9CD6D56A2976" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M246,212 L246,351" />
<path id="path_45C39F121DE043C9897CEA599913FF18" style="stroke: rgb(52%, 52%, 52%); fill:none; stroke-width: 2px; marker-end: url(#Triangle);" d="M246,212 L372,300 L495,300" />
<path id="path_E45EE6187D384A9888495299E8FFA180" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M246,212 L349,258 L480,258 L527,212" />
<path id="path_5E54C1B6B03C412690130BFD4AA11C29" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M246,212 L361,426 L771,426" />
<path id="path_493D6CD66BCB4215B64CA95613A8C4E7" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M246,212 L324,133 L692,133" />
<path id="path_2A4C9573761F4D4082D76D3086C06D14" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M246,212 L351,69" />
<path id="path_F4ADA3A633DA4A2BAC0D1DF37C9E974A" style="stroke: rgb(52%, 52%, 52%); fill:none; stroke-width: 2px; marker-end: url(#Triangle);" d="M495,300 L772,300" />
<path id="path_BD335878BCD949EDA5BD676D82EE95CD" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M495,300 L461,332 L379,332 L246,212" />
<path id="path_31A2E455215649B0955DF48098DBAFB5" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M772,300 L876,300 L969,212" />
<path id="path_07E281627B9B4E6C88C4F416D00FB4D5" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M772,300 L719,353 L610,353" />
<path id="path_16CEC81123CE4437A34A09B2570A513D" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M772,300 L725,392 L396,392 L246,212" />
<path id="path_1D02F0DB7C444FD3A70B9DC2F0D76C1C" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);&#xA; opacity: 0;&#xA; " d="M772,300 L725,392 L396,392 L246,212" />
<path id="path_002289179A4B46EBA27B28323D0A54C7" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);&#xA; opacity: 0;&#xA; " d="M246,212 L217,183 L153,183 L109,212" />
<path id="path_E5E1BAFEC28A4C06BDB27AA52F4FEC6D" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);&#xA; opacity: 0;&#xA; " d="M246,212 L400,212" />
<path id="path_B786DE8A93F34F159B75B7A52D90CE97" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);&#xA; opacity: 0;&#xA; " d="M246,212 L246,351" />
<path id="path_8B5C82191A9D4D2FAD9B987A487C3BA7" style="stroke: rgb(52%, 52%, 52%); fill:none; stroke-width: 2px; marker-end: url(#Triangle);&#xA; opacity: 0;&#xA; " d="M246,212 L372,300 L495,300" />
<path id="path_107E0DAA2EB8485586C479087C1AA226" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);&#xA; opacity: 0;&#xA; " d="M246,212 L349,258 L480,258 L527,212" />
<path id="path_AD1BC5A02C8D477B8169019CAA282F99" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);&#xA; opacity: 0;&#xA; " d="M246,212 L361,426 L771,426" />
<path id="path_5B6980E8BA6D4D4790BADD421037602A" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);&#xA; opacity: 0;&#xA; " d="M246,212 L324,133 L692,133" />
<path id="path_E088B696363F4A6783322F24B4FBAAFB" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);&#xA; opacity: 0;&#xA; " d="M246,212 L351,69" />
<path id="path_4DA4A67EFEF2443FA0A4FE24FA477F11" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M351,69 L448,69 L692,133" />
<path id="path_40867780959E496AA36A6555CD3E33D2" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M351,69 L239,69 L109,212" />
<path id="path_89E0FF64C5734D5CBE0DEF15FCB2FC78" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M400,212 L527,212" />
<path id="path_40ABF0BE79D845A9835EEA8946DC5E13" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M400,212 L368,181 L293,181 L246,212" />
<path id="path_77067CF20C6941088FDC9876FD24F7A6" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);&#xA; opacity: 0;&#xA; " d="M400,212 L368,181 L293,181 L246,212" />
<path id="path_C82DC92658654B059AB8CBA528667ADA" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M500,25 L203,25 L109,212" />
<path id="path_5ABCCBB56C4046859522ED2C9ECD33AD" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M500,25 L692,133" />
<path id="path_B91D6F28E4804A498EFBD5A3D6AF250B" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M527,212 L693,212" />
<path id="path_7F9A959CF641418CBCD4873251B812B3" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M610,353 L548,353 L495,300" />
<path id="path_F284CCEE2AFB4B3BAC3554145B3FD262" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M610,353 L663,300 L772,300" />
<path id="path_2E0294E13A684EBD99F1DB80EDDB9840" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M692,133 L583,25 L500,25" />
<path id="path_A9F0267F5B9744508B9437FE4B0200C4" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M692,133 L749,133 L815,212" />
<path id="path_4CBFE74449654265806D8E904B6EE5BE" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M693,212 L660,180 L560,180 L527,212" />
<path id="path_D87477BFC3BF4F909A04B05F7874846E" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M693,212 L815,212" />
<path id="path_461D5FEE97F646DC8CD142A866D0355F" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M613,469 L202,469 L109,212" />
<path id="path_5AE3619D67904B23B1E93CBD7D1E20D7" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M613,469 L771,426" />
<path id="path_DC4157E0DAE84A46BB953E4BF4510ECE" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M815,212 L969,212" />
<path id="path_330EB66D10C646ADB34B33613E516A4E" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M771,426 L1076,426 L1231,212" />
<path id="path_13D8206671ED47AC920091F58EA1687F" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M771,426 L729,469 L613,469" />
<path id="path_A140353DB1E34B67A51D0CD75D23CBE2" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M771,426 L809,388 L910,388 L969,212" />
<path id="path_6670A0725101421090E5F4CA7624571A" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M969,212 L1132,212" />
<path id="path_FB713A1FF8F9424B8612F8088E7B1F11" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M1132,212 L1231,212" />
<path id="path_9EB82A675F344E598ED07614C26A46EA" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M1132,212 L1098,178 L1004,178 L969,212" />
<path id="path_768FCB23D27C4749B32411A7463D54B1" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M1231,212 L1356,212" />
<path id="path_1BF51A8E49774FDD936814D21809AEC2" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M1231,212 L1167,267 L1025,267 L969,212" />
<ellipse style="fill:white" ry="12" rx="12" cx="45" cy="212" />
<image preserveAspectRatio="xMidYMid" id="node_img_7FCC999FEE5248CDB90824E00D1029BB" height="16" width="16" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/16x16/16x16_arrow_right.gif" x="37" y="204" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_7FCC999FEE5248CDB90824E00D1029BB" x="45" y="238">
<desc>Closed</desc>Start</text>
<ellipse style="fill:white" ry="12" rx="12" cx="109" cy="212" />
<image preserveAspectRatio="xMidYMid" id="node_img_0462DCDBBC314295BD899B481F911C81" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="99" y="201" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_0462DCDBBC314295BD899B481F911C81" x="109" y="238">
<desc>Closed</desc>Submit ECO</text>
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;&#xA; opacity: 0;&#xA; " id="node_label_1F530B42A24F4155B06747CB8F52A8FE" x="246" y="238">
<desc>Closed</desc>MDM Review</text>
<ellipse style="fill:white" ry="12" rx="12" cx="495" cy="300" />
<image preserveAspectRatio="xMidYMid" id="node_img_946BCC8A04FA42EE8917F02183DBD576" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="485" y="289" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_946BCC8A04FA42EE8917F02183DBD576" x="495" y="326">
<desc>Closed</desc>Need Info</text>
<ellipse style="fill:yellow" ry="12" rx="12" cx="772" cy="300" />
<image preserveAspectRatio="xMidYMid" id="node_img_A394CFFCEF61475ABF6F43D4AAA4F278" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="762" y="289" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_A394CFFCEF61475ABF6F43D4AAA4F278" x="772" y="326">
<desc>Active</desc>ECO Plan Approval</text>
<ellipse style="fill:white" ry="12" rx="12" cx="246" cy="212" />
<image preserveAspectRatio="xMidYMid" id="node_img_75B56693C81D461389AA15D5C8017CBF" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="236" y="201" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_75B56693C81D461389AA15D5C8017CBF" x="246" y="238">
<desc>Pending</desc>MDM Review</text>
<ellipse style="fill:white" ry="12" rx="12" cx="351" cy="69" />
<image preserveAspectRatio="xMidYMid" id="node_img_73D771D6831A4F5EA82A766392AB091E" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="341" y="58" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_73D771D6831A4F5EA82A766392AB091E" x="351" y="95">
<desc>Pending</desc>Print/Drawing Update</text>
<ellipse style="fill:white" ry="12" rx="12" cx="400" cy="212" />
<image preserveAspectRatio="xMidYMid" id="node_img_8AF6597A38BB41F288E4EE17F20A8B29" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="390" y="201" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_8AF6597A38BB41F288E4EE17F20A8B29" x="400" y="238">
<desc>Pending</desc>ECO Pre-Approval</text>
<ellipse style="fill:white" ry="12" rx="12" cx="500" cy="25" />
<image preserveAspectRatio="xMidYMid" id="node_img_8476C8E170DC47EA9F05AE2164CABD96" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="490" y="14" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_8476C8E170DC47EA9F05AE2164CABD96" x="500" y="51">
<desc>Pending</desc>Interim Workflow Resolution</text>
<ellipse style="fill:white" ry="12" rx="12" cx="527" cy="212" />
<image preserveAspectRatio="xMidYMid" id="node_img_4517B7B7598A44A1969F30290153FA64" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="517" y="201" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_4517B7B7598A44A1969F30290153FA64" x="527" y="238">
<desc>Pending</desc>Draft Changes</text>
<ellipse style="fill:white" ry="12" rx="12" cx="610" cy="353" />
<image preserveAspectRatio="xMidYMid" id="node_img_7379A1A219DE468FB61D3F1E84C1B042" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="600" y="342" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_7379A1A219DE468FB61D3F1E84C1B042" x="610" y="379">
<desc>Pending</desc>Approval Resolution</text>
<ellipse style="fill:white" ry="12" rx="12" cx="692" cy="133" />
<image preserveAspectRatio="xMidYMid" id="node_img_18F401FCAACC4E8DAC4014EEA576DE51" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="682" y="122" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_18F401FCAACC4E8DAC4014EEA576DE51" x="692" y="159">
<desc>Pending</desc>Change Review</text>
<ellipse style="fill:white" ry="12" rx="12" cx="693" cy="212" />
<image preserveAspectRatio="xMidYMid" id="node_img_014C7DD975FA4E7EB354F9B81E71CB18" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="683" y="201" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_014C7DD975FA4E7EB354F9B81E71CB18" x="693" y="238">
<desc>Pending</desc>Change Review</text>
<ellipse style="fill:white" ry="12" rx="12" cx="613" cy="469" />
<image preserveAspectRatio="xMidYMid" id="node_img_CDE9E46E164645538136D5D120D2593C" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="603" y="458" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_CDE9E46E164645538136D5D120D2593C" x="613" y="495">
<desc>Pending</desc>Pre-Prod Approval Resolution</text>
<ellipse style="fill:white" ry="12" rx="12" cx="815" cy="212" />
<image preserveAspectRatio="xMidYMid" id="node_img_83542AA107564FAABD77DF5C61FBA354" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="805" y="201" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_83542AA107564FAABD77DF5C61FBA354" x="815" y="238">
<desc>Pending</desc>Impl. Plan Review</text>
<ellipse style="fill:white" ry="12" rx="12" cx="771" cy="426" />
<image preserveAspectRatio="xMidYMid" id="node_img_64D911B1C1AD41208373D9AF319AB38D" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="761" y="415" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_64D911B1C1AD41208373D9AF319AB38D" x="771" y="452">
<desc>Pending</desc>Pre-Production Approval</text>
<ellipse style="fill:white" ry="12" rx="12" cx="969" cy="212" />
<image preserveAspectRatio="xMidYMid" id="node_img_43578966BE674CC9A7C0D54FE88E0C91" height="16" width="16" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/customer/16x16 Icons 1/icon_clock.gif" x="961" y="204" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_43578966BE674CC9A7C0D54FE88E0C91" x="969" y="238">
<desc>Pending</desc>Effectivity Wait</text>
<ellipse style="fill:white" ry="12" rx="12" cx="1132" cy="212" />
<image preserveAspectRatio="xMidYMid" id="node_img_D21E5FAE6F784BB19EEE40C334473CBB" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="1122" y="201" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_D21E5FAE6F784BB19EEE40C334473CBB" x="1132" y="238">
<desc>Pending</desc>Impl. Approval</text>
<ellipse style="fill:white" ry="12" rx="12" cx="1231" cy="212" />
<image preserveAspectRatio="xMidYMid" id="node_img_DB1C8B95B26C4069ACC03F0E3D42C249" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="1221" y="201" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_DB1C8B95B26C4069ACC03F0E3D42C249" x="1231" y="238">
<desc>Pending</desc>Impl. Approved</text>
<ellipse style="fill:white" ry="12" rx="12" cx="246" cy="351" />
<image preserveAspectRatio="xMidYMid" id="node_img_67A00DAAD58D4115A63B45049D2B3986" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="236" y="340" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_67A00DAAD58D4115A63B45049D2B3986" x="246" y="377">
<desc>Pending</desc>Cancel</text>
<ellipse style="fill:white" ry="12" rx="12" cx="1356" cy="212" />
<image preserveAspectRatio="xMidYMid" id="node_img_CD08C79BB931412A8C31745DF6A4910A" height="16" width="16" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/customer/16x16 Icons 1/page_favourites.gif" x="1348" y="204" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_CD08C79BB931412A8C31745DF6A4910A" x="1356" y="238">
<desc>Pending</desc>Close Change</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_A135EC81DDA143DC9D28767B2A41B31D" x="51" y="208">Go</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_6FF994F1BC9F4841950F977A737DDBB8" x="135" y="278">Cancel ECO</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_E75FD0879CE14583AFBD46320DBCC608" x="132" y="209">Submit</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_98C289D25D164A979817EFAEE13CFE5F" x="162" y="193">Unsubmit</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_72A7FAFD32E048D791AC1BEFCFCEC9D0" x="268" y="209">iLink - Pre-Approval</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_81970D2DC1D04D529CEE9CD6D56A2976" x="204" y="285">Cancel ECO</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_45C39F121DE043C9897CEA599913FF18" x="368" y="296">Legacy Workflow</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_E45EE6187D384A9888495299E8FFA180" x="350" y="255">iLink - Pre-Approved</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_5E54C1B6B03C412690130BFD4AA11C29" x="363" y="422">Pre-Production Workflow</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_493D6CD66BCB4215B64CA95613A8C4E7" x="324" y="143">Interim Workflow (Approval)</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_2A4C9573761F4D4082D76D3086C06D14" x="226" y="113">Interim Workflow (Prints)</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_F4ADA3A633DA4A2BAC0D1DF37C9E974A" x="508" y="296">Added Info</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_BD335878BCD949EDA5BD676D82EE95CD" x="403" y="341">Re-Review</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_31A2E455215649B0955DF48098DBAFB5" x="783" y="297">Approve ECO</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_07E281627B9B4E6C88C4F416D00FB4D5" x="634" y="362">Need more info</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_16CEC81123CE4437A34A09B2570A513D" x="757" y="342">Reject</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_4DA4A67EFEF2443FA0A4FE24FA477F11" x="358" y="65">Prints Updated</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_40867780959E496AA36A6555CD3E33D2" x="282" y="66">Unsubmit</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_89E0FF64C5734D5CBE0DEF15FCB2FC78" x="414" y="208">Approve</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_40ABF0BE79D845A9835EEA8946DC5E13" x="333" y="190">Reject</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_C82DC92658654B059AB8CBA528667ADA" x="429" y="21">Unsubmit</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_5ABCCBB56C4046859522ED2C9ECD33AD" x="513" y="68">Redo Approval</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_B91D6F28E4804A498EFBD5A3D6AF250B" x="543" y="208">Submit for Review</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_7F9A959CF641418CBCD4873251B812B3" x="496" y="364">Repeat Need Info</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_F284CCEE2AFB4B3BAC3554145B3FD262" x="601" y="323">Repeat Approval</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_2E0294E13A684EBD99F1DB80EDDB9840" x="664" y="104">Reject</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_A9F0267F5B9744508B9437FE4B0200C4" x="702" y="128">Approve</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_4CBFE74449654265806D8E904B6EE5BE" x="619" y="190">Rework</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_D87477BFC3BF4F909A04B05F7874846E" x="706" y="207">Approve</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_461D5FEE97F646DC8CD142A866D0355F" x="544" y="479">Unsubmit</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_5AE3619D67904B23B1E93CBD7D1E20D7" x="608" y="445">Redo Approval</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_DC4157E0DAE84A46BB953E4BF4510ECE" x="825" y="207">Approve Plan</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_330EB66D10C646ADB34B33613E516A4E" x="788" y="421">Approve &amp; Implement</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_13D8206671ED47AC920091F58EA1687F" x="741" y="467">Reject ECO</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_A140353DB1E34B67A51D0CD75D23CBE2" x="810" y="384">Approve &amp; Wait</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_6670A0725101421090E5F4CA7624571A" x="989" y="209">Req. Impl. Approval</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_FB713A1FF8F9424B8612F8088E7B1F11" x="1144" y="208">Ready</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_9EB82A675F344E598ED07614C26A46EA" x="1043" y="188">Not Ready</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_768FCB23D27C4749B32411A7463D54B1" x="1242" y="208">Fully Impl/Close</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_1BF51A8E49774FDD936814D21809AEC2" x="1086" y="277">Continue Wait</text>
</svg>
......@@ -7,9 +7,8 @@ namespace Svg.DataTypes
{
public enum SvgFontWeight
{
inherit,
normal,
bold
}
}
......@@ -45,6 +45,7 @@ namespace Svg
{
if (value is string)
{
if (string.Compare(((string)value).Trim(), "none", StringComparison.InvariantCultureIgnoreCase) == 0) return null;
string[] points = ((string)value).Trim().Split(new char[] { ',', ' ', '\r', '\n', '\t' }, StringSplitOptions.RemoveEmptyEntries);
SvgUnitCollection units = new SvgUnitCollection();
......
......@@ -9,17 +9,9 @@ namespace Svg
[SvgElement("desc")]
public class SvgDescription : SvgElement
{
private string _text;
public string Text
{
get { return this._text; }
set { this._text = value; }
}
public override string ToString()
{
return this.Text;
return this.Content;
}
......@@ -31,7 +23,6 @@ namespace Svg
public override SvgElement DeepCopy<T>()
{
var newObj = base.DeepCopy<T>() as SvgDescription;
newObj.Text = this.Text;
return newObj;
}
......
......@@ -8,6 +8,11 @@ namespace Svg
[SvgElement("title")]
public class SvgTitle : SvgElement
{
public override string ToString()
{
return this.Content;
}
public override SvgElement DeepCopy()
{
return DeepCopy<SvgTitle>();
......
......@@ -13,7 +13,7 @@ namespace Svg
{
private Uri _referencedElement;
[SvgAttribute("xlink:href")]
[SvgAttribute("href", SvgAttributeAttribute.XLinkNamespace)]
public virtual Uri ReferencedElement
{
get { return this._referencedElement; }
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
namespace Svg
{
public static class Extensions
{
public static IEnumerable<SvgElement> Descendants<T>(this IEnumerable<T> source) where T : SvgElement
{
if (source == null) throw new ArgumentNullException("source");
return GetDescendants<T>(source, false);
}
private static IEnumerable<SvgElement> GetAncestors<T>(IEnumerable<T> source, bool self) where T : SvgElement
{
foreach (var start in source)
{
if (start != null)
{
for (var elem = (self ? start : start.Parent) as SvgElement; elem != null; elem = (elem.Parent as SvgElement))
{
yield return elem;
}
}
}
yield break;
}
private static IEnumerable<SvgElement> GetDescendants<T>(IEnumerable<T> source, bool self) where T : SvgElement
{
var positons = new Stack<int>();
int currPos;
SvgElement currParent;
foreach (var start in source)
{
if (start != null)
{
if (self) yield return start;
positons.Push(0);
currParent = start;
while (positons.Count > 0)
{
currPos = positons.Pop();
if (currPos < currParent.Children.Count)
{
yield return currParent.Children[currPos];
currParent = currParent.Children[currPos];
positons.Push(currPos + 1);
positons.Push(0);
}
else
{
currParent = currParent.Parent;
}
}
}
}
yield break;
}
}
}
\ No newline at end of file
......@@ -14,7 +14,7 @@ namespace Svg.FilterEffects
[SvgElement("feGaussianBlur")]
public class SvgGaussianBlur : SvgFilterPrimitive
{
private int _stdDeviation;
private float _stdDeviation;
private BlurType _blurType;
private int[] _kernel;
......@@ -26,12 +26,13 @@ namespace Svg.FilterEffects
{
}
public SvgGaussianBlur(int stdDeviation)
public SvgGaussianBlur(float stdDeviation)
: this(stdDeviation, BlurType.Both)
{
}
public SvgGaussianBlur(int stdDeviation, BlurType blurType) : base()
public SvgGaussianBlur(float stdDeviation, BlurType blurType)
: base()
{
_stdDeviation = stdDeviation;
_blurType = blurType;
......@@ -42,13 +43,13 @@ namespace Svg.FilterEffects
private void PreCalculate()
{
int sz = _stdDeviation * 2 + 1;
int sz = (int)(_stdDeviation * 2 + 1);
_kernel = new int[sz];
_multable = new int[sz, 256];
for (int i = 1; i <= _stdDeviation; i++)
{
int szi = _stdDeviation - i;
int szj = _stdDeviation + i;
int szi = (int)(_stdDeviation - i);
int szj = (int)(_stdDeviation + i);
_kernel[szj] = _kernel[szi] = (szi + 1) * (szi + 1);
_kernelSum += (_kernel[szj] + _kernel[szi]);
for (int j = 0; j < 256; j++)
......@@ -56,11 +57,11 @@ namespace Svg.FilterEffects
_multable[szj, j] = _multable[szi, j] = _kernel[szj] * j;
}
}
_kernel[_stdDeviation] = (_stdDeviation + 1) * (_stdDeviation + 1);
_kernelSum += _kernel[_stdDeviation];
_kernel[(int)_stdDeviation] = (int)((_stdDeviation + 1) * (_stdDeviation + 1));
_kernelSum += _kernel[(int)_stdDeviation];
for (int j = 0; j < 256; j++)
{
_multable[_stdDeviation, j] = _kernel[_stdDeviation] * j;
_multable[(int)_stdDeviation, j] = _kernel[(int)_stdDeviation] * j;
}
}
......@@ -104,7 +105,7 @@ namespace Svg.FilterEffects
for (int i = 0; i < pixelCount; i++)
{
bsum = gsum = rsum = asum = 0;
read = i - _stdDeviation;
read = (int)(i - _stdDeviation);
for (int z = 0; z < _kernel.Length; z++)
{
if (read < start)
......@@ -156,7 +157,7 @@ namespace Svg.FilterEffects
index = 0;
for (int i = 0; i < src.Height; i++)
{
int y = i - _stdDeviation;
int y = (int)(i - _stdDeviation);
start = y * src.Width;
for (int j = 0; j < src.Width; j++)
{
......@@ -223,12 +224,12 @@ namespace Svg.FilterEffects
/// Gets or sets the radius of the blur (only allows for one value - not the two specified in the SVG Spec)
/// </summary>
[SvgAttribute("stdDeviation")]
public int StdDeviation
public float StdDeviation
{
get { return _stdDeviation; }
set
{
if (value < 1)
if (value <= 0)
{
throw new InvalidOperationException("Radius must be greater then 0");
}
......
......@@ -69,7 +69,18 @@ namespace Svg
alphaValue = (int)alphaDecimal;
}
}
Color colorpart = System.Drawing.Color.FromArgb(alphaValue, int.Parse(values[0]), int.Parse(values[1]), int.Parse(values[2]));
Color colorpart;
if (values[0].Trim().EndsWith("%"))
{
colorpart = System.Drawing.Color.FromArgb(alphaValue, (int)(255 * float.Parse(values[0].Trim().TrimEnd('%')) / 100f),
(int)(255 * float.Parse(values[1].Trim().TrimEnd('%')) / 100f),
(int)(255 * float.Parse(values[2].Trim().TrimEnd('%')) / 100f));
}
else
{
colorpart = System.Drawing.Color.FromArgb(alphaValue, int.Parse(values[0]), int.Parse(values[1]), int.Parse(values[2]));
}
return colorpart;
}
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Svg
{
/// <summary>
/// A wrapper for a paint server which isn't defined currently in the parse process, but
/// should be defined by the time the image needs to render.
/// </summary>
public class SvgDeferredPaintServer : SvgPaintServer
{
private bool _serverLoaded = false;
private SvgPaintServer _concreteServer;
public SvgDocument Document { get; set; }
public string DeferredId { get; set; }
public SvgDeferredPaintServer() { }
public SvgDeferredPaintServer(SvgDocument document, string id)
{
this.Document = document;
this.DeferredId = id;
}
private void EnsureServer()
{
if (!_serverLoaded)
{
_concreteServer = this.Document.IdManager.GetElementById(this.DeferredId) as SvgPaintServer;
_serverLoaded = true;
}
}
public override System.Drawing.Brush GetBrush(SvgVisualElement styleOwner, float opacity)
{
EnsureServer();
return _concreteServer.GetBrush(styleOwner, opacity);
}
public override SvgElement DeepCopy()
{
return DeepCopy<SvgDeferredPaintServer>();
}
public override SvgElement DeepCopy<T>()
{
var newObj = base.DeepCopy<T>() as SvgDeferredPaintServer;
newObj.Document = this.Document;
newObj.DeferredId = this.DeferredId;
return newObj;
}
public override bool Equals(object obj)
{
var other = obj as SvgDeferredPaintServer;
if (other == null)
return false;
return this.Document == other.Document && this.DeferredId == other.DeferredId;
}
public override int GetHashCode()
{
if (this.Document == null || this.DeferredId == null) return 0;
return this.Document.GetHashCode() ^ this.DeferredId.GetHashCode();
}
public override string ToString()
{
return (_serverLoaded ? _serverLoaded.ToString() : string.Format("deferred: {0}", this.DeferredId));
}
public static T TryGet<T>(SvgPaintServer server) where T : SvgPaintServer
{
var deferred = server as SvgDeferredPaintServer;
if (deferred == null)
{
return server as T;
}
else
{
return deferred._concreteServer as T;
}
}
}
}
\ No newline at end of file
......@@ -13,7 +13,7 @@ namespace Svg
{
private SvgCoordinateUnits _gradientUnits;
private SvgGradientSpreadMethod _spreadMethod;
private SvgGradientServer _inheritGradient;
private SvgPaintServer _inheritGradient;
private List<SvgGradientStop> _stops;
/// <summary>
......@@ -89,13 +89,12 @@ namespace Svg
/// Gets or sets another gradient fill from which to inherit the stops from.
/// </summary>
[SvgAttribute("href")]
public SvgGradientServer InheritGradient
public SvgPaintServer InheritGradient
{
get { return this._inheritGradient; }
set
{
this._inheritGradient = value;
this.InheritStops();
}
}
......@@ -220,14 +219,12 @@ namespace Svg
return blend;
}
/// <summary>
// If this gradient contains no stops then it will search any inherited gradients for stops.
/// </summary>
protected virtual void InheritStops()
protected void LoadStops()
{
if (this.Stops.Count == 0 && this.InheritGradient != null)
var core = SvgDeferredPaintServer.TryGet<SvgGradientServer>(_inheritGradient);
if (this.Stops.Count == 0 && core != null)
{
_stops.AddRange(this.InheritGradient.Stops);
_stops.AddRange(core.Stops);
}
}
......
......@@ -81,6 +81,7 @@ namespace Svg
public override Brush GetBrush(SvgVisualElement renderingElement, float opacity)
{
LoadStops();
if (IsInvalid)
{
return null;
......
......@@ -38,7 +38,18 @@ namespace Svg
{
return (SvgPaintServer)document.IdManager.GetElementById(value);
}
else // Otherwise try and parse as colour
else if (value.StartsWith("#")) // Otherwise try and parse as colour
{
try
{
return new SvgColourServer((Color)_colourConverter.ConvertFrom(value.Trim()));
}
catch
{
return new SvgDeferredPaintServer(document, value);
}
}
else
{
return new SvgColourServer((Color)_colourConverter.ConvertFrom(value.Trim()));
}
......@@ -49,7 +60,7 @@ namespace Svg
if (value is string)
{
var s = (string) value;
if(String.Equals( s.Trim(), "none", StringComparison.OrdinalIgnoreCase) || string.IsNullOrWhiteSpace(s))
if (String.Equals(s.Trim(), "none", StringComparison.OrdinalIgnoreCase) || string.IsNullOrEmpty(s) || s.Trim().Length < 1)
return SvgPaintServer.None;
else
return SvgPaintServerFactory.Create(s, (SvgDocument)context);
......
......@@ -97,6 +97,7 @@ namespace Svg
public override Brush GetBrush(SvgVisualElement renderingElement, float opacity)
{
LoadStops();
var origin = CalculateOrigin(renderingElement);
var centerPoint = CalculateCenterPoint(renderingElement, origin);
......
......@@ -8,6 +8,14 @@ namespace Svg.Pathing
{
public override void AddToPath(System.Drawing.Drawing2D.GraphicsPath graphicsPath)
{
// Important for custom line caps. Force the path the close with an explicit line, not just an implicit close of the figure.
if (graphicsPath.PathPoints.Length > 1 && !graphicsPath.PathPoints[0].Equals(graphicsPath.PathPoints[graphicsPath.PathPoints.Length - 1]))
{
int i = graphicsPath.PathTypes.Length - 1;
while (i >= 0 && graphicsPath.PathTypes[i] > 0) i--;
if (i < 0) i = 0;
graphicsPath.AddLine(graphicsPath.PathPoints[graphicsPath.PathPoints.Length - 1], graphicsPath.PathPoints[i]);
}
graphicsPath.CloseFigure();
}
......
......@@ -222,9 +222,9 @@ namespace Svg
{
var lastSegment = segments.Last;
// if the last element is a SvgClosePathSegment the position of the previous element should be used because the position of SvgClosePathSegment is 0,0
// if the last element is a SvgClosePathSegment the position of the previous move to should be used because the position of SvgClosePathSegment is 0,0
if (lastSegment is SvgClosePathSegment)
lastSegment = segments[segments.Count - 2];
lastSegment = segments.OfType<SvgMoveToSegment>().Last();
if (isRelativeX)
{
......@@ -290,6 +290,7 @@ namespace Svg
{
if (value is string)
{
if (string.IsNullOrEmpty((string)value)) return new SvgPathSegmentList();
return Parse((string)value);
}
......
......@@ -116,7 +116,9 @@
<Compile Include="Document Structure\SvgTitle.cs" />
<Compile Include="Document Structure\SvgDocumentMetadata.cs" />
<Compile Include="Extensibility\SvgForeignObject.cs" />
<Compile Include="Extensions.cs" />
<Compile Include="Painting\ISvgBoundable.cs" />
<Compile Include="Painting\SvgDeferredPaintServer.cs" />
<Compile Include="Painting\SvgMarker.cs" />
<Compile Include="Document Structure\SvgDefinitionList.cs" />
<Compile Include="Document Structure\SvgDescription.cs" />
......
......@@ -241,7 +241,7 @@ namespace Svg
element.Content = value.ToString();
// Reset content value for new element
value.Clear();
value.Length = 0;
}
break;
case XmlNodeType.CDATA:
......@@ -277,9 +277,11 @@ namespace Svg
throw new ArgumentNullException("document");
}
Stream stream = new MemoryStream(UTF8Encoding.Default.GetBytes(document.InnerXml));
using (var stream = new MemoryStream(UTF8Encoding.Default.GetBytes(document.InnerXml)))
{
return Open<SvgDocument>(stream, null);
}
}
public static Bitmap OpenAsBitmap(string path)
{
......
......@@ -117,6 +117,15 @@ namespace Svg
get { return this._children; }
}
public IEnumerable<SvgElement> Descendants()
{
return this.AsEnumerable().Descendants();
}
private IEnumerable<SvgElement> AsEnumerable()
{
yield return this;
}
/// <summary>
/// Gets a value to determine whether the element has children.
/// </summary>
......@@ -763,6 +772,7 @@ namespace Svg
onmouseout = "<anything>"
*/
#if Net4
/// <summary>
/// Use this method to provide your implementation ISvgEventCaller which can register Actions
/// and call them if one of the events occurs. Make sure, that your SvgElement has a unique ID.
......@@ -804,6 +814,7 @@ namespace Svg
caller.UnregisterAction(rpcID + "onmouseout");
}
}
#endif
[SvgAttribute("onclick")]
public event EventHandler<MouseArg> Click;
......@@ -826,11 +837,13 @@ namespace Svg
[SvgAttribute("onmouseout")]
public event EventHandler<MouseArg> MouseOut;
#if Net4
protected Action<float, float, int, int, bool, bool, bool, string> CreateMouseEventAction(Action<object, MouseArg> eventRaiser)
{
return (x, y, button, clickCount, altKey, shiftKey, ctrlKey, sessionID) =>
eventRaiser(this, new MouseArg { x = x, y = y, Button = button, ClickCount = clickCount, AltKey = altKey, ShiftKey = shiftKey, CtrlKey = ctrlKey, SessionID = sessionID });
}
#endif
//click
protected void RaiseMouseClick(object sender, MouseArg e)
......@@ -943,6 +956,7 @@ namespace Svg
public SvgElement BeforeSibling;
}
#if Net4
//deriving class registers event actions and calls the actions if the event occurs
public interface ISvgEventCaller
{
......@@ -957,6 +971,7 @@ namespace Svg
void RegisterAction<T1, T2, T3, T4, T5, T6, T7, T8>(string rpcID, Action<T1, T2, T3, T4, T5, T6, T7, T8> action);
void UnregisterAction(string rpcID);
}
#endif
/// <summary>
/// Represents the state of the mouse at the moment the event occured.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment