Commit a2c56086 authored by Tebjan Halm's avatar Tebjan Halm
Browse files

Merge pull request #32 from biggik/master

CLS complience
parents 7fb9941a 80e1ae99
...@@ -96,6 +96,10 @@ namespace Svg ...@@ -96,6 +96,10 @@ namespace Svg
} }
return _path; return _path;
} }
protected set
{
_path = value;
}
} }
/// <summary> /// <summary>
......
...@@ -95,6 +95,10 @@ namespace Svg ...@@ -95,6 +95,10 @@ namespace Svg
} }
return _path; return _path;
} }
protected set
{
_path = value;
}
} }
/// <summary> /// <summary>
......
...@@ -84,6 +84,9 @@ namespace Svg ...@@ -84,6 +84,9 @@ namespace Svg
{ {
return null; return null;
} }
protected set
{
}
} }
/// <summary> /// <summary>
......
...@@ -75,6 +75,10 @@ namespace Svg ...@@ -75,6 +75,10 @@ namespace Svg
} }
return this._path; return this._path;
} }
protected set
{
_path = value;
}
} }
public override System.Drawing.RectangleF Bounds public override System.Drawing.RectangleF Bounds
......
...@@ -14,8 +14,8 @@ namespace Svg ...@@ -14,8 +14,8 @@ namespace Svg
[SvgElement("polygon")] [SvgElement("polygon")]
public class SvgPolygon : SvgVisualElement public class SvgPolygon : SvgVisualElement
{ {
protected GraphicsPath _path; private GraphicsPath _path;
protected SvgUnitCollection _points; private SvgUnitCollection _points;
/// <summary> /// <summary>
/// The points that make up the SvgPolygon /// The points that make up the SvgPolygon
...@@ -68,6 +68,10 @@ namespace Svg ...@@ -68,6 +68,10 @@ namespace Svg
} }
return this._path; return this._path;
} }
protected set
{
_path = value;
}
} }
public override RectangleF Bounds public override RectangleF Bounds
......
...@@ -17,24 +17,24 @@ namespace Svg ...@@ -17,24 +17,24 @@ namespace Svg
{ {
get get
{ {
if (this._path == null || this.IsPathDirty) if (Path == null || this.IsPathDirty)
{ {
this._path = new GraphicsPath(); Path = new GraphicsPath();
try try
{ {
for (int i = 0; i < this._points.Count; i += 2) for (int i = 0; i < Points.Count; i += 2)
{ {
PointF endPoint = new PointF(this._points[i].ToDeviceValue(this), this._points[i + 1].ToDeviceValue(this)); PointF endPoint = new PointF(Points[i].ToDeviceValue(this), Points[i + 1].ToDeviceValue(this));
// TODO: Remove unrequired first line // TODO: Remove unrequired first line
if (_path.PointCount == 0) if (Path.PointCount == 0)
{ {
_path.AddLine(endPoint, endPoint); Path.AddLine(endPoint, endPoint);
} }
else else
{ {
_path.AddLine(_path.GetLastPoint(), endPoint); Path.AddLine(Path.GetLastPoint(), endPoint);
} }
} }
} }
...@@ -44,7 +44,7 @@ namespace Svg ...@@ -44,7 +44,7 @@ namespace Svg
} }
this.IsPathDirty = false; this.IsPathDirty = false;
} }
return this._path; return Path;
} }
} }
} }
......
...@@ -247,6 +247,10 @@ namespace Svg ...@@ -247,6 +247,10 @@ namespace Svg
} }
return _path; return _path;
} }
protected set
{
_path = value;
}
} }
/// <summary> /// <summary>
......
...@@ -22,7 +22,7 @@ namespace Svg ...@@ -22,7 +22,7 @@ namespace Svg
/// <summary> /// <summary>
/// Gets the <see cref="GraphicsPath"/> for this element. /// Gets the <see cref="GraphicsPath"/> for this element.
/// </summary> /// </summary>
public abstract GraphicsPath Path { get; } public abstract GraphicsPath Path { get; protected set; }
/// <summary> /// <summary>
/// Gets the bounds of the element. /// Gets the bounds of the element.
/// </summary> /// </summary>
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Text;
namespace Svg.DataTypes namespace Svg.DataTypes
{ {
......
...@@ -100,7 +100,7 @@ namespace Svg ...@@ -100,7 +100,7 @@ namespace Svg
// http://www.w3.org/TR/SVG11/coords.html#Units // http://www.w3.org/TR/SVG11/coords.html#Units
const float cmInInch = 2.54f; const float cmInInch = 2.54f;
int ppi = SvgDocument.PPI; int ppi = SvgDocument.PointsPerInch;
switch (this.Type) switch (this.Type)
{ {
......
...@@ -27,12 +27,13 @@ namespace Svg ...@@ -27,12 +27,13 @@ namespace Svg
{ {
get get
{ {
var path = new GraphicsPath(); //var path = new GraphicsPath();
//AddPaths(this, path); //AddPaths(this, path);
return GetPaths(this); return GetPaths(this);
} }
protected set
{ }
} }
/// <summary> /// <summary>
......
...@@ -58,6 +58,8 @@ namespace Svg ...@@ -58,6 +58,8 @@ namespace Svg
SvgVisualElement element = (SvgVisualElement)this.OwnerDocument.IdManager.GetElementById(this.ReferencedElement); SvgVisualElement element = (SvgVisualElement)this.OwnerDocument.IdManager.GetElementById(this.ReferencedElement);
return (element != null) ? element.Path : null; return (element != null) ? element.Path : null;
} }
protected set
{ }
} }
public override System.Drawing.RectangleF Bounds public override System.Drawing.RectangleF Bounds
......
...@@ -70,6 +70,10 @@ namespace Svg ...@@ -70,6 +70,10 @@ namespace Svg
return (path as SvgPath).Path; return (path as SvgPath).Path;
return null; return null;
} }
protected set
{
// No-op
}
} }
public override System.Drawing.RectangleF Bounds public override System.Drawing.RectangleF Bounds
......
...@@ -89,6 +89,10 @@ namespace Svg ...@@ -89,6 +89,10 @@ namespace Svg
} }
return _path; return _path;
} }
protected set
{
_path = value;
}
} }
internal void OnPathUpdated() internal void OnPathUpdated()
......
using System.Reflection; using System;
using System.Reflection;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
...@@ -32,4 +33,6 @@ using System.Runtime.InteropServices; ...@@ -32,4 +33,6 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Revision and Build Numbers // You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.1.*")] [assembly: AssemblyVersion("1.0.1.*")]
[assembly: AssemblyFileVersion("1.0.1.*")] //[assembly: AssemblyFileVersion("1.0.1.*")]
[assembly: CLSCompliant(true)]
...@@ -54,7 +54,9 @@ ...@@ -54,7 +54,9 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DocumentationFile>..\..\vvvv\public\common\src\thirdparty\Svg.XML</DocumentationFile> <DocumentationFile>
</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>PdbOnly</DebugType> <DebugType>PdbOnly</DebugType>
......
...@@ -108,7 +108,7 @@ namespace Svg ...@@ -108,7 +108,7 @@ namespace Svg
/// </summary> /// </summary>
public event EventHandler<AttributeEventArgs> AttributeChanged; public event EventHandler<AttributeEventArgs> AttributeChanged;
protected void OnAttributeChanged(string attribute, object value) private void OnAttributeChanged(string attribute, object value)
{ {
var handler = AttributeChanged; var handler = AttributeChanged;
if(handler != null) if(handler != null)
...@@ -164,7 +164,7 @@ namespace Svg ...@@ -164,7 +164,7 @@ namespace Svg
/// </summary> /// </summary>
public event EventHandler<AttributeEventArgs> AttributeChanged; public event EventHandler<AttributeEventArgs> AttributeChanged;
protected void OnAttributeChanged(string attribute, object value) private void OnAttributeChanged(string attribute, object value)
{ {
var handler = AttributeChanged; var handler = AttributeChanged;
if(handler != null) if(handler != null)
......
...@@ -16,7 +16,7 @@ namespace Svg ...@@ -16,7 +16,7 @@ namespace Svg
/// </summary> /// </summary>
public class SvgDocument : SvgFragment, ITypeDescriptorContext public class SvgDocument : SvgFragment, ITypeDescriptorContext
{ {
public static readonly int PPI = 96; public static readonly int PointsPerInch = 96;
private SvgElementIdManager _idManager; private SvgElementIdManager _idManager;
......
...@@ -31,9 +31,8 @@ namespace Svg ...@@ -31,9 +31,8 @@ namespace Svg
} }
//reflection cache //reflection cache
protected IEnumerable<PropertyAttributeTuple> _svgPropertyAttributes; private IEnumerable<PropertyAttributeTuple> _svgPropertyAttributes;
protected IEnumerable<EventAttributeTuple> _svgEventAttributes; private IEnumerable<EventAttributeTuple> _svgEventAttributes;
internal SvgElement _parent; internal SvgElement _parent;
private string _elementName; private string _elementName;
......
...@@ -275,6 +275,10 @@ namespace Svg ...@@ -275,6 +275,10 @@ namespace Svg
} }
return _path; return _path;
} }
protected set
{
_path = value;
}
} }
private static string ValidateFontFamily(string fontFamilyList) private static string ValidateFontFamily(string fontFamilyList)
......
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