Example #1
0
        private static object SetSystemProperty(BrokeredMessage message, string propertyName, object value)
        {
            object obj;

            System.Type propertyType = SystemPropertyAccessor.GetPropertyType(propertyName);
            obj = (value == null || !(value.GetType() != propertyType) ? value : SetPropertyExpression.ImplicitConvert(value, propertyType));
            SystemPropertyAccessor.SetProperty(message, propertyName, obj);
            return(obj);
        }
Example #2
0
        private static object SetUserProperty(BrokeredMessage message, string propertyName, object value)
        {
            object obj;

            System.Type type = null;
            if (message.Properties.TryGetValue(propertyName, out obj) && obj != null)
            {
                type = obj.GetType();
            }
            object obj1 = (type == null ? value : SetPropertyExpression.ImplicitConvert(value, type));

            message.BrokerUpdateProperty(propertyName, obj1);
            return(obj1);
        }