コード例 #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);
        }
コード例 #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);
        }
コード例 #3
0
 private static object SetPropertyMethod(BrokeredMessage message, PropertyScope scope, string name, object value)
 {
     if (value is DBNull)
     {
         value = null;
     }
     if (scope == PropertyScope.System)
     {
         return(SetPropertyExpression.SetSystemProperty(message, name, value));
     }
     if (scope != PropertyScope.User)
     {
         throw new ArgumentException(SRClient.FilterScopeNotSupported(scope), "scope");
     }
     return(SetPropertyExpression.SetUserProperty(message, name, value));
 }