Class RadFlowDocumentEditor
Defines utility class used for editing Rad
Inheritance
Inherited Members
Namespace: Telerik.Windows.Documents.Flow.Model.Editing
Assembly: Telerik.Windows.Documents.Flow.dll
Syntax
public class RadFlowDocumentEditor
Constructors
RadFlowDocumentEditor(RadFlowDocument)
Initializes a new instance of the Rad
Declaration
public RadFlowDocumentEditor(RadFlowDocument document)
Parameters
Rad The document. |
Properties
CharacterFormatting
Gets the character formatting that will be used when creating new run elements.
Declaration
public CharacterProperties CharacterFormatting { get; }
Property Value
Character The character formatting. |
Document
Gets the document to which this editor is associated.
Declaration
public RadFlowDocument Document { get; }
Property Value
Rad The document. |
ParagraphFormatting
Gets the paragraph formatting that will be used when creating new paragraphs.
Declaration
public ParagraphProperties ParagraphFormatting { get; }
Property Value
Paragraph The paragraph formatting. |
TableFormatting
Gets the table formatting that will be used when creating new tables.
Declaration
public TableProperties TableFormatting { get; }
Property Value
Table The table formatting. |
Methods
DeleteBookmark(String)
Deletes a bookmark by name.
Declaration
public void DeleteBookmark(string name)
Parameters
System. The name. |
DeleteBookmark(Bookmark)
Deletes the bookmark.
Declaration
public void DeleteBookmark(Bookmark bookmark)
Parameters
Bookmark
bookmark
The bookmark. |
DeleteContent(InlineBase, InlineBase, Boolean)
Deletes the content between the start and end elements. The inlines' parents must be in the same block container.
Declaration
public void DeleteContent(InlineBase start, InlineBase end, bool inclusive = true)
Parameters
Inline The start inline element. |
Inline The end inline element. |
System. Indicates if the start end elements should be deleted as well. |
DeletePermissionRange(PermissionRange)
Deletes the permission range.
Declaration
public void DeletePermissionRange(PermissionRange permission)
Parameters
Permission The permission. |
FindAll(String, Boolean, Boolean)
Finds all occurrences of a specified text in a Rad
Declaration
public ReadOnlyCollection<FindResult> FindAll(string text, bool matchCase = true, bool matchWholeWord = false)
Parameters
System. The searched text. |
System. Indicates whether the casing should be matched. |
System. Indicates whether only whole words should be matched. |
Returns
System. Collection of type Find |
FindAll(Regex)
Finds all occurrences of a matched text by the specified regex in a Rad
Declaration
public ReadOnlyCollection<FindResult> FindAll(Regex regex)
Parameters
System. The regex. |
Returns
System. Collection of type Find |
InsertBookmark(String)
Inserts the bookmark with specified name.
Declaration
public Bookmark InsertBookmark(string name)
Parameters
System. The name. |
Returns
Bookmark
The created bookmark. |
InsertBookmark(String, InlineBase, InlineBase)
Inserts the bookmark with specified name.
Declaration
public Bookmark InsertBookmark(string name, InlineBase inlineStart, InlineBase inlineEnd)
Parameters
System. The name. |
Inline The inline start. The start of the bookmark will be inserted before this inline. |
Inline The inline end. The end of the bookmark will be inserted after this inline. |
Returns
Bookmark
The created bookmark. |
InsertBreak(BreakType)
Inserts the break.
Declaration
public Break InsertBreak(BreakType type)
Parameters
Break The type of the break. |
Returns
Break
The inserted break. |
InsertComment(String)
Inserts the comment.
Declaration
public Comment InsertComment(string text)
Parameters
System. The text of the comment. |
Returns
Comment
The created comment. |
InsertComment(String, InlineBase, InlineBase)
Inserts the comment.
Declaration
public Comment InsertComment(string text, InlineBase inlineStart, InlineBase inlineEnd)
Parameters
System. The text. |
Inline The inline start. The start of the comment will be inserted before this inline. |
Inline The inline end. The end of the comment will be inserted after this inline. |
Returns
InsertComment(Comment)
Inserts the comment.
Declaration
public Comment InsertComment(Comment comment)
Parameters
Comment
comment
The comment. |
Returns
Comment
The comment. |
InsertComment(Comment, InlineBase, InlineBase)
Inserts the comment.
Declaration
public Comment InsertComment(Comment comment, InlineBase inlineStart, InlineBase inlineEnd)
Parameters
Comment
comment
The comment. |
Inline The inline start. The start of the comment will be inserted before this inline. |
Inline The inline end. The end of the comment will be inserted after this inline. |
Returns
Comment
The comment. |
InsertDocument(RadFlowDocument)
Inserts the source document at the current position in the target document.
Declaration
public void InsertDocument(RadFlowDocument sourceDocument)
Parameters
Rad The source document. |
InsertDocument(RadFlowDocument, InsertDocumentOptions)
Inserts the source document at the current position in the target document.
Declaration
public void InsertDocument(RadFlowDocument sourceDocument, InsertDocumentOptions insertOptions)
Parameters
Rad The source document. |
Insert The insert options. |
InsertField(String, String)
Inserts new field.
Declaration
public FieldInfo InsertField(string code, string result = "")
Parameters
System. The code fragment. |
System. The result fragment. |
Returns
InsertFloatingImage(Stream, String)
Inserts a floating image with its original size.
Declaration
public FloatingImage InsertFloatingImage(Stream stream, string extension)
Parameters
System. The stream. |
System. The extension. |
Returns
Floating The inserted floating image. |
InsertFloatingImage(Stream, String, Size)
Inserts a floating image.
Declaration
public FloatingImage InsertFloatingImage(Stream stream, string extension, Size size)
Parameters
System. The image stream. |
System. The image extension. |
System. The size. |
Returns
Floating The floating image inline. |
InsertFloatingImage(ImageSource, Size)
Inserts a floating image.
Declaration
public FloatingImage InsertFloatingImage(ImageSource source, Size size)
Parameters
Image The image source. |
System. The size. |
Returns
Floating The floating image inline. |
InsertHyperlink(String, String, Boolean, String)
Inserts the hyperlink.
Declaration
public Hyperlink InsertHyperlink(string text, string uri, bool isAnchor, string toolTip = null)
Parameters
System. The text. |
System. The URI. |
System. True for hyperlinks pointing to a bookmark. |
System. The tool tip. |
Returns
InsertImageInline(Stream, String)
Inserts an inline image with its original size.
Declaration
public ImageInline InsertImageInline(Stream stream, string extension)
Parameters
System. The stream. |
System. The extension. |
Returns
Image The inserted inline image. |
InsertImageInline(Stream, String, Size)
Inserts the image inline.
Declaration
public ImageInline InsertImageInline(Stream stream, string extension, Size size)
Parameters
System. The image stream. |
System. The image extension. |
System. The size. |
Returns
Image The inserted image inline. |
InsertImageInline(ImageSource, Size)
Inserts an inline image.
Declaration
public ImageInline InsertImageInline(ImageSource source, Size size)
Parameters
Image The image source. |
System. The size. |
Returns
Image The inserted image inline. |
InsertInline(InlineBase)
Inserts an inline.
Declaration
public InlineBase InsertInline(InlineBase inline)
Parameters
Inline The inline. |
Returns
Inline The inline. |
InsertLine(String)
Inserts text and adds new paragraph after it.
Declaration
public Run InsertLine(string text)
Parameters
System. The text. |
Returns
Run
The inserted last inserted Run element. |
InsertParagraph()
Inserts a new paragraph.
Declaration
public Paragraph InsertParagraph()
Returns
Paragraph
The inserted Paragraph element. |
InsertPermissionRange(PermissionRangeCredentials, InlineBase, InlineBase)
Inserts the permission range surrounding inline start and inline end.
Declaration
public PermissionRange InsertPermissionRange(PermissionRangeCredentials permissionRangeCredentials, InlineBase inlineStart, InlineBase inlineEnd)
Parameters
Permission The permission range credentials. |
Inline The inline start. |
Inline The inline end. |
Returns
InsertPermissionRange(PermissionRangeCredentials, TableCell)
Inserts the permission range surrounding table cell.
Declaration
public PermissionRange InsertPermissionRange(PermissionRangeCredentials permissionRangeCredentials, TableCell cell)
Parameters
Permission The permission range credentials. |
Table The cell. |
Returns
InsertPermissionRange(PermissionRangeCredentials, TableRow)
Inserts the permission range surrounding table row.
Declaration
public PermissionRange InsertPermissionRange(PermissionRangeCredentials permissionRangeCredentials, TableRow row)
Parameters
Permission The permission range credentials. |
Table The row. |
Returns
InsertSection()
Inserts a new section.
Declaration
public Section InsertSection()
Returns
Section
The inserted Section element. |
InsertStructuredDocumentTag(SdtProperties)
Inserts a SDT (Structured Document Tag).
Declaration
public SdtRangeStart InsertStructuredDocumentTag(SdtProperties properties)
Parameters
Sdt The properties of the SDT. |
Returns
InsertStructuredDocumentTag(SdtProperties, DocumentElementBase, DocumentElementBase)
Inserts a SDT (Structured Document Tag).
Declaration
public SdtRangeStart InsertStructuredDocumentTag(SdtProperties properties, DocumentElementBase startElement, DocumentElementBase endElement)
Parameters
Sdt The properties of the SDT. |
Document The start of the SDT will be inserted before the provided element. |
Document The end of the SDT will be inserted after the provided element. |
Returns
InsertStructuredDocumentTag(SdtType)
Inserts a SDT (Structured Document Tag).
Declaration
public SdtRangeStart InsertStructuredDocumentTag(SdtType type)
Parameters
Sdt The type for the SDT to be generated. |
Returns
InsertStructuredDocumentTag(SdtType, DocumentElementBase, DocumentElementBase)
Inserts a SDT (Structured Document Tag).
Declaration
public SdtRangeStart InsertStructuredDocumentTag(SdtType type, DocumentElementBase startElement, DocumentElementBase endElement)
Parameters
Sdt The type for the SDT to be generated. |
Document The start of the SDT will be inserted before the provided element. |
Document The end of the SDT will be inserted after the provided element. |
Returns
InsertTable()
Inserts a new table and positions the editor after the table.
Declaration
public Table InsertTable()
Returns
Table
The inserted table. |
InsertTable(Int32, Int32)
Inserts a new table and positions the editor after the table.
Declaration
public Table InsertTable(int rows, int columns)
Parameters
System. The number of rows in the table. |
System. The number of columns in the table. |
Returns
Table
The inserted table. |
InsertText(String)
Inserts text.
Declaration
public Run InsertText(string text)
Parameters
System. The text. |
Returns
Run
The inserted last inserted Run element. |
MoveToInlineEnd(InlineBase)
Moves the editor after an inline.
Declaration
public void MoveToInlineEnd(InlineBase inline)
Parameters
Inline The inline. |
MoveToInlineStart(InlineBase)
Moves the editor before an inline.
Declaration
public void MoveToInlineStart(InlineBase inline)
Parameters
Inline The inline. |
MoveToParagraphEnd(Paragraph)
Moves the editor to the end of a paragraph.
Declaration
public void MoveToParagraphEnd(Paragraph paragraph)
Parameters
Paragraph
paragraph
The paragraph. |
MoveToParagraphStart(Paragraph)
Moves the editor to the start of a paragraph.
Declaration
public void MoveToParagraphStart(Paragraph paragraph)
Parameters
Paragraph
paragraph
The paragraph. |
MoveToTableEnd(Table)
Moves the editor to a table end.
Declaration
public void MoveToTableEnd(Table table)
Parameters
Table
table
The table. |
Protect(String)
Protects the editor document from changes with specified password in read only protection mode.
Declaration
public void Protect(string password)
Parameters
System. The password. |
Protect(String, ProtectionMode)
Protects the editor document from changes with specified password in desired protection mode.
Declaration
public void Protect(string password, ProtectionMode protectionMode)
Parameters
System. The password. |
Protection The protection mode. |
RemoveStructuredDocumentTag(SdtRangeStart)
Removes a SDT(Structured Document Tag) with its contents.
Declaration
public void RemoveStructuredDocumentTag(SdtRangeStart sdtRangeStart)
Parameters
Sdt The start of the SDT to be removed. |
RemoveStructuredDocumentTag(SdtRangeStart, Boolean)
Removes a SDT(Structured Document Tag).
Declaration
public void RemoveStructuredDocumentTag(SdtRangeStart sdtRangeStart, bool removeContent)
Parameters
Sdt The start of the SDT to be removed. |
System. If true the content of the SDT is removed; else only the SDT is removed leaving behind the content. |
ReplaceStyling(String, Action<CharacterProperties>)
Replaces character properties of all occurrences of the searched text in a Rad
Declaration
public void ReplaceStyling(string searchedText, Action<CharacterProperties> replacePropertiesAction)
Parameters
System. The searched text. |
System. The action which replaces character properties. |
ReplaceStyling(String, Boolean, Boolean, Action<CharacterProperties>)
Replaces character properties of all occurrences of the searched text in a Rad
Declaration
public void ReplaceStyling(string searchedText, bool matchCase, bool matchWholeWord, Action<CharacterProperties> replacePropertiesAction)
Parameters
System. The searched text. |
System. Indicates whether the casing should be matched. |
System. Indicates whether only whole words should be matched. |
System. The action which replaces character properties. |
ReplaceStyling(Regex, Action<CharacterProperties>)
Replaces character properties of all occurrences of a
matched text by the specified regex in a Rad
Declaration
public void ReplaceStyling(Regex regex, Action<CharacterProperties> replacePropertiesAction)
Parameters
System. The regex. |
System. The action which replaces character properties. |
ReplaceText(String, IEnumerable<BlockBase>, Boolean, Boolean)
Replaces all occurrences of a specified text in a Rad
Declaration
public void ReplaceText(string oldText, IEnumerable<BlockBase> blocks, bool matchCase = true, bool matchWholeWord = false)
Parameters
System. The searched text. |
System. The replace System.Collections.Generic.IEnumerable<T> elements. |
System. Indicates whether the casing should be matched. |
System. Indicates whether only whole words should be matched. |
ReplaceText(String, IEnumerable<InlineBase>, Boolean, Boolean)
Replaces all occurrences of a specified text in a Rad
Declaration
public void ReplaceText(string oldText, IEnumerable<InlineBase> inlines, bool matchCase = true, bool matchWholeWord = false)
Parameters
System. The searched text. |
System. The replace System.Collections.Generic.IEnumerable<T> elements. |
System. Indicates whether the casing should be matched. |
System. Indicates whether only whole words should be matched. |
ReplaceText(String, String, Boolean, Boolean)
Replaces all occurrences of a specified text in a Rad
Declaration
public void ReplaceText(string oldText, string newText, bool matchCase = true, bool matchWholeWord = false)
Parameters
System. The searched text. |
System. The replace text. |
System. Indicates whether the casing should be matched. |
System. Indicates whether only whole words should be matched. |
ReplaceText(String, BlockBase, Boolean, Boolean)
Replaces all occurrences of a specified text in a Rad
Declaration
public void ReplaceText(string oldText, BlockBase block, bool matchCase = true, bool matchWholeWord = false)
Parameters
ReplaceText(String, InlineBase, Boolean, Boolean)
Replaces all occurrences of a specified text in a Rad
Declaration
public void ReplaceText(string oldText, InlineBase inline, bool matchCase = true, bool matchWholeWord = false)
Parameters
System. The searched text. |
Inline The replace Inline |
System. Indicates whether the casing should be matched. |
System. Indicates whether only whole words should be matched. |
ReplaceText(Regex, IEnumerable<BlockBase>)
Replaces all occurrences of a matched text by the specified regex in a Rad
Declaration
public void ReplaceText(Regex regex, IEnumerable<BlockBase> blocks)
Parameters
System. The regex. |
System. The replace System.Collections.Generic.IEnumerable<T> elements. |
ReplaceText(Regex, IEnumerable<InlineBase>)
Replaces all occurrences of a matched text by the specified regex in a Rad
Declaration
public void ReplaceText(Regex regex, IEnumerable<InlineBase> inlines)
Parameters
System. The regex. |
System. The replace System.Collections.Generic.IEnumerable<T> elements. |
ReplaceText(Regex, String)
Replaces all occurrences of a matched text by the specified regex in a Rad
Declaration
public void ReplaceText(Regex regex, string newText)
Parameters
System. The regex. |
System. The replace text. |
ReplaceText(Regex, BlockBase)
Replaces all occurrences of a matched text by the specified regex in a Rad
Declaration
public void ReplaceText(Regex regex, BlockBase block)
Parameters
ReplaceText(Regex, InlineBase)
Replaces all occurrences of a matched text by the specified regex in a Rad
Declaration
public void ReplaceText(Regex regex, InlineBase inline)
Parameters
System. The regex. |
Inline The replace Inline |
SetSdtMessageProvider(IMessageProvider)
Sets a custom message provider for the messages when creating a structured document tag.
Declaration
public void SetSdtMessageProvider(IMessageProvider provider)
Parameters
IMessage A custom message provider which implements IMessage |
SetWatermark(Watermark, Header)
Sets the watermark to the specified header.
Declaration
public void SetWatermark(Watermark watermark, Header header)
Parameters
SetWatermark(Watermark, Section, HeaderFooterType)
Unprotect()
Unprotects the editor document.
Declaration
public void Unprotect()
Unprotect(String)
Tries to unprotect the editor document with specified password.
Declaration
public bool Unprotect(string password)
Parameters
System. The password. |
Returns
System.
|