Class WSymbol
Represents a symbol in the Word document.
Inherited Members
Namespace: Syncfusion.DocIO.DLS
Assembly: Syncfusion.DocIO.UWP.dll
Syntax
public class WSymbol : ParagraphItem, IXDLSSerializable, IWidget, IParagraphItem, IEntity, IOfficeRun
Examples
private void Button1_Click(System.Object sender, System.EventArgs e)
{
//Create a new Word document
WordDocument document = new WordDocument();
//Add new section to the document
IWSection section = document.AddSection();
//Add new paragraph to the section
IWParagraph paragraph = section.AddParagraph();
paragraph.AppendText("Example of adding symbols to the paragraph: ");
//Insert symbol with character code 100
WSymbol symbol = paragraph.AppendSymbol(100);
symbol.FontName = "Windings";
//Save and close the Word document
document.Save("Sample.docx", FormatType.Docx);
document.Close();
}
Private Sub button_Click(sender As Object, e As EventArgs)
'Create a new Word document
Dim document As New WordDocument()
'Add new section to the document
Dim section As IWSection = document.AddSection()
'Add new paragraph to the section
Dim paragraph As IWParagraph = section.AddParagraph()
paragraph.AppendText("Example of adding symbols to the paragraph: ")
'Insert symbol with character code 100
Dim symbol As WSymbol = paragraph.AppendSymbol(100)
symbol.FontName = "Windings"
'Save and close the Word document
document.Save("Sample.docx", FormatType.Docx)
document.Close()
End Sub
Constructors
WSymbol(IWordDocument)
Initialize a new instance of the WSymbol class with the specified IWordDocument instance.
Declaration
public WSymbol(IWordDocument doc)
Parameters
Type | Name | Description |
---|---|---|
IWordDocument | doc | The IWordDocument instance. |
Properties
CharacterCode
Gets or sets symbol's character code.
Declaration
public byte CharacterCode { get; set; }
Property Value
Type |
---|
System.Byte |
CharacterFormat
Gets the character format for the symbol. Read-only.
Declaration
public WCharacterFormat CharacterFormat { get; }
Property Value
Type |
---|
WCharacterFormat |
EntityType
Gets the type of the entity. Read-only.
Declaration
public override EntityType EntityType { get; }
Property Value
Type | Description |
---|---|
EntityType | The EntityType of the current item. |
Overrides
FontName
Gets or sets font name for the symbol.
Declaration
public string FontName { get; set; }
Property Value
Type |
---|
System.String |
Methods
CloneImpl()
Creates a duplicate copy of the entity.
Declaration
protected override object CloneImpl()
Returns
Type | Description |
---|---|
System.Object | The reference to the newly created object. |
Overrides
InitXDLSHolder()
Registers child objects in XDSL holder.
Declaration
protected override void InitXDLSHolder()
Overrides
ReadXmlAttributes(IXDLSAttributeReader)
Reads object data from xml attributes.
Declaration
protected override void ReadXmlAttributes(IXDLSAttributeReader reader)
Parameters
Type | Name | Description |
---|---|---|
IXDLSAttributeReader | reader | The IXDLSAttributeReader object. |
Overrides
WriteXmlAttributes(IXDLSAttributeWriter)
Writes object data as xml attributes.
Declaration
protected override void WriteXmlAttributes(IXDLSAttributeWriter writer)
Parameters
Type | Name | Description |
---|---|---|
IXDLSAttributeWriter | writer | The IXDLSAttributeWriter object. |