Opalis Quick Integration Kit 3.0
Marks a specific property in a class already marked as an OpalisObject as a property that can be used to inject configuration data.

Namespace:  Opalis.QuickIntegrationKit
Assembly:  Opalis.QuickIntegrationKit(in Opalis.QuickIntegrationKit.dll) Version: 3.0.0.0 (3.1.0.1)

Syntax

C#
public 
sealed 
class 
OpalisConfigurationAttribute : 
Attribute
Visual Basic (Declaration)
Public 
NotInheritable 
Class 
OpalisConfigurationAttribute _
	
Inherits 
Attribute
Visual C++
public 
ref class 
OpalisConfigurationAttribute 
sealed : 
public 
Attribute

Remarks

The primary reason for encapsulating OpalisInput properties in a separate OpalisData class is to allow configuration information to be shared by more than one OpalisObject class.

Another reason for providing an OpalisConfiguration property is to support classes that implement the IOpalisObjectinterface in order to dynamically collect design details that are based on a specific configuration.

There are some restrictions on which properties can be marked with the OpalisConfiguration attribute:

  • The property must have a public set method.
  • The property type must be a class that is marked with the OpalisData attribute.

Examples

CopyC#
[OpalisData(
"SMTP Mail Client")]
public 
class SmtpMailClientAdapter
{

private 
readonly SmtpClient client =

new SmtpClient();

	[OpalisInput]

public 
string MailServer { set {
client.Host = value; } }

	[OpalisInput]

public 
int Port { set { client.Port
= value; } }


public 
void Send(MailAddress to,
MailAddress from, 
string subject, 
string body)
	{
		client.Send(to.Address, from.Address, subject, body);
}
}

[OpalisObject(
"SMTP Send Mail")]
public 
class SmtpSendMail
{

private
SmtpMailClientAdapter client;

private MailAddress to,
from;

private 
string subject, body;

	[OpalisConfiguration]

public SmtpMailClientAdapter
Client{ set { client = value; } }

	[OpalisInput]

public MailAddress To { set
{ to = value; } }

	[OpalisInput]

public MailAddress From {
set { from = value; } }

	[OpalisInput]

public 
string Subject { set {
subject = value; } }

	[OpalisInput]

public 
string Body { set { body =
value; } }

	[OpalisMethod]

public 
void Send()
	{
		client.Send(to, from, subject, body);
}
}

Inheritance Hierarchy

System . . :: . Object
   System . . :: . Attribute
     Opalis.QuickIntegrationKit . . :: . OpalisConfigurationAttribute

See Also