Class TaskElement
Represents configuration of a task.
Inheritance
Namespace: Nevatech.Vsb.Agent.Configuration
Assembly: Nevatech.Vsb.Agent.dll
Syntax
public sealed class TaskElement : ConfigurationElement
Constructors
TaskElement()
Declaration
public TaskElement()
Properties
Name
Gets or sets the element's name. The name must be unique within configuration element collection.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Properties
Gets collection of configuration element properties.
Declaration
protected override ConfigurationPropertyCollection Properties { get; }
Property Value
Type | Description |
---|---|
System.Configuration.ConfigurationPropertyCollection |
TypeName
Gets or sets fully qualified task type name.
Declaration
public string TypeName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
CreateTask()
Creates and configures the task.
Declaration
public ITask CreateTask()
Returns
Type | Description |
---|---|
ITask | An instance that implements ITask. |
InitializeFrom(ITask)
Initializes this configuration element from the specified ITask.
Declaration
public void InitializeFrom(ITask task)
Parameters
Type | Name | Description |
---|---|---|
ITask | task | The ITask to initialize from. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown if the specified service task is a null reference. |
OnDeserializeUnrecognizedElement(String, XmlReader)
Called when an unknown element is encountered while deserializing the ConfigurationElement object.
Declaration
protected override bool OnDeserializeUnrecognizedElement(string elementName, XmlReader reader)
Parameters
Type | Name | Description |
---|---|---|
System.String | elementName | The name of the unknown subelement. |
System.Xml.XmlReader | reader | The System.Xml.XmlReader being used for deserialization. |
Returns
Type | Description |
---|---|
System.Boolean | True when an unknown element is encountered while deserializing; otherwise, false. This method always returns true. |
Remarks
See System.Configuration.ConfigurationElement.OnDeserializeUnrecognizedElement(System.String,System.Xml.XmlReader) method for more information.
SerializeElement(XmlWriter, Boolean)
Writes the contents of this configuration element to the configuration file. See System.Configuration.ConfigurationElement.SerializeElement(System.Xml.XmlWriter,System.Boolean) method for more information.
Declaration
protected override bool SerializeElement(XmlWriter writer, bool serializeCollectionKey)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlWriter | writer | The System.Xml.XmlWriter that writes to the configuration file. |
System.Boolean | serializeCollectionKey | true to serialize only the collection key properties; otherwise, false. |
Returns
Type | Description |
---|---|
System.Boolean | True if any data was actually serialized; otherwise, false. |