C# Класс ControlSystem.ThreadHandling

Class to handle all threads in system, everything handled by a unique description tag that stays with a thread from moment it gets added till it gets removed.
Показать файл Открыть проект

Открытые методы

Метод Описание
ThreadHandling ( ) : System

Constructor for class : Makes a new list for usage

abortAllAndWait ( ) : void

Functions aborts all threads currently running and waits for them to finish

abortAndWait ( string _description ) : void

Terminates thread with supplied description, then waits for it to finish terminating

addThread ( ParameterizedThreadStart _parameterizedThreadStart, string _description ) : void

Overloaded addThread function, so that it can add threads with a parameterizedThreadStart to a thread list by a description

addThread ( ThreadStart _threadStart, string _description ) : void

addThread function, adds a function as a thread to a list, which needs its own thread for running. This specific function handles ThreadStart parameter, which means it can only take functions with no parameters as argument

find ( string _description ) : ThreadHolder

Function that looks up saved threads by description

removeThread ( string _description ) : void

Removes the specified thread from the thread list (Stops and waits for it to finish if it was running).

start ( string _description ) : void

Starts the thread from supplied description if found.

start ( string _description, object _obj ) : void

Starts the thread from supplied description if found but with a given parameter object

Приватные методы

Метод Описание
remakeThread ( ThreadHolder _threadHolder ) : void

Remakes the thread so it can run under same name again.

Описание методов

ThreadHandling() публичный Метод

Constructor for class : Makes a new list for usage
public ThreadHandling ( ) : System
Результат System

abortAllAndWait() публичный Метод

Functions aborts all threads currently running and waits for them to finish
public abortAllAndWait ( ) : void
Результат void

abortAndWait() публичный Метод

Terminates thread with supplied description, then waits for it to finish terminating
public abortAndWait ( string _description ) : void
_description string Description which the function needs to terminate thread for and wait for
Результат void

addThread() публичный Метод

Overloaded addThread function, so that it can add threads with a parameterizedThreadStart to a thread list by a description
public addThread ( ParameterizedThreadStart _parameterizedThreadStart, string _description ) : void
_parameterizedThreadStart ParameterizedThreadStart Parameter is name of function that needs its own thread, as its paramterizedThreadStart, it means it have to be a function with parameter object: (functionname(object example){})
_description string Description which the thread needs to be saved as (unique)
Результат void

addThread() публичный Метод

addThread function, adds a function as a thread to a list, which needs its own thread for running. This specific function handles ThreadStart parameter, which means it can only take functions with no parameters as argument
public addThread ( ThreadStart _threadStart, string _description ) : void
_threadStart ThreadStart Parameter is name of function that needs its own thread, as its Threadstart, it means it have to be a function with no parameters: (functionname(){})
_description string Description which the thread needs to be saved as (unique)
Результат void

find() публичный Метод

Function that looks up saved threads by description
public find ( string _description ) : ThreadHolder
_description string String that descripes the thread looking for
Результат ThreadHolder

removeThread() публичный Метод

Removes the specified thread from the thread list (Stops and waits for it to finish if it was running).
public removeThread ( string _description ) : void
_description string Description which the function need to find the thread that should be deleted
Результат void

start() публичный Метод

Starts the thread from supplied description if found.
public start ( string _description ) : void
_description string Description is a string which the function needs to search and find a thread for in a list
Результат void

start() публичный Метод

Starts the thread from supplied description if found but with a given parameter object
public start ( string _description, object _obj ) : void
_description string Description is a string which the function needs to search and find a thread for in a list
_obj object An object that needs to be passed on to the thread as start parameter
Результат void