C# Класс Svg.SvgElementIdManager

Provides methods to ensure element ID's are valid and unique.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
OnAdded ( SvgElement element ) : void
OnRemoved ( SvgElement element ) : void

Описание методов

Add() публичный метод

Adds the specified SvgElement for ID management.
public Add ( SvgElement element ) : void
element SvgElement The to be managed.
Результат void

AddAndForceUniqueID() публичный метод

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
Результат bool

EnsureValidId() публичный метод

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 .
Результат string

GetElementById() публичный метод

public GetElementById ( Uri uri ) : SvgElement
uri System.Uri
Результат SvgElement

GetElementById() публичный метод

Retrieves the SvgElement with the specified ID.
public GetElementById ( string id ) : SvgElement
id string A containing the ID of the element to find.
Результат SvgElement

OnAdded() защищенный метод

protected OnAdded ( SvgElement element ) : void
element SvgElement
Результат void

OnRemoved() защищенный метод

protected OnRemoved ( SvgElement element ) : void
element SvgElement
Результат void

Remove() публичный метод

Removed the specified SvgElement from ID management.
public Remove ( SvgElement element ) : void
element SvgElement The to be removed from ID management.
Результат void

SvgElementIdManager() публичный метод

Initialises a new instance of an SvgElementIdManager.
public SvgElementIdManager ( SvgDocument document ) : System
document SvgDocument The containing the s to manage.
Результат System