Class TaskCollection
Collection that manages ITask objects. It supports reading and
writing task configuration from and to configuration file; starting, stoping,
and disposing all tasks at once.
Inheritance
System.Object
System.Collections.ObjectModel.Collection<
ITask>
TaskCollection
Implements
System.Collections.Generic.IList<
ITask>
System.Collections.Generic.ICollection<
ITask>
System.Collections.IList
System.Collections.ICollection
System.Collections.Generic.IReadOnlyList<
ITask>
System.Collections.Generic.IReadOnlyCollection<
ITask>
System.Collections.Generic.IEnumerable<
ITask>
System.Collections.IEnumerable
System.IDisposable
Inherited Members
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.Add(Nevatech.Vsb.Agent.ITask)
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.Clear()
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.CopyTo(Nevatech.Vsb.Agent.ITask[], System.Int32)
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.Contains(Nevatech.Vsb.Agent.ITask)
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.GetEnumerator()
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.IndexOf(Nevatech.Vsb.Agent.ITask)
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.Insert(System.Int32, Nevatech.Vsb.Agent.ITask)
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.Remove(Nevatech.Vsb.Agent.ITask)
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.RemoveAt(System.Int32)
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.ClearItems()
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.InsertItem(System.Int32, Nevatech.Vsb.Agent.ITask)
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.RemoveItem(System.Int32)
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.SetItem(System.Int32, Nevatech.Vsb.Agent.ITask)
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.System.Collections.IEnumerable.GetEnumerator()
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.System.Collections.ICollection.CopyTo(System.Array, System.Int32)
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.System.Collections.IList.get_Item(System.Int32)
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.System.Collections.IList.set_Item(System.Int32, System.Object)
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.System.Collections.IList.Add(System.Object)
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.System.Collections.IList.Contains(System.Object)
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.System.Collections.IList.IndexOf(System.Object)
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.System.Collections.IList.Insert(System.Int32, System.Object)
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.System.Collections.IList.Remove(System.Object)
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.Count
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.Items
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.Item[System.Int32]
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.System.Collections.Generic.ICollection<Nevatech.Vsb.Agent.ITask>.IsReadOnly
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.System.Collections.ICollection.IsSynchronized
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.System.Collections.ICollection.SyncRoot
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.System.Collections.IList.Item[System.Int32]
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.System.Collections.IList.IsReadOnly
System.Collections.ObjectModel.Collection<Nevatech.Vsb.Agent.ITask>.System.Collections.IList.IsFixedSize
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: Nevatech.Vsb.Agent.dll
Syntax
public sealed class TaskCollection : Collection<ITask>, IList<ITask>, ICollection<ITask>, IList, ICollection, IReadOnlyList<ITask>, IReadOnlyCollection<ITask>, IEnumerable<ITask>, IEnumerable, IValidator, IDisposable
Constructors
TaskCollection()
Declaration
Properties
ErrorMessage
Gets the message indicating the errors found during validation process.
Declaration
public string ErrorMessage { get; }
Property Value
Type |
Description |
System.String |
|
Methods
Dispose()
Disposes all service tasks in the collection.
Declaration
Finalize()
Declaration
protected void Finalize()
ReadConfiguration()
Reads service tasks configuration from the current application configuration file.
Declaration
public void ReadConfiguration()
ReadConfiguration(Configuration)
Reads tasks configuration from provided configuration file.
Declaration
public void ReadConfiguration(Configuration configuration)
Parameters
Type |
Name |
Description |
System.Configuration.Configuration |
configuration |
Configuration file to read tasks from.
|
Exceptions
Type |
Condition |
System.ArgumentNullException |
Thrown, if configuration parameter is a null reference.
|
System.ObjectDisposedException |
Thrown, if this object has already been disposed.
|
System.Configuration.ConfigurationErrorsException |
Thrown, if service task can not be created.
|
StartAll(HostType)
Starts all tasks in the collection.
Declaration
public int StartAll(HostType hostType)
Parameters
Type |
Name |
Description |
HostType |
hostType |
The type of host process where task is running.
|
Returns
Type |
Description |
System.Int32 |
The number of successfully started tasks.
|
Exceptions
Type |
Condition |
System.ObjectDisposedException |
Thrown, if this object has already been disposed.
|
StopAll()
Stops all tasks in the collection.
Declaration
Returns
Type |
Description |
System.Int32 |
The number of successfully stopped tasks.
|
Exceptions
Type |
Condition |
System.ObjectDisposedException |
Thrown, if this object has already been disposed.
|
Validate()
Evaluates the state of all tasks in the collection.
Declaration
Returns
Type |
Description |
System.Boolean |
True if state of all tasks is valid or collection is empty; otherwise, false.
|
WriteConfiguration()
Writes service tasks configuration to the current application configuration file.
Declaration
public void WriteConfiguration()
WriteConfiguration(Configuration)
Writes configuration of all tasks in the collection to provided
System.Configuration.Configuration object.
Declaration
public void WriteConfiguration(Configuration configuration)
Parameters
Type |
Name |
Description |
System.Configuration.Configuration |
configuration |
Configuration object to write into.
|
Exceptions
Type |
Condition |
System.ArgumentNullException |
Thrown, if configuration parameter is a null reference.
|
System.ObjectDisposedException |
Thrown, if this object has already been disposed.
|
System.Configuration.ConfigurationErrorsException |
Thrown, if task can not be created.
|
Implements
System.Collections.Generic.IList<T>
System.Collections.Generic.ICollection<T>
System.Collections.IList
System.Collections.ICollection
System.Collections.Generic.IReadOnlyList<T>
System.Collections.Generic.IReadOnlyCollection<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
System.IDisposable