Interface IBehaviors
Represents the behaviors.
Inherited Members
System.Collections.Generic.IEnumerable<Syncfusion.Presentation.IBehavior>.GetEnumerator()
Namespace: Syncfusion.Presentation
Assembly: Syncfusion.Presentation.Base.dll
Syntax
public interface IBehaviors : IEnumerable<IBehavior>, IEnumerable
Properties
Count
Get the count of behavior
Declaration
int Count { get; }
Property Value
Type |
---|
System.Int32 |
Examples
// Create a new presentation.
IPresentation ppDoc = Presentation.Create();
// Add a slide to the presentation.
ISlide slide = ppDoc.Slides.Add(SlideLayoutType.Blank);
// Add shape on the slide
IShape shape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150);
// Add animation effect on the slide with shape
IEffect effect = ppDoc.Slides[0].Timeline.MainSequence.AddEffect(shape, EffectType.Bounce, EffectSubtype.None, EffectTriggerType.OnClick);
// Get the behaviors count from the effect
int count = effect.Behaviors.Count;
// Save the presentation file
ppDoc.Save("Sample.pptx");
// Close the presentation file
ppDoc.Close();
'Create a new presentation
Dim ppDoc As IPresentation = Presentation.Create()
'Add a slide to the presentation.
Dim slide As ISlide = ppDoc.Slides.Add(SlideLayoutType.Blank)
'Add shape on the slide
Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150)
'Add animation effect on the slide with shape
Dim effect As IEffect = ppDoc.Slides(0).Timeline.MainSequence.AddEffect(shape, EffectType.Bounce, EffectSubtype.None, EffectTriggerType.OnClick)
'Get the behaviors count from the effect
Dim count As Integer = effect.Behaviors.Count
'Save the presentation file
ppDoc.Save("Sample.pptx")
'Close the presentation file
ppDoc.Close()
Item[Int32]
Gets a IBehavior instance at the specified index from the collection. Read-only.
Declaration
IBehavior this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Determines the index of the behavior. |
Property Value
Type | Description |
---|---|
IBehavior | Returns an IBehavior instance. |
Examples
// Create a new presentation.
IPresentation ppDoc = Presentation.Create();
// Add a slide to the presentation.
ISlide slide = ppDoc.Slides.Add(SlideLayoutType.Blank);
// Add shape on the slide
IShape shape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150);
// Add animation effect on the slide with shape
IEffect effect = ppDoc.Slides[0].Timeline.MainSequence.AddEffect(shape, EffectType.Bounce, EffectSubtype.None, EffectTriggerType.OnClick);
// Get the behavior with index from the effect
IBehavior behavior = effect.Behaviors[0];
// Save the presentation file
ppDoc.Save("Sample.pptx");
// Close the presentation file
ppDoc.Close();
'Create a new presentation
Dim ppDoc As IPresentation = Presentation.Create()
'Add a slide to the presentation.
Dim slide As ISlide = ppDoc.Slides.Add(SlideLayoutType.Blank)
'Add shape on the slide
Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150)
'Add animation effect on the slide with shape
Dim effect As IEffect = ppDoc.Slides(0).TimeLine.MainSequence.AddEffect(shape, EffectType.Bounce, EffectSubtype.None, EffectTriggerType.OnClick)
'Get the behavior with index from the effect
Dim behavior As IBehavior = effect.Behaviors(0)
'Save the presentation file
ppDoc.Save("Sample.pptx")
'Close the presentation file
ppDoc.Close()
Methods
IndexOf(IBehavior)
Get the index of particulare behavior item
Declaration
int IndexOf(IBehavior item)
Parameters
Type | Name | Description |
---|---|---|
IBehavior | item | behavior |
Returns
Type | Description |
---|---|
System.Int32 | Index of the particular behavior |
Examples
// Create a new presentation.
IPresentation ppDoc = Presentation.Create();
// Add a slide to the presentation.
ISlide slide = ppDoc.Slides.Add(SlideLayoutType.Blank);
// Add shape on the slide
IShape shape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150);
// Add animation effect on the slide with shape
IEffect effect = ppDoc.Slides[0].Timeline.MainSequence.AddEffect(shape, EffectType.Bounce, EffectSubtype.None, EffectTriggerType.OnClick);
// Get the behaviors index
IBehavior behavior = effect.Behaviors[0];
int index = effect.Behaviors.IndexOf(behavior);
// Save the presentation file
ppDoc.Save("Sample.pptx");
// Close the presentation file
ppDoc.Close();
'Create a new presentation
Dim ppDoc As IPresentation = Presentation.Create()
'Add a slide to the presentation.
Dim slide As ISlide = ppDoc.Slides.Add(SlideLayoutType.Blank)
'Add shape on the slide
Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150)
'Add animation effect on the slide with shape
Dim effect As IEffect = ppDoc.Slides(0).TimeLine.MainSequence.AddEffect(shape, EffectType.Bounce, EffectSubtype.None, EffectTriggerType.OnClick)
'Get the behaviors index
Dim behavior As IBehavior = effect.Behaviors(0)
Dim index As Integer = effect.Behaviors.IndexOf(behavior)
'Save the presentation file
ppDoc.Save("Sample.pptx")
'Close the presentation file
ppDoc.Close()