menu

Document Processing

Interface IBehaviorProperties - FileFormats API Reference | Syncfusion

    Show / Hide Table of Contents

    Interface IBehaviorProperties

    Represents the behavior properties.

    Namespace: Syncfusion.Presentation
    Assembly: Syncfusion.Presentation.Base.dll
    Syntax
    public interface IBehaviorProperties : IEnumerable<AnimationPropertyType>, IEnumerable

    Properties

    Count

    Get the count of behaviour list

    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.Fly, EffectSubtype.None, EffectTriggerType.OnClick);
    // Get the behaviors list from the effect
    IBehaviors behaviors = effect.Behaviors;
    // Get behavior using foreach loop
    foreach (IBehavior behavior in behaviors)
    {
    if (behavior is IPropertyEffect)
    {
    // Assign the property effect values
    IPropertyEffect propertyEffect = (behavior as IPropertyEffect);
    IBehaviorProperties behaviorProperties = propertyEffect.Properties;
    int behaviorsCount = behaviorProperties.Count;
    break;
    }
    }
    // 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.Fly, EffectSubtype.None, EffectTriggerType.OnClick)
    'Get the behaviors list from the effect
    Dim behaviors As IBehaviors = effect.Behaviors
    'Get behavior using foreach loop
    For Each behavior As Behavior In behaviors
    'Check condition for behavior is property effect
    If (TypeOf behavior Is PropertyEffect) Then
    'Assign the property effect values
    Dim propertyEffect As PropertyEffect = TryCast(behavior,PropertyEffect)
    Dim behaviorProperties As IBehaviorProperties = propertyEffect.Properties
    Dim behaviorsCount As Integer = behaviorProperties.Count
    Exit For
    End If
    Next
    'Save the presentation file
    ppDoc.Save("Sample.pptx")
    'Close the presentation file
    ppDoc.Close()

    Item[Int32]

    Gets a AnimationPropertyType instance at the specified index from the collection. Read-only.

    Declaration
    AnimationPropertyType this[int index] { get; }
    Parameters
    Type Name Description
    System.Int32 index

    Determines the index of the effect.

    Property Value
    Type Description
    AnimationPropertyType

    Returns an AnimationPropertyType 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.PathCrescentMoon, EffectSubtype.None, EffectTriggerType.OnClick);
    // Get the behaviors list from the effect
    IBehaviors behaviors = effect.Behaviors;
    // Get behavior using foreach loop
    foreach (IBehavior behavior in behaviors)
    {
    if (behavior is IPropertyEffect)
    {
    // Assign the property effect values
    IPropertyEffect propertyEffect = (behavior as IPropertyEffect);
    IBehaviorProperties behaviorProperties = propertyEffect.Properties;
    AnimationPropertyType animationProperty = behaviorProperties[0];
    break;
    }
    }
    // 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.PathCrescentMoon, EffectSubtype.None, EffectTriggerType.OnClick)
    'Get the behaviors list from the effect
    Dim behaviors As IBehaviors = effect.Behaviors
    'Get behavior using foreach loop
    For Each behavior As Behavior In behaviors
    'Check condition for behavior is property effect
    If (TypeOf behavior Is PropertyEffect) Then
    'Assign the property effect values
    Dim propertyEffect As PropertyEffect = TryCast(behavior,PropertyEffect)
    Dim behaviorProperties As IBehaviorProperties = propertyEffect.Properties
    Dim animationProperty As AnimationPropertyType = behaviorProperties(0)
    Exit For
    End If
    Next
    'Save the presentation file
    ppDoc.Save("Sample.pptx")
    'Close the presentation file
    ppDoc.Close()
    Back to top Generated by DocFX
    OSZAR »
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved
    OSZAR »