示例#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
 public GetPropertyExpression(ParameterExpression message, QualifiedPropertyName qualifiedPropertyName)
 {
     if (message == null)
     {
         throw Fx.Exception.ArgumentNull("message");
     }
     if (qualifiedPropertyName.Scope == PropertyScope.System && !SystemPropertyAccessor.HasGetProperty(qualifiedPropertyName.Name))
     {
         throw new ArgumentException(SRClient.MessageGetPropertyNotFound(qualifiedPropertyName.Name, typeof(BrokeredMessage)), "qualifiedPropertyName");
     }
     this.message       = message;
     this.propertyScope = Expression.Constant(qualifiedPropertyName.Scope);
     this.propertyName  = Expression.Constant(qualifiedPropertyName.Name);
 }
示例#3
0
 public SetPropertyExpression(ParameterExpression message, QualifiedPropertyName property, Expression value)
 {
     if (message == null)
     {
         throw Fx.Exception.ArgumentNull("message");
     }
     if (value == null)
     {
         throw Fx.Exception.ArgumentNull("value");
     }
     if (property.Scope == PropertyScope.System && !SystemPropertyAccessor.HasSetProperty(property.Name))
     {
         throw new ArgumentException(SRClient.MessageSetPropertyNotFound(property.Name, typeof(BrokeredMessage)), "property");
     }
     this.message  = message;
     this.property = property;
     this.@value   = value;
 }
示例#4
0
 private static object GetSystemProperty(BrokeredMessage message, string propertyName)
 {
     return(SystemPropertyAccessor.GetProperty(message, propertyName));
 }