Class CodeComponent
Implements a message pipeline component that allows to write a custom C# code to transform the message.
Implements
Inherited Members
Namespace: Nevatech.Vsb.Repository.Processing
Assembly: Nevatech.Vsb.Repository.dll
Syntax
public sealed class CodeComponent : MessagePipelineComponentBase, IValidator, IEquatable<MessagePipelineComponentBase>, IExtensibleDataObject
Constructors
CodeComponent()
Declaration
public CodeComponent()
Fields
ElementName
Name of the root element when object is serialized to XML.
Declaration
public const string ElementName = "CODE"
Field Value
Type | Description |
---|---|
System.String |
Properties
Function
Gets or sets the component's C# code. The function may access the "context" parameter of the type MessagePipelineContext and must return the MessagePipelineResult value.
Declaration
public string Function { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Examples
if (context.IsRequest)
{
context.SetMessageBodyContent("test");
}
return MessagePipelineResult.Continue;
Imports
Gets or sets the namespaces that must be declared with "using" statements. Namespaces shall be separated with either a new line or a semicolon.
Declaration
public string Imports { get; set; }
Property Value
Type | Description |
---|---|
System.String |
References
Gets or sets the fully qualified names of assemblies that must be referenced. Names shall be separated with either a new line or a semicolon.
Declaration
public string References { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
Equals(MessagePipelineComponentBase)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(MessagePipelineComponentBase other)
Parameters
Type | Name | Description |
---|---|---|
MessagePipelineComponentBase | other | The object to compare with the current object. |
Returns
Type | Description |
---|---|
System.Boolean | True if the specified object is equal to the current object; otherwise, false. |
Overrides
Equals(Object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The object to compare with the current object. |
Returns
Type | Description |
---|---|
System.Boolean | True if the specified object is equal to the current object; otherwise, false. |
Overrides
GetHashCode()
Returns hash code for the value of this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | Hash code for the value of this instance. |
Overrides
ProcessMessage(MessagePipelineContext)
Process the intercepted message.
Declaration
public override MessagePipelineResult ProcessMessage(MessagePipelineContext context)
Parameters
Type | Name | Description |
---|---|---|
MessagePipelineContext | context | Provides the message processing context. |
Returns
Type | Description |
---|---|
MessagePipelineResult | Value indicating if message should continue on its way to the recipient or must be stopped and returned to the sender. |
Overrides
ToString()
Returns string representation of the object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | String representing the object's content. |
Overrides
Validate()
Evaluates the state of the object.
Declaration
public override bool Validate()
Returns
Type | Description |
---|---|
System.Boolean | True if state is valid; otherwise, false. |