Table of Contents

Class EnumerablePlayer

Namespace
Hi.Common
Assembly
HiGeom.dll

Run enumerable with Pause(), Resume() and etc. functions.

public class EnumerablePlayer : IDisposable
Inheritance
EnumerablePlayer
Implements
Inherited Members
Extension Methods

Constructors

EnumerablePlayer()

Ctor.

public EnumerablePlayer()

Properties

Actions

Collection of actions to be executed by the player.

public IEnumerable<Action> Actions { get; set; }

Property Value

IEnumerable<Action>

ExceptionAction

Action to handle exceptions that occur during execution.

public Action<Exception> ExceptionAction { get; set; }

Property Value

Action<Exception>

IsFinished

Is the process finished from Start().

public bool IsFinished { get; }

Property Value

bool

IsLocked

Is started but not finished. IsLocked keeps true even if Pause() is called. The property is true if a task started and the task has not yet finished.

public bool IsLocked { get; }

Property Value

bool

IsRunning

Is running. Not paused either finished. The property is true if a task started and the task has not yet finished and Pause() is not called.

public bool IsRunning { get; }

Property Value

bool

ResettingSemaphore

internal use.

public SemaphoreSlim ResettingSemaphore { get; set; }

Property Value

SemaphoreSlim

Methods

BreakAsync()

Breaks the current execution asynchronously.

public Task BreakAsync()

Returns

Task

A task representing the asynchronous operation.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

Pause()

Pauses the execution of actions.

public void Pause()

Reset()

Resets the player synchronously.

public void Reset()

ResetAsync()

Asynchronously resets the player.

public Task ResetAsync()

Returns

Task

A task representing the asynchronous operation.

Resume()

Resume the process.

public void Resume()

RunToOneActionEnd()

Runs the player until one action completes.

public void RunToOneActionEnd()

Start()

Start the process.

public Task Start()

Returns

Task

Terminate()

Terminates the execution of actions synchronously.

public void Terminate()

TerminateAsync()

Terminates the execution of actions asynchronously.

public Task TerminateAsync()

Returns

Task

A task representing the asynchronous operation.

WaitPlayingTask()

Wait playing to an end. Wait Hi.Common.EnumerablePlayer.PlayingTask.

public void WaitPlayingTask()

Events

EndedEvent

Event triggered when the player ends.

public event Action EndedEvent

Event Type

Action

IsLockedEventHandler

Event triggered when the lock state changes.

public event Action<bool> IsLockedEventHandler

Event Type

Action<bool>

IsRunningChangedEvent

Event triggered when the running state changes.

public event Action<bool> IsRunningChangedEvent

Event Type

Action<bool>

OnCallingTerminate

Event triggered when termination is being called.

public event EventHandler OnCallingTerminate

Event Type

EventHandler

OnFinished

Event triggered when the player has finished playing all actions

public event EventHandler OnFinished

Event Type

EventHandler

ResetedEvent

Event triggered after the player has been reset.

public event Func<Task> ResetedEvent

Event Type

Func<Task>

ResetingEvent

Event triggered before resetting the player.

public event Func<Task> ResetingEvent

Event Type

Func<Task>

StartingEvent

Event triggered when the player starts.

public event Action StartingEvent

Event Type

Action