C# Class Svg.SvgElementIdManager

Provides methods to ensure element ID's are valid and unique.
Afficher le fichier Open project: prepare/HTML-Renderer Class Usage Examples

Méthodes publiques

Méthode Description
Add ( SvgElement element ) : void

Adds the specified SvgElement for ID management.

AddAndForceUniqueID ( SvgElement element, SvgElement sibling, bool autoForceUniqueID = true, Action logElementOldIDNewID = null ) : bool

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

EnsureValidId ( string id, bool autoForceUniqueID = false ) : string

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

GetElementById ( Uri uri ) : SvgElement
GetElementById ( string id ) : SvgElement

Retrieves the SvgElement with the specified ID.

Remove ( SvgElement element ) : void

Removed the specified SvgElement from ID management.

SvgElementIdManager ( SvgDocument document ) : System

Initialises a new instance of an SvgElementIdManager.

Méthodes protégées

Méthode Description
OnAdded ( SvgElement element ) : void
OnRemoved ( SvgElement element ) : void

Method Details

Add() public méthode

Adds the specified SvgElement for ID management.
public Add ( SvgElement element ) : void
element SvgElement The to be managed.
Résultat void

AddAndForceUniqueID() public méthode

Adds the specified SvgElement for ID management. And can auto fix the ID if it already exists or it starts with a number.
public AddAndForceUniqueID ( SvgElement element, SvgElement sibling, bool autoForceUniqueID = true, Action logElementOldIDNewID = null ) : bool
element SvgElement The to be managed.
sibling SvgElement
autoForceUniqueID bool Pass true here, if you want the ID to be fixed
logElementOldIDNewID Action If not null, the action is called before the id is fixed
Résultat bool

EnsureValidId() public méthode

Ensures that the specified ID is valid within the containing SvgDocument.
/// The ID cannot start with a digit. /// An element with the same ID already exists within the containing . ///
public EnsureValidId ( string id, bool autoForceUniqueID = false ) : string
id string A containing the ID to validate.
autoForceUniqueID bool Creates a new unique id .
Résultat string

GetElementById() public méthode

public GetElementById ( Uri uri ) : SvgElement
uri System.Uri
Résultat SvgElement

GetElementById() public méthode

Retrieves the SvgElement with the specified ID.
public GetElementById ( string id ) : SvgElement
id string A containing the ID of the element to find.
Résultat SvgElement

OnAdded() protected méthode

protected OnAdded ( SvgElement element ) : void
element SvgElement
Résultat void

OnRemoved() protected méthode

protected OnRemoved ( SvgElement element ) : void
element SvgElement
Résultat void

Remove() public méthode

Removed the specified SvgElement from ID management.
public Remove ( SvgElement element ) : void
element SvgElement The to be removed from ID management.
Résultat void

SvgElementIdManager() public méthode

Initialises a new instance of an SvgElementIdManager.
public SvgElementIdManager ( SvgDocument document ) : System
document SvgDocument The containing the s to manage.
Résultat System