Interface ISmartArtNode
Represents a single semantic node within the data model of a SmartArt graphic.
Namespace: Syncfusion.Presentation
Assembly: Syncfusion.Presentation.Base.dll
Syntax
public interface ISmartArtNode
Properties
ChildNodes
Gets the child nodes associated with the SmartArt node. Read-only.
Declaration
ISmartArtNodes ChildNodes { get; }
Property Value
Type |
---|
ISmartArtNodes |
Examples
// Create an instance of PowerPoint Presentation
IPresentation pptxDoc = Presentation.Create();
//Add a blank slide to the Presentation
ISlide slide = pptxDoc.Slides.Add(SlideLayoutType.Blank);
//Add a SmartArt to the slide at the specified size and position.
ISmartArt smartArt = slide.Shapes.AddSmartArt(SmartArtType.AlternatingHexagons, 10, 10, 640, 426);
// Add a new node to the SmartArt.
ISmartArtNode newNode = smartArt.Nodes.Add();
// Add a child node to the SmartArt node
ISmartArtNode childNode = newNode.ChildNodes.Add();
// Set a text to newly added child node.
childNode.TextBody.AddParagraph("Child node of the existing node.");
//Save the Presentation.
pptxDoc.Save("Sample.pptx");
//Close the Presentation.
pptxDoc.Close();
'Create an instance of PowerPoint Presentation
Dim pptxDoc As IPresentation = Presentation.Create()
'Add a blank slide to the Presentation
Dim slide As ISlide = pptxDoc.Slides.Add(SlideLayoutType.Blank)
'Add a SmartArt to the slide at the specified size and position.
Dim smartArt As ISmartArt = slide.Shapes.AddSmartArt(SmartArtType.AlternatingHexagons, 10, 10, 640, 426)
'Add a new node to the SmartArt.
Dim newNode As ISmartArtNode = smartArt.Nodes.Add()
'Add a child node to the SmartArt node
Dim childNode As ISmartArtNode = newNode.ChildNodes.Add()
'Set a text to newly added child node.
childNode.TextBody.AddParagraph("Child node of the existing node.")
'Save the Presentation.
pptxDoc.Save("Sample.pptx")
'Close the Presentation.
pptxDoc.Close()
IsAssistant
Gets or sets a value indicating whether the SmartArt point is an assistant element.
Declaration
bool IsAssistant { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | Returns |
Remarks
Setting this property to true
will set the SmartArt point type to AssistantElement.
Setting this property to false
will set the SmartArt point type to Node.
Examples
// Create an instance of PowerPoint Presentation
IPresentation pptxDoc = Presentation.Create();
//Add a blank slide to the Presentation
ISlide slide = pptxDoc.Slides.Add(SlideLayoutType.Blank);
//Add a SmartArt to the slide at the specified size and position
ISmartArt smartArt = slide.Shapes.AddSmartArt(SmartArtType.OrganizationChart, 0, 0, 640, 426.96);
//Traverse through all nodes of the SmartArt.
foreach (ISmartArtNode node in smartArt.Nodes)
{
//Check if the node is assistant or not.
if (node.IsAssistant)
//Set the assistant node to false.
node.IsAssistant = false;
}
//Save the Presentation.
pptxDoc.Save("Sample.pptx");
//Close the Presentation.
pptxDoc.Close();
Create an instance of PowerPoint Presentation
Dim pptxDoc As IPresentation = Presentation.Create()
'Add a blank slide to the Presentation
Dim slide As ISlide = pptxDoc.Slides.Add(SlideLayoutType.Blank)
'Add a SmartArt to the slide at the specified size and position
Dim smartArt As ISmartArt = slide.Shapes.AddSmartArt(SmartArtType.OrganizationChart, 0, 0, 640, 426.96)
'Traverse through all nodes of the SmartArt.
For Each node As ISmartArtNode In smartArt.Nodes
'Check if the node is assistant or not.
If node.IsAssistant Then
'Set the assistant node to false.
node.IsAssistant = False
End If
Next
'Save the Presentation.
pptxDoc.Save("Sample.pptx")
'Close the Presentation.
pptxDoc.Close()
Level
Gets the node level in the hierarchy.
Declaration
int Level { get; }
Property Value
Type |
---|
System.Int32 |
Examples
// Create an instance of PowerPoint Presentation
IPresentation pptxDoc = Presentation.Create();
//Add a blank slide to the Presentation
ISlide slide = pptxDoc.Slides.Add(SlideLayoutType.Blank);
//Add a SmartArt to the slide at the specified size and position.
ISmartArt smartArt = slide.Shapes.AddSmartArt(SmartArtType.AlternatingHexagons, 0, 0, 640, 426);
// Add a new node to the SmartArt.
ISmartArtNode newNode = smartArt.Nodes.Add();
// Add a child node to the SmartArt node
ISmartArtNode childNode = newNode.ChildNodes.Add();
// Set a text to newly added child node.
childNode.TextBody.AddParagraph("Child node of the existing node.");
//Gets the level of the child node.
int level = childNode.Level;
//Save the Presentation.
pptxDoc.Save("Sample.pptx");
//Close the Presentation.
pptxDoc.Close();
'Create an instance of PowerPoint Presentation
Dim pptxDoc As IPresentation = Presentation.Create()
'Add a blank slide to the Presentation
Dim slide As ISlide = pptxDoc.Slides.Add(SlideLayoutType.Blank)
'Add a SmartArt to the slide at the specified size and position.
Dim smartArt As ISmartArt = slide.Shapes.AddSmartArt(SmartArtType.AlternatingHexagons, 10, 10, 640, 426)
'Add a new node to the SmartArt.
Dim newNode As ISmartArtNode = smartArt.Nodes.Add()
'Add a child node to the SmartArt node
Dim childNode As ISmartArtNode = newNode.ChildNodes.Add()
'Set a text to newly added child node.
childNode.TextBody.AddParagraph("Child node of the existing node.")
'Gets the level of the child node.
Dim level As Integer = childNode.Level
'Save the Presentation.
pptxDoc.Save("Sample.pptx")
'Close the Presentation.
pptxDoc.Close()
Parent
Gets the parent of the SmartArt node.
Declaration
object Parent { get; }
Property Value
Type |
---|
System.Object |
Examples
// Create an instance of PowerPoint Presentation
IPresentation pptxDoc = Presentation.Create();
//Add a blank slide to the Presentation
ISlide slide = pptxDoc.Slides.Add(SlideLayoutType.Blank);
//Add a SmartArt to the slide at the specified size and position.
ISmartArt smartArt = slide.Shapes.AddSmartArt(SmartArtType.AlternatingHexagons, 0, 0, 640, 426);
// Add a new node to the SmartArt.
ISmartArtNode newNode = smartArt.Nodes.Add();
// Add a child node to the SmartArt node
ISmartArtNode childNode = newNode.ChildNodes.Add();
//Gets the parent node for the child node.
object parent = childNode.Parent;
// Set a text to parent node.
(parent as ISmartArtNode).TextBody.AddParagraph("Parent node for the child node.");
//Save the Presentation.
pptxDoc.Save("Sample.pptx");
//Close the Presentation.
pptxDoc.Close();
'Create an instance of PowerPoint Presentation
Dim pptxDoc As IPresentation = Presentation.Create()
'Add a blank slide to the Presentation
Dim slide As ISlide = pptxDoc.Slides.Add(SlideLayoutType.Blank)
'Add a SmartArt to the slide at the specified size and position.
Dim smartArt As ISmartArt = slide.Shapes.AddSmartArt(SmartArtType.AlternatingHexagons, 10, 10, 640, 426)
'Add a new node to the SmartArt.
Dim newNode As ISmartArtNode = smartArt.Nodes.Add()
'Add a child node to the SmartArt node
Dim childNode As ISmartArtNode = newNode.ChildNodes.Add()
Dim parent As Object = childNode.Parent
TryCast(parent, ISmartArtNode).TextBody.AddParagraph("Parent node for the child node.")
'Save the Presentation.
pptxDoc.Save("Sample.pptx")
'Close the Presentation.
pptxDoc.Close()
Shapes
Gets the shape collection associated with the SmartArt node. Read-only.
Declaration
ISmartArtShapes Shapes { get; }
Property Value
Type |
---|
ISmartArtShapes |
Examples
// Create an instance of PowerPoint Presentation
IPresentation pptxDoc = Presentation.Create();
//Add a blank slide to the Presentation
ISlide slide = pptxDoc.Slides.Add(SlideLayoutType.Blank);
//Add a BasicBlockList SmartArt to the slide at the specified size and position.
ISmartArt smartArt = slide.Shapes.AddSmartArt(SmartArtType.BasicBlockList, 0, 0, 640, 426);
//Gets the smart art shape collection from the node.
ISmartArtShapes smartArts = smartArt.Nodes[0].Shapes;
//Gets the first smart art shape from the collection.
ISmartArtShape smartArtShape = smartArts[0];
//Sets the fill color for the shape.
smartArtShape.Fill.SolidFill.Color = ColorObject.DarkCyan;
//Save the PowerPoint Presentation.
pptxDoc.Save("Sample.pptx");
//Close the Presentation
pptxDoc.Close();
'Create an instance of PowerPoint Presentation
Dim pptxDoc As IPresentation = Presentation.Create()
'Add a blank slide to the Presentation
Dim slide As ISlide = pptxDoc.Slides.Add(SlideLayoutType.Blank)
'Add a BasicBlockList SmartArt to the slide at the specified size and position.
Dim smartArt As ISmartArt = slide.Shapes.AddSmartArt(SmartArtType.BasicBlockList, 0, 0, 640, 426)
'Gets the smart art shape collection from the node.
Dim smartArts As ISmartArtShapes = smartArt.Nodes(0).Shapes
'Gets the first smart art shape from the collection.
Dim smartArtShape As ISmartArtShape = smartArts(0)
'Sets the fill color for the shape.
smartArtShape.Fill.SolidFill.Color = ColorObject.DarkCyan
'Save the PowerPoint Presentation.
pptxDoc.Save("Sample.pptx")
'Close the Presentation
pptxDoc.Close()
TextBody
Gets an ITextBody instance that represents the text in the SmartArt node. Read-only.
Declaration
ITextBody TextBody { get; }
Property Value
Type |
---|
ITextBody |
Examples
// Create an instance of PowerPoint Presentation
IPresentation pptxDoc = Presentation.Create();
//Add a blank slide to the Presentation
ISlide slide = pptxDoc.Slides.Add(SlideLayoutType.Blank);
//Add a BasicBlockList SmartArt to the slide at the specified size and position.
ISmartArt smartArt = slide.Shapes.AddSmartArt(SmartArtType.BasicBlockList, 0, 0, 640, 426);
//Gets the first node text body.
ITextBody textBody = smartArt.Nodes[0].TextBody;
//Sets the text to the text body.
textBody.AddParagraph("First node text");
//Save the Presentation
pptxDoc.Save("Sample.pptx");
//Close the Presentation
pptxDoc.Close();
'Create an instance of PowerPoint Presentation
Dim pptxDoc As IPresentation = Presentation.Create()
'Add a blank slide to the Presentation
Dim slide As ISlide = pptxDoc.Slides.Add(SlideLayoutType.Blank)
'Add a BasicBlockList SmartArt to the slide at the specified size and position.
Dim smartArt As ISmartArt = slide.Shapes.AddSmartArt(SmartArtType.BasicBlockList, 0, 0, 640, 426)
'Gets the first node text body.
Dim textBody As ITextBody = smartArt.Nodes(0).TextBody
'Sets the text to the text body.
textBody.AddParagraph("First node text")
'Save the Presentation
pptxDoc.Save("Sample.pptx")
'Close the Presentation
pptxDoc.Close()