private void InitializeMessageWriter(Message message,
     MessageSizeWriter msWriter, MessageDirection direction)
 {
     msWriter.Action = message.Headers.Action;
     msWriter.Direction = direction;
     if (dispatchOperation != null)
     {
         var channelDispatcher = 
             dispatchOperation.Parent.ChannelDispatcher;
         msWriter.ListenerAddress = channelDispatcher.Listener.Uri;                        
         msWriter.OperationName = dispatchOperation.Name;
     }
     else
     {
         msWriter.OperationName = clientOperation.Name;
     }
 }
        public static MessageSizeWriter Create(Message message)
        {
            Debug.Assert(!message.Properties.ContainsKey(Name),
                "Cannot create the MessageSizeWriter for the same message " + 
                "twice");

            var msWriter = new MessageSizeWriter();
            message.Properties.Add(Name, msWriter);
            return msWriter;
        }