Search Results for

    Show / Hide Table of Contents

    Class SvgElementIdManager

    Provides methods to ensure element ID's are valid and unique.

    Inheritance
    Object
    SvgElementIdManager
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Svg
    Assembly: Svg.dll
    Syntax
    public class SvgElementIdManager

    Constructors

    | Improve this Doc View Source

    SvgElementIdManager(SvgDocument)

    Initialises a new instance of an SvgElementIdManager.

    Declaration
    public SvgElementIdManager(SvgDocument document)
    Parameters
    Type Name Description
    SvgDocument document

    The SvgDocument containing the SvgElements to manage.

    Methods

    | Improve this Doc View Source

    Add(SvgElement)

    Adds the specified SvgElement for ID management.

    Declaration
    public virtual void Add(SvgElement element)
    Parameters
    Type Name Description
    SvgElement element

    The SvgElement to be managed.

    | Improve this Doc View Source

    AddAndForceUniqueID(SvgElement, SvgElement, Boolean, Action<SvgElement, String, String>)

    Adds the specified SvgElement for ID management. And can auto fix the ID if it already exists or it starts with a number.

    Declaration
    public virtual bool AddAndForceUniqueID(SvgElement element, SvgElement sibling, bool autoForceUniqueID = true, Action<SvgElement, string, string> logElementOldIDNewID = null)
    Parameters
    Type Name Description
    SvgElement element

    The SvgElement to be managed.

    SvgElement sibling

    Not used.

    Boolean autoForceUniqueID

    Pass true here, if you want the ID to be fixed

    System.Action<SvgElement, System.String, System.String> logElementOldIDNewID

    If not null, the action is called before the id is fixed

    Returns
    Type Description
    Boolean

    true, if ID was altered

    | Improve this Doc View Source

    EnsureValidId(String, Boolean)

    Ensures that the specified ID is unique within the containing SvgDocument.

    Declaration
    public string EnsureValidId(string id, bool autoForceUniqueID = false)
    Parameters
    Type Name Description
    System.String id

    A System.String containing the ID to validate.

    Boolean autoForceUniqueID

    Creates a new unique id System.String.

    Returns
    Type Description
    System.String
    Exceptions
    Type Condition
    SvgException

    An element with the same ID already exists within the containing SvgDocument.

    | Improve this Doc View Source

    GetElementById(String)

    Retrieves the SvgElement with the specified ID.

    Declaration
    public virtual SvgElement GetElementById(string id)
    Parameters
    Type Name Description
    System.String id

    A System.String containing the ID of the element to find.

    Returns
    Type Description
    SvgElement

    An SvgElement of one exists with the specified ID; otherwise false.

    | Improve this Doc View Source

    GetElementById(Uri)

    Declaration
    public virtual SvgElement GetElementById(Uri uri)
    Parameters
    Type Name Description
    Uri uri
    Returns
    Type Description
    SvgElement
    | Improve this Doc View Source

    OnAdded(SvgElement)

    Declaration
    protected void OnAdded(SvgElement element)
    Parameters
    Type Name Description
    SvgElement element
    | Improve this Doc View Source

    OnRemoved(SvgElement)

    Declaration
    protected void OnRemoved(SvgElement element)
    Parameters
    Type Name Description
    SvgElement element
    | Improve this Doc View Source

    Remove(SvgElement)

    Removed the specified SvgElement from ID management.

    Declaration
    public virtual void Remove(SvgElement element)
    Parameters
    Type Name Description
    SvgElement element

    The SvgElement to be removed from ID management.

    Events

    | Improve this Doc View Source

    ElementAdded

    Declaration
    public event EventHandler<SvgElementEventArgs> ElementAdded
    Event Type
    Type Description
    System.EventHandler<SvgElementEventArgs>
    | Improve this Doc View Source

    ElementRemoved

    Declaration
    public event EventHandler<SvgElementEventArgs> ElementRemoved
    Event Type
    Type Description
    System.EventHandler<SvgElementEventArgs>
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX