DefaultPropertiesToSend Class
Specifies the default property values that will be used when sending objects other than Message instances to a message queue.
Assembly: System.Messaging (in System.Messaging.dll)
The DefaultPropertiesToSend type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | DefaultPropertiesToSend | Initializes a new instance of the DefaultPropertiesToSend class. |
| Name | Description | |
|---|---|---|
![]() | AcknowledgeType | Gets or sets the type of acknowledgement message to be returned to the sending application. |
![]() | AdministrationQueue | Gets or sets the queue that receives acknowledgement messages generated by Message Queuing. |
![]() | AppSpecific | Gets or sets additional, application-specific information. |
![]() | AttachSenderId | Gets or sets a value that indicates whether the sender ID should be attached to the message. |
![]() | EncryptionAlgorithm | Gets or sets the encryption algorithm used to encrypt the body of a private message. |
![]() | Extension | Gets or sets additional information associated with the message. |
![]() | HashAlgorithm | Gets or sets the hashing algorithm used when authenticating messages or creating a digital signature for a message. |
![]() | Label | Gets or sets an application-defined string that describes the message. |
![]() | Priority | Gets or sets the message priority, which is used to determine where the message is placed in the queue. |
![]() | Recoverable | Gets or sets a value that indicates whether the message is guaranteed to be delivered in the event of a computer failure or network problem. |
![]() | ResponseQueue | Gets or sets the queue that receives application-generated response messages. |
![]() | TimeToBeReceived | Gets or sets the time limit for the message to be retrieved from the destination queue. |
![]() | TimeToReachQueue | Gets or sets the time limit for the message to reach the queue. |
![]() | TransactionStatusQueue | Gets the transaction status queue on the source computer. |
![]() | UseAuthentication | Gets or sets a value that indicates whether the message must be authenticated before being sent. |
![]() | UseDeadLetterQueue | Gets or sets a value that indicates whether a copy of the message that could not be delivered should be sent to a dead-letter queue. |
![]() | UseEncryption | Gets or sets a value that indicates whether to make the message private. |
![]() | UseJournalQueue | Gets or sets a value that indicates whether a copy of the message should be kept in a machine journal on the originating computer. |
![]() | UseTracing | Gets or sets a value that indicates whether to trace a message as it moves toward its destination queue. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
You can set default values on selected properties for messages sent to a MessageQueue. DefaultPropertiesToSend is used to specify default property values of the message being sent when objects other than Message instances are sent to a queue, for example, the string argument passed into the Send method in the code fragment, myMessageQueue.Send("hello"). The Message class has corresponding, identically named properties to those in DefaultPropertiesToSend that provide the values when sending a Message instance specifically. Even if you have specified MessageQueue::DefaultPropertiesToSend for a queue, sending a Message object to that queue will cause the values for the identically named Message properties to override the queue's DefaultPropertiesToSend values.
Properties that you do not set explicitly default to the values specified by the constructor, DefaultPropertiesToSend.
For a list of initial property values for an instance of DefaultPropertiesToSend, see the DefaultPropertiesToSend constructor.
The following code example uses the priority of a message to determine default properties to send for the message.
#using <system.dll> #using <system.messaging.dll> using namespace System; using namespace System::Messaging; ref class MyNewQueue { public: // Associates selected message property values // with high priority messages. void SendHighPriorityMessages() { // Connect to a message queue. MessageQueue^ myQueue = gcnew MessageQueue( ".\\myQueue" ); // Associate selected default property values with high // priority messages. myQueue->DefaultPropertiesToSend->Priority = MessagePriority::High; myQueue->DefaultPropertiesToSend->Label = "High Priority Message"; myQueue->DefaultPropertiesToSend->Recoverable = true; myQueue->DefaultPropertiesToSend->TimeToReachQueue = TimeSpan(0,0,30); // Send messages using these defaults. myQueue->Send( "High priority message data 1." ); myQueue->Send( "High priority message data 2." ); myQueue->Send( "High priority message data 3." ); return; } // Associates selected message property values // with normal priority messages. void SendNormalPriorityMessages() { // Connect to a message queue. MessageQueue^ myQueue = gcnew MessageQueue( ".\\myQueue" ); // Associate selected default property values with normal // priority messages. myQueue->DefaultPropertiesToSend->Priority = MessagePriority::Normal; myQueue->DefaultPropertiesToSend->Label = "Normal Priority Message"; myQueue->DefaultPropertiesToSend->Recoverable = false; myQueue->DefaultPropertiesToSend->TimeToReachQueue = TimeSpan(0,2,0); // Send messages using these defaults. myQueue->Send( "Normal priority message data 1." ); myQueue->Send( "Normal priority message data 2." ); myQueue->Send( "Normal priority message data 3." ); return; } }; // Provides an entry point into the application. // This example specifies different types of default // properties for messages. int main() { // Create a new instance of the class. MyNewQueue^ myNewQueue = gcnew MyNewQueue; // Send normal and high priority messages. myNewQueue->SendNormalPriorityMessages(); myNewQueue->SendHighPriorityMessages(); return 0; }
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
