SvgMarkerElement.cs :  » GUI » SharpVectorGraphics » SharpVectors » Dom » Svg » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » GUI » SharpVectorGraphics 
SharpVectorGraphics » SharpVectors » Dom » Svg » SvgMarkerElement.cs
using System;

namespace SharpVectors.Dom.Svg{
  public class SvgMarkerElement : SvgStyleableElement, ISvgMarkerElement, ISharpDoNotPaint, IContainerElement
  {
    internal SvgMarkerElement(string prefix, string localname, string ns, SvgDocument doc) : base(prefix, localname, ns, doc) 
    {
      svgExternalResourcesRequired = new SvgExternalResourcesRequired(this);
      svgFitToViewBox = new SvgFitToViewBox(this);
    }


    #region Implementation of ISvgMarkerElement
    /// <summary>
    ///  Sets the value of attribute orient to 'auto'.
    /// </summary>
    public void SetOrientToAuto()
    {
      orientType = null;
      SetAttribute("orient", "auto");
    }

    /// <summary>
    ///  Sets the value of attribute orient to the given angle.
    /// </summary>
    /// <param name="angle"> The angle value to use for attribute orient.</param>
    public void SetOrientToAngle(ISvgAngle angle)
    {
      orientType = null;
      SetAttribute("orient", angle.ValueAsString);
      orientAngle = new SvgAnimatedAngle(angle);
    }

    private ISvgAnimatedLength refX;
    /// <summary>
    /// Corresponds to attribute refX on the given 'marker' element.
    /// </summary>
    public ISvgAnimatedLength RefX
    {
      get
      {
        if(refX == null)
        {
          refX = new SvgAnimatedLength(this, "refX", SvgLengthDirection.Horizontal, "0");
        }
        return refX;
      }
    }

    private ISvgAnimatedLength refY;
    /// <summary>
    /// Corresponds to attribute refY on the given 'marker' element.
    /// </summary>
    public ISvgAnimatedLength RefY
    {
      get
      {
        if(refY == null)
        {
          refY = new SvgAnimatedLength(this, "refY", SvgLengthDirection.Vertical, "0");
        }
        return refY;
      }
    }

    private ISvgAnimatedEnumeration markerUnits;
    /// <summary>
    /// Corresponds to attribute markerUnits on the given 'marker' element.
    /// </summary>
    public ISvgAnimatedEnumeration MarkerUnits
    {
      get
      {
        if(markerUnits == null)
        {
          SvgMarkerUnit type = SvgMarkerUnit.Unknown;
          switch(GetAttribute("markerUnits"))
          {
            case "userSpaceOnUse":
              type = SvgMarkerUnit.UserSpaceOnUse;
              break;
            case "":
            case "strokeWidth":
              type = SvgMarkerUnit.StrokeWidth;
              break;
          }
          markerUnits = new SvgAnimatedEnumeration((ushort)type);
        }
        return markerUnits;
      }
    }

    private ISvgAnimatedLength markerWidth;
    /// <summary>
    /// Corresponds to attribute markerWidth on the given 'marker' element
    /// </summary>
    public ISvgAnimatedLength MarkerWidth
    {
      get
      {
        if(markerWidth == null)
        {
          markerWidth = new SvgAnimatedLength(this, "markerWidth", SvgLengthDirection.Horizontal, "3");
        }
        return markerWidth;
      }
    }

    private ISvgAnimatedLength markerHeight;
    /// <summary>
    /// Corresponds to attribute markerHeight on the given 'marker' element.
    /// </summary>
    public ISvgAnimatedLength MarkerHeight
    {
      get
      {
        if(markerHeight == null)
        {
          markerHeight = new SvgAnimatedLength(this, "markerHeight", SvgLengthDirection.Vertical, "3");
        }
        return markerHeight;
      }
    }

    private ISvgAnimatedEnumeration orientType;
    /// <summary>
    /// Corresponds to attribute orient on the given 'marker' element. One of the Marker Orientation Types defined above.
    /// </summary>
    public ISvgAnimatedEnumeration OrientType
    {
      get
      {
        if(orientType == null)
        {
          if(GetAttribute("orient") == "auto")
          {
            orientType = new SvgAnimatedEnumeration((ushort)SvgMarkerOrient.Auto);
          }
          else
          {
            orientType = new SvgAnimatedEnumeration((ushort)SvgMarkerOrient.Angle);
          }
        }
        return orientType;
      }
    }

    public ISvgAnimatedAngle orientAngle;
    /// <summary>
    /// Corresponds to attribute orient on the given 'marker' element. If markerUnits is SVG_MARKER_ORIENT_ANGLE, the angle value for attribute orient; otherwise, it will be set to zero.
    /// </summary>
    public ISvgAnimatedAngle OrientAngle
    {
      get
      {
        if(orientAngle == null)
        {
          if(OrientType.AnimVal.Equals(SvgMarkerOrient.Angle))
          {
            orientAngle = new SvgAnimatedAngle(GetAttribute("orient"), "0");
          }
          else
          {
            orientAngle = new SvgAnimatedAngle("0", "0");
          }
        }
        return orientAngle;
      }
    }
    #endregion

    #region Implementation of ISvgFitToViewBox
    private SvgFitToViewBox svgFitToViewBox;
    public ISvgAnimatedRect ViewBox
    {
      get
      {
        return svgFitToViewBox.ViewBox;
      }
    }

    public ISvgAnimatedPreserveAspectRatio PreserveAspectRatio
    {
      get
      {
        return svgFitToViewBox.PreserveAspectRatio;
      }
    }
    #endregion

    #region Implementation of ISvgExternalResourcesRequired
    private SvgExternalResourcesRequired svgExternalResourcesRequired;
    public ISvgAnimatedBoolean ExternalResourcesRequired
    {
      get
      {
        return svgExternalResourcesRequired.ExternalResourcesRequired;
      }
    }
    #endregion
  }
}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.