static void CloneProperties(MessageProperties destination, MessageProperties source) { MessageEncoder encoder = destination.Encoder; destination.CopyProperties(source); destination.Encoder = encoder; FilterProperties(destination); }
public void CopyProperties () { var mp = new MessageProperties (); var obj = new object (); var obj2 = new object (); mp.Add ("FooProperty", obj); var mp2 = new MessageProperties (); mp2.Add ("BarProperty", obj2); mp.CopyProperties (mp2); Assert.AreEqual (obj, mp ["FooProperty"], "#1"); Assert.AreEqual (obj2, mp ["BarProperty"], "#2"); }
public void CopyProperties() { var mp = new MessageProperties(); var obj = new object(); var obj2 = new object(); mp.Add("FooProperty", obj); var mp2 = new MessageProperties(); mp2.Add("BarProperty", obj2); mp.CopyProperties(mp2); Assert.AreEqual(obj, mp ["FooProperty"], "#1"); Assert.AreEqual(obj2, mp ["BarProperty"], "#2"); }