C# Class EpLibrary.cs.EventEx

A class that handles the event functionality.
Inheritance: BaseLock, IDisposable
Datei anzeigen Open project: juhgiyo/EpLibrary.cs Class Usage Examples

Private Properties

Property Type Description
Dispose void

Public Methods

Method Description
Dispose ( ) : void
EventEx ( EventEx b ) : System

Default Copy Constructor

EventEx ( String eventName = null ) : System

Default Constructor

EventEx ( bool isInitialRaised, EventResetMode eventResetMode, String eventName = null ) : System

Default Constructor

GetEventHandle ( ) : EventWaitHandle

Get actual event

GetEventResetMode ( ) : EventResetMode

Returns the flag whether this event is resetting manually.

Lock ( ) : bool

Locks the critical section

ResetEvent ( ) : bool

Reset the event raised

if event is not raised then no effect

SetEvent ( ) : bool

Set the event to be raised

if event is already raised then no effect this function is same as unlock

TryLock ( ) : bool

Try to lock the critical section If other thread is already in the critical section, it just returns false and continue, otherwise obtain the ciritical section

TryLockFor ( int dwMilliSecond ) : bool

Try to lock the critical section for given time

Unlock ( ) : void

Leave the critical section

WaitForEvent ( int dwMilliSecond = Timeout.Infinite ) : bool

Wait for the event raised for given time

Private Methods

Method Description
Dispose ( bool isDisposing ) : void

Method Details

Dispose() public method

public Dispose ( ) : void
return void

EventEx() public method

Default Copy Constructor
public EventEx ( EventEx b ) : System
b EventEx the object to copy from
return System

EventEx() public method

Default Constructor
public EventEx ( String eventName = null ) : System
eventName String name of the event to distinguish
return System

EventEx() public method

Default Constructor
public EventEx ( bool isInitialRaised, EventResetMode eventResetMode, String eventName = null ) : System
isInitialRaised bool flag to raise the event on creation
eventResetMode EventResetMode EventResetMode
eventName String name of the event to distinguish
return System

GetEventHandle() public method

Get actual event
public GetEventHandle ( ) : EventWaitHandle
return System.Threading.EventWaitHandle

GetEventResetMode() public method

Returns the flag whether this event is resetting manually.
public GetEventResetMode ( ) : EventResetMode
return EventResetMode

Lock() public method

Locks the critical section
public Lock ( ) : bool
return bool

ResetEvent() public method

Reset the event raised
if event is not raised then no effect
public ResetEvent ( ) : bool
return bool

SetEvent() public method

Set the event to be raised
if event is already raised then no effect this function is same as unlock
public SetEvent ( ) : bool
return bool

TryLock() public method

Try to lock the critical section If other thread is already in the critical section, it just returns false and continue, otherwise obtain the ciritical section
public TryLock ( ) : bool
return bool

TryLockFor() public method

Try to lock the critical section for given time
public TryLockFor ( int dwMilliSecond ) : bool
dwMilliSecond int the wait time
return bool

Unlock() public method

Leave the critical section
public Unlock ( ) : void
return void

WaitForEvent() public method

Wait for the event raised for given time
public WaitForEvent ( int dwMilliSecond = Timeout.Infinite ) : bool
dwMilliSecond int the wait time in millisecond
return bool