Class WSmartArt
Represents a SmartArt diagram.
Inheritance
Inherited Members
Namespace: Syncfusion.DocIO.DLS
Assembly: Syncfusion.DocIO.NET.dll
Syntax
public class WSmartArt : ShapeBase, IXDLSSerializable, IParagraphItem, IOfficeRun, IEntity, ILeafWidget, IWidget
Properties
Background
Gets an IOfficeShapeFill object that represents the background fill of the SmartArt.
Declaration
public IOfficeShapeFill Background { get; }
Property Value
Type | Description |
---|---|
IOfficeShapeFill | A value of the IOfficeShapeFill object that represents the background of the SmartArt. |
Examples
//Create a Word document.
using (WordDocument document = new WordDocument())
{
//Adds one section and one paragraph to the document.
document.EnsureMinimal();
//Appends a new SmartArt to the paragraph.
WSmartArt smartArt = document.LastParagraph.AppendSmartArt(OfficeSmartArtType.BasicBlockList, 640, 426);
// Add a new node to SmartArt.
IOfficeShapeFill background = smartArt.Background;
//Set the fill type of the SmartArt.
background.FillType = OfficeShapeFillType.Solid;
//Set the fill color of SmartArt.
background.SolidFill.Color = Color.Red;
//Saves the Word document.
document.Save("Result.docx", FormatType.Docx);
}
'Create a Word document.
Using document As New WordDocument()
'Adds one section and one paragraph to the document.
document.EnsureMinimal()
'Appends a new SmartArt to the paragraph.
Dim smartArt As WSmartArt = document.LastParagraph.AppendSmartArt(OfficeSmartArtType.BasicBlockList, 640, 426)
'Add a new node to SmartArt.
Dim background As IOfficeShapeFill = smartArt.Background
'Set the fill type of the SmartArt.
background.FillType = OfficeShapeFillType.Solid
'Set the fill color of SmartArt.
background.SolidFill.Color = Color.Red
'Saves the Word document.
document.Save("Result.docx", FormatType.Docx)
End Using
EntityType
Gets the type of the entity, which is SmartArt in this case.
Declaration
public override EntityType EntityType { get; }
Property Value
Type | Description |
---|---|
EntityType | A value of the EntityType enumeration that represents the entity type. |
Overrides
Layout
Gets an OfficeSmartArtType value that represents the layout type associated with the SmartArt. Read-only.
Declaration
public OfficeSmartArtType Layout { get; }
Property Value
Type | Description |
---|---|
OfficeSmartArtType | A value of the OfficeSmartArtType enumeration that represents layout of the SmartArt. |
Examples
//Create a Word document.
using (WordDocument document = new WordDocument())
{
//Adds one section and one paragraph to the document.
document.EnsureMinimal();
//Appends a new SmartArt to the paragraph.
WSmartArt smartArt = document.LastParagraph.AppendSmartArt(OfficeSmartArtType.BasicBlockList, 640, 426);
//Add a new node to SmartArt.
IOfficeSmartArtNode newNode = smartArt.Nodes.Add();
//Gets the SmartArt layout.
OfficeSmartArtType smartArtType = smartArt.Layout;
//Saves the Word document.
document.Save("Result.docx", FormatType.Docx);
}
'Create a Word document.
Using document As New WordDocument()
'Adds one section and one paragraph to the document.
document.EnsureMinimal()
'Appends a new SmartArt to the paragraph.
Dim smartArt As WSmartArt = document.LastParagraph.AppendSmartArt(OfficeSmartArtType.BasicBlockList, 640, 426)
'Add a new node to SmartArt.
Dim newNode As IOfficeSmartArtNode = smartArt.Nodes.Add()
'Gets the SmartArt layout.
Dim smartArtType As OfficeSmartArtType = smartArt.Layout
'Saves the Word document.
document.Save("Result.docx", FormatType.Docx)
End Using
LineFormat
Gets an IOfficeShapeLineFormat object that represents the line and arrowhead formatting of the SmartArt. Read-only.
Declaration
public IOfficeShapeLineFormat LineFormat { get; }
Property Value
Type | Description |
---|---|
IOfficeShapeLineFormat | A value of the IOfficeShapeLineFormat object that represents the line format of the SmartArt. |
Examples
//Create a Word document.
using (WordDocument document = new WordDocument())
{
//Adds one section and one paragraph to the document.
document.EnsureMinimal();
//Appends a new SmartArt to the paragraph.
WSmartArt smartArt = document.LastParagraph.AppendSmartArt(OfficeSmartArtType.BasicBlockList, 640, 426);
//Add a new node to SmartArt.
IOfficeShapeLineFormat lineFormat = smartArt.LineFormat;
//Set the fill type of the SmartArt.
lineFormat.Fill.FillType = OfficeShapeFillType.Solid;
//Set the fill color of SmartArt.
lineFormat.Fill.SolidFill.Color = Color.Red;
//Saves the Word document.
document.Save("Result.docx", FormatType.Docx);
}
'Create a Word document.
Using document As New WordDocument()
'Adds one section and one paragraph to the document.
document.EnsureMinimal()
'Appends a new SmartArt to the paragraph.
Dim smartArt As WSmartArt = document.LastParagraph.AppendSmartArt(OfficeSmartArtType.BasicBlockList, 640, 426)
'Add a new node to SmartArt.
Dim lineFormat As IOfficeShapeLineFormat = smartArt.LineFormat
'Set the fill type of the SmartArt.
lineFormat.Fill.FillType = OfficeShapeFillType.Solid
'Set the fill color of SmartArt.
lineFormat.Fill.SolidFill.Color = Color.Red
'Saves the Word document.
document.Save("Result.docx", FormatType.Docx)
End Using
Nodes
Gets an IOfficeSmartArtNodes object that contains all the nodes within the SmartArt graphic. Read-only.
Declaration
public IOfficeSmartArtNodes Nodes { get; }
Property Value
Type | Description |
---|---|
IOfficeSmartArtNodes | A value of the IOfficeSmartArtNodes object that represents the nodes of the SmartArt. |
Examples
//Create a Word document.
using (WordDocument document = new WordDocument())
{
//Adds one section and one paragraph to the document.
document.EnsureMinimal();
//Appends a new SmartArt to the paragraph.
WSmartArt smartArt = document.LastParagraph.AppendSmartArt(OfficeSmartArtType.BasicBlockList, 640, 426);
// Add a new node to SmartArt.
IOfficeSmartArtNode newNode = smartArt.Nodes.Add();
// Set the text to the newly added node.
newNode.TextBody.AddParagraph("New main node added.");
//Saves the Word document.
document.Save("Result.docx", FormatType.Docx);
}
'Create a Word document.
Using document As New WordDocument()
'Adds one section and one paragraph to the document.
document.EnsureMinimal()
'Appends a new SmartArt to the paragraph.
Dim smartArt As WSmartArt = document.LastParagraph.AppendSmartArt(OfficeSmartArtType.BasicBlockList, 640, 426)
'Add a new node to SmartArt.
Dim newNode As IOfficeSmartArtNode = smartArt.Nodes.Add()
'Set the text to the newly added node.
newNode.TextBody.AddParagraph("New main node added.")
'Saves the Word document.
document.Save("Result.docx", FormatType.Docx)
End Using
Methods
CloneImpl()
Creates a duplicate copy of the entity.
Declaration
protected override object CloneImpl()
Returns
Type | Description |
---|---|
System.Object | A reference to the newly created object. |
Overrides
CreateLayoutInfo()
Creates layout information.
Declaration
protected override void CreateLayoutInfo()