[This topic is pre-release documentation and
is subject to change in future releases. Blank topics are included
as placeholders.]
Assembly: Microsoft.ConfigurationManagement.Messaging(in Microsoft.ConfigurationManagement.Messaging.dll)
Verifies if the sender is capable of sending
the message based on its
SupportedSenderAttributedeclaration.
Namespace:
Microsoft.ConfigurationManagement.Messaging.Framework
Assembly: Microsoft.ConfigurationManagement.Messaging(in Microsoft.ConfigurationManagement.Messaging.dll)
Syntax
C# | Visual Basic | Visual C++ |
public static bool IsSenderValidForMessage( IMessageSender sender, IMessage message )
Public Shared Function IsSenderValidForMessage ( _ sender As IMessageSender, _ message As IMessage _ ) As Boolean
public: static bool IsSenderValidForMessage( IMessageSender^ sender, IMessage^ message )
Parameters
- sender
-
IMessageSender
Sender to validate against message
- message
-
IMessage
Message to validate sender
Return Value
True if sender is valid for the message, false if notRemarks
If no SupportedSenderAttribute is specified, this will
return true
Examples
Copy Code | |
---|---|
if(false == IsSenderValidForMessage(mySender, myMessage) { throw new InvalidOperationException("Cannot use sender " + mySender.GetType() + " with message " + myMessage.GetType()); } |
Exceptions
Exception | Condition |
---|---|
System . . :: . . ArgumentNullException | Must supply valid sender and message arguments |