Exemple #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);
        }
Exemple #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);
 }
Exemple #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;
 }
Exemple #4
0
 private static object GetSystemProperty(BrokeredMessage message, string propertyName)
 {
     return(SystemPropertyAccessor.GetProperty(message, propertyName));
 }