Interface INodeFactory
Factory used to create new editor nodes through the document fragment in the editor API.
Namespace: Sdl.DesktopEditor.EditorApi
Assembly: Sdl.DesktopEditor.EditorApi.dll
Syntax
public interface INodeFactory
Remarks
New bilingual content model (BilingualApi) items are automatically created as necessary.
Properties objects can be shared between multiple document items (and thus also between multiple nodes), but keep in mind that if properties are changed all items/nodes will then be affected. If this is not the desired behaviour, create a copy of the properties object first, and reference the copy in the items for which it should be changed.
Properties
ItemFactory
The factory to use when new bilingual content items need to be created.
Declaration
IDocumentItemFactory ItemFactory { get; }
Property Value
| Type | Description |
|---|---|
| IDocumentItemFactory |
Remarks
This is the factory used in the IBilingualDocument.
PropertiesFactory
The factory to use when new properties objects need to be created.
Declaration
IPropertiesFactory PropertiesFactory { get; }
Property Value
| Type | Description |
|---|---|
| IPropertiesFactory |
Remarks
This is the factory used in the IBilingualDocument.
Methods
CreateBookmark()
Create a new temporary bookmark node.
Declaration
IChangeableBookmarkNode CreateBookmark()
Returns
| Type | Description |
|---|---|
| IChangeableBookmarkNode | Empty bookmark node |
CreateComment(ICommentMarker)
Create a comment node that wraps the input comment
Declaration
IChangeableCommentContainerNode CreateComment(ICommentMarker comment)
Parameters
| Type | Name | Description |
|---|---|---|
| ICommentMarker | comment |
Returns
| Type | Description |
|---|---|
| IChangeableCommentContainerNode |
CreateDocumentFragment()
Create a new, empty document fragment that can be used to insert content into the editor.
Declaration
IDocumentFragment CreateDocumentFragment()
Returns
| Type | Description |
|---|---|
| IDocumentFragment | Empty document fragment that can be filled with content and passed to ReplaceSelection(IDocumentFragment). |
CreateLocationMarker()
Create a new location marker node.
Declaration
IChangeableLocationMarkerNode CreateLocationMarker()
Returns
| Type | Description |
|---|---|
| IChangeableLocationMarkerNode | Empty location marker node. |
Remarks
Creates a new ILocationMarker document item in the process.
CreateLocationMarker(ILocationMarker)
Creates a location marker using existing properties
Declaration
IChangeableLocationMarkerNode CreateLocationMarker(ILocationMarker marker)
Parameters
| Type | Name | Description |
|---|---|---|
| ILocationMarker | marker | The existing location marker properties to use. |
Returns
| Type | Description |
|---|---|
| IChangeableLocationMarkerNode | A new location marker with the same location marker ID. |
CreateLockedContentContainer(ILockedContentProperties)
Create a new empty locked content container node with the specified properties.
Declaration
IChangeableLockedContentContainerNode CreateLockedContentContainer(ILockedContentProperties lockedProperties)
Parameters
| Type | Name | Description |
|---|---|---|
| ILockedContentProperties | lockedProperties |
Returns
| Type | Description |
|---|---|
| IChangeableLockedContentContainerNode |
CreateMarkerContainer()
Create a new marker container node that can be used to mark up content inside the editor.
Declaration
IChangeableMarkerContainerNode CreateMarkerContainer()
Returns
| Type | Description |
|---|---|
| IChangeableMarkerContainerNode | Empty marker node. |
Remarks
Creates a new IOtherMarker document item in the process.
CreateNode(IAbstractMarkupData)
Create a new editor node based on any type of bilingual API content item.
Declaration
IChangeableNode CreateNode(IAbstractMarkupData item)
Parameters
| Type | Name | Description |
|---|---|---|
| IAbstractMarkupData | item | Any markup data item. This item will be cloned in the process and the returned (strongly typed) editor nodes will reference the clone. |
Returns
| Type | Description |
|---|---|
| IChangeableNode |
Remarks
You can use this to create editor content from any bilingual content.
The item can be anything that implements IAbstractMarkupData, including containers like ITagPair etc.
If it is a container all child nodes in the container will be "wrapped" in corresponding editor nodes too.
All created editor nodes will be of appropriate types, based on the type of the bilingual content item they are wrapping.
CreatePlaceholderTag(IPlaceholderTagProperties)
Create a new placeholder tag node with the specified tag properties.
Declaration
IChangeablePlaceholderTagNode CreatePlaceholderTag(IPlaceholderTagProperties tagProperties)
Parameters
| Type | Name | Description |
|---|---|---|
| IPlaceholderTagProperties | tagProperties | Properties for the placeholder tag. Can be the same properties object as for an existing tag in the document, or a new one created by cloning and modifying an existing tag properties or by using the PropertiesFactory. |
Returns
| Type | Description |
|---|---|
| IChangeablePlaceholderTagNode |
Remarks
When inserting a copy of a tag that exists in the source, use the same tag properties object, unless the target tag properties need to be modified.
Note that tag properties are file format dependent. Some filters may have strict limitations on what tags can be inserted.
CreateRevision(IRevisionProperties)
Create a new empty revision node with the specified revision properties.
Declaration
IChangeableRevisionMarkerContainerNode CreateRevision(IRevisionProperties revisionProperties)
Parameters
| Type | Name | Description |
|---|---|---|
| IRevisionProperties | revisionProperties |
Returns
| Type | Description |
|---|---|
| IChangeableRevisionMarkerContainerNode |
CreateSegment(ISegmentPairProperties)
Create a new empty segment node.
Declaration
IChangeableSegmentContainerNode CreateSegment(ISegmentPairProperties segmentProperties)
Parameters
| Type | Name | Description |
|---|---|---|
| ISegmentPairProperties | segmentProperties |
Returns
| Type | Description |
|---|---|
| IChangeableSegmentContainerNode | a new empty segment container node |
CreateTagPair(IStartTagProperties, IEndTagProperties)
Create a new empty tag pair node with the specified start and end tag properties.
Declaration
IChangeableTagPairContainerNode CreateTagPair(IStartTagProperties startTagProperties, IEndTagProperties endTagProperties)
Parameters
| Type | Name | Description |
|---|---|---|
| IStartTagProperties | startTagProperties | Properties for the start tag in the tag pair. Can be the same properties object as for an existing tag in the document, or a new one created by cloning and modifying an existing tag properties or by using the PropertiesFactory. |
| IEndTagProperties | endTagProperties | Properties for the end tag in the tag pair. |
Returns
| Type | Description |
|---|---|
| IChangeableTagPairContainerNode | a new, empty tag pair container node that is not part of any container |
Remarks
When inserting a copy of a tag that exists in the source, use the same tag properties objects, unless the target tag properties need to be modified.
Note that tag properties are file format dependent. Some filters may have strict limitations on what tags can be inserted.
CreateText(String)
Create a new text node with the specified text as content.
Declaration
IChangeableTextNode CreateText(string text)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | text |
Returns
| Type | Description |
|---|---|
| IChangeableTextNode | Text node with the specified text as properties. |
Remarks
Creates a new text properties object and a new document item in the process.