C# 클래스 Svg.SvgElementIdManager

Provides methods to ensure element ID's are valid and unique.
파일 보기 프로젝트 열기: prepare/HTML-Renderer 1 사용 예제들

공개 메소드들

메소드 설명
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