Action Class
Represents a type that specifies what should happen when the user clicks on a drawing or a text or hovers over a drawing or a text with a pointing device such as a computer mouse.
- Inheritance:
- System.ObjectAction
Properties
ActionType
Gets the type of the action.
Property Value
The type of the action.
Highlight
Gets or sets a value indicating whether the application should highlight the current drawing or text when it is clicked or hovered over.
Default value is false.
Property Value
- System.Boolean
true if the application should highlight the current drawing or text when it is clicked or hovered over; otherwise, false.
OtherPresentationSlideIndex
Gets a value that specifies the slide index from which the other presentation slide show should start.
Applicable only if ActionType is HyperlinkToOtherPresentation.
public int OtherPresentationSlideIndex { get; }
Public ReadOnly Property OtherPresentationSlideIndex As Integer
Property Value
- System.Int32
A value that specifies the slide index from which the other presentation slide show should start.
OtherPresentationSlideTitle
Gets a value that specifies the slide title of the first slide in the other presentation slide show.
Applicable only if ActionType is HyperlinkToOtherPresentation.
public string OtherPresentationSlideTitle { get; }
Public ReadOnly Property OtherPresentationSlideTitle As String
Property Value
- System.String
A value that specifies the slide title of the first slide in the other presentation slide show.
ReturnAfterCustomShow
Gets a value indicating whether to return to the current slide show after the specified custom slide show has ended.
Applicable only if ActionType is HyperlinkToCustomShow.
public bool ReturnAfterCustomShow { get; }
Public ReadOnly Property ReturnAfterCustomShow As Boolean
Property Value
- System.Boolean
true to return to the current slide show after the specified custom slide show has ended; otherwise, false.
ScreenTip
Gets or sets the tooltip that should be displayed when the current drawing or text is hovered over with a pointing device such as a computer mouse.
Default value is System.String.Empty.
Property Value
- System.String
The tooltip that should be displayed when the current drawing or text is hovered over with a pointing device such as a computer mouse.
Remarks
If this property is not set, then the application might display hyperlink text as a tooltip.
Sound
Gets or sets the sound to be played when the action is activated.
Default value is null indicating that no sound shall be played when the action is activated.
To remove a sound from this action, set this property to null.
Property Value
The sound to be played when the action is activated.
Remarks
Sound is always stored in a Waveform Audio File Format (Wav) stream that is embedded in the presentation.
Do not set any member on the returned AudioContent because they are not supported in this context (for example, they won't be saved to a PPTX file).
To set a sound for the action, either use this property or the PlaySound(Stream) method.
StopPreviousSound
Gets or sets a value indicating whether to stop all previous sounds when this action is activated.
Property Value
- System.Boolean
true to stop all previous sounds when this action is activated; otherwise, false.
Target
Gets the target of the action.
Property Value
- System.Object
The target of the action.
Remarks
Value is an instance of a CustomSlideShow, if ActionType is HyperlinkToCustomShow; instance of a Slide, if ActionType is HyperlinkToSlide; instance of a System.String, if ActionType is HyperlinkToWebPage, HyperlinkToOtherPresentation, HyperlinkToFile, RunProgram, RunMacro or ObjectAction; null, for any other ActionType value.
TargetFrame
Gets or sets the target frame that is to be used when opening this hyperlink. When the hyperlink is activated this property is used to determine if a new window is launched for viewing or if an existing one can be used.
Default value is System.String.Empty.
Property Value
- System.String
The target frame that is to be used when opening this hyperlink.
Remarks
If this property is not set, then the application opens a new window.
Methods
PlaySound(Stream)
Specifies the sound to be played when the action is activated.
public AudioContent PlaySound(Stream stream)
Public Function PlaySound(stream As Stream) As AudioContent
Parameters
stream
- System.IO.Stream
An audio stream in a Waveform Audio File Format (Wav).
Returns
The sound to be played when the action is activated.
Remarks
Sound is always stored in a Waveform Audio File Format (Wav) stream that is embedded in the presentation.
Do not set any member on the returned AudioContent because they are not supported in this context (for example, they won't be saved to a PPTX file).
To set a sound for the action, either use this method or the Sound property.
Exceptions
- System.ArgumentNullException
stream
is null.
- System.ArgumentException
stream
is not readable.
PlaySound(Stream, String)
Specifies the sound to be played when the action is activated.
public AudioContent PlaySound(Stream stream, string soundName)
Public Function PlaySound(stream As Stream, soundName As String) As AudioContent
Parameters
stream
- System.IO.Stream
An audio stream in a Waveform Audio File Format (Wav).
soundName
- System.String
An original name or a given short name used to distinguish this sound from others by providing a human readable name for the attached sound should the user need to identify the sound among others within the UI.
Returns
The sound to be played when the action is activated.
Remarks
Sound is always stored in a Waveform Audio File Format (Wav) stream that is embedded in the presentation.
Do not set any member on the returned AudioContent because they are not supported in this context (for example, they won't be saved to a PPTX file).
To set a sound for the action, either use this method or the Sound property.
Exceptions
- System.ArgumentNullException
stream
is null.
- System.ArgumentException
stream
is not readable.
Set(ActionType, Object[])
Sets the action to the current drawing or text.
public void Set(ActionType actionType, params object[] parameters)
Public Sub Set(actionType As ActionType, ParamArray parameters As Object())
Parameters
actionType
- ActionType
Type of the action.
parameters
- System.Object[]
The action parameters. See ActionType documentation for a list of a required and optional parameters for each type of the action.
Exceptions
- System.InvalidOperationException
Specified action is not supported in the current context.
ToString()
Returns a System.String that represents this Action instance.
Returns
- System.String
A System.String that represents this Action instance.
Overrides
Remarks
This method should be used primarily for debugging purposes and should be considered volatile (format of its return value might change in future versions).