public static bool TryGet(Message message, out ChannelBindingMessageProperty property)
 {
     if (message == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("message");
     }
     return TryGet(message.Properties, out property);
 }
Example #2
0
 public static bool TryGet(Message message, out ChannelBindingMessageProperty property)
 {
     if (message == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("message");
     }
     return(TryGet(message.Properties, out property));
 }
 public static void TryAddToMessage(ChannelBinding channelBindingToken, Message message, bool messagePropertyOwnsCleanup)
 {
     if (channelBindingToken != null)
     {
         ChannelBindingMessageProperty property = new ChannelBindingMessageProperty(channelBindingToken, messagePropertyOwnsCleanup);
         property.AddTo(message);
         property.Dispose(); //message.Properties.Add() creates a copy...
     }
 }
Example #4
0
 public static void TryAddToMessage(ChannelBinding channelBindingToken, Message message, bool messagePropertyOwnsCleanup)
 {
     if (channelBindingToken != null)
     {
         ChannelBindingMessageProperty property = new ChannelBindingMessageProperty(channelBindingToken, messagePropertyOwnsCleanup);
         property.AddTo(message);
         property.Dispose(); //message.Properties.Add() creates a copy...
     }
 }
Example #5
0
        public static bool TryGet(MessageProperties properties, out ChannelBindingMessageProperty property)
        {
            object obj2;

            if (properties == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("properties");
            }
            property = null;
            if (properties.TryGetValue(Name, out obj2))
            {
                property = obj2 as ChannelBindingMessageProperty;
                return(property != null);
            }
            return(false);
        }
 protected override void PrepareMessage(Message message)
 {
     base.PrepareMessage(message);
     IPEndPoint remoteIPEndPoint = this.rawConnection.RemoteIPEndPoint;
     if (remoteIPEndPoint != null)
     {
         RemoteEndpointMessageProperty property = new RemoteEndpointMessageProperty(remoteIPEndPoint);
         message.Properties.Add(RemoteEndpointMessageProperty.Name, property);
     }
     if (this.channelBindingToken != null)
     {
         ChannelBindingMessageProperty property2 = new ChannelBindingMessageProperty(this.channelBindingToken, false);
         property2.AddTo(message);
         property2.Dispose();
     }
 }
        protected override void PrepareMessage(Message message)
        {
            base.PrepareMessage(message);
            IPEndPoint remoteIPEndPoint = this.rawConnection.RemoteIPEndPoint;

            if (remoteIPEndPoint != null)
            {
                RemoteEndpointMessageProperty property = new RemoteEndpointMessageProperty(remoteIPEndPoint);
                message.Properties.Add(RemoteEndpointMessageProperty.Name, property);
            }
            if (this.channelBindingToken != null)
            {
                ChannelBindingMessageProperty property2 = new ChannelBindingMessageProperty(this.channelBindingToken, false);
                property2.AddTo(message);
                property2.Dispose();
            }
        }
        public static bool TryGet(MessageProperties properties, out ChannelBindingMessageProperty property)
        {
            if (properties == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(properties));
            }

            property = null;
            object value;

            if (properties.TryGetValue(ChannelBindingMessageProperty.Name, out value))
            {
                property = value as ChannelBindingMessageProperty;
                return(property != null);
            }

            return(false);
        }
        public static bool TryGet(MessageProperties properties, out ChannelBindingMessageProperty property)
        {
            if (properties == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("properties");
            }

            property = null;
            object value;

            if (properties.TryGetValue(ChannelBindingMessageProperty.Name, out value))
            {
                property = value as ChannelBindingMessageProperty;
                return property != null;
            }

            return false;
        }