Show / Hide Table of Contents

Class ScriptManager

The script manager manages IScript blocks. A script block is a unit of code that does one particular job. It is used by the script manager to navigate through your menu options.

Inheritance
object
ScriptManager
Implements
IScriptManager
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: ivrToolkit.Core
Assembly: ivrToolkit.Core.dll
Syntax
public class ScriptManager : IScriptManager
Remarks
An example of a simple IVR program using script blocks would be:

ScriptBlocks\Welcome.cs
ScriptBlocks\MainMenu.cs
ScriptBlocks\Option1.cs
ScriptBlocks\Option2.cs
Examples
 // create the script manager
 ScriptManager scriptManager = new ScriptManager(line, startingScript);

 // run the script blocks
 while (scriptManager.hasNext())
 {
     scriptManager.execute();
 }
line.hangup();

Constructors

| Edit this page View Source

ScriptManager(ILoggerFactory, IScript)

Declaration
public ScriptManager(ILoggerFactory loggerFactory, IScript startingScript)
Parameters
Type Name Description
ILoggerFactory loggerFactory
IScript startingScript

Properties

| Edit this page View Source

NextScript

The next script block to be executed.

Declaration
public IScript NextScript { get; set; }
Property Value
Type Description
IScript

Methods

| Edit this page View Source

Execute()

Executes the next script block. Used with HasNext()

Declaration
public void Execute()
| Edit this page View Source

ExecuteAsync(CancellationToken)

Asynchronously executes the next script block. Used with HasNext()

Declaration
public Task ExecuteAsync(CancellationToken cancellationToken)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task
| Edit this page View Source

ExecuteScriptAsync(CancellationToken)

Asynchronously executes all the script blocks.

Declaration
public Task ExecuteScriptAsync(CancellationToken cancellationToken)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task
| Edit this page View Source

HasNext()

Checks to see if there is another script block to execute.

Declaration
public bool HasNext()
Returns
Type Description
bool

Returns the next script block to execute or null if there are no more.

Implements

IScriptManager

Extension Methods

ValidationExtensions.ThrowIfNull<T>(T, string)
  • View Source
In this article
Back to top Generated by DocFX