Esempio n. 1
0
 protected static Restriction CreateAndStringPropertyRestriction(PropTag propertyTag, string[] values)
 {
     Restriction[] array = new Restriction.PropertyRestriction[values.Length];
     for (int i = 0; i < values.Length; i++)
     {
         array[i] = Condition.CreatePropertyRestriction <string>(propertyTag, values[i]);
     }
     return(Condition.CreateAndRestriction(array));
 }
Esempio n. 2
0
        protected static Restriction CreateOnlyToMeRestriction()
        {
            Restriction[] array = new Restriction[3];
            array[0] = Condition.CreateBooleanPropertyRestriction(PropTag.MessageToMe, true, Restriction.RelOp.Equal);
            Restriction restriction = Condition.CreateStringContentRestriction(PropTag.DisplayTo, ";", ContentFlags.SubString);

            array[1] = Restriction.Not(restriction);
            array[2] = Condition.CreatePropertyRestriction <string>(PropTag.DisplayCc, string.Empty);
            return(Restriction.And(array));
        }
Esempio n. 3
0
        internal override Restriction BuildRestriction()
        {
            if (string.Equals(this.action, RequestedAction.Any.ToString(), StringComparison.OrdinalIgnoreCase))
            {
                return(Condition.CreatePropertyRestriction <int>((PropTag)277872643U, 2));
            }
            PropTag propertyTag = base.Rule.PropertyDefinitionToPropTagFromCache(Rule.NamedDefinitions[5]);

            return(Condition.CreateAndRestriction(new Restriction[]
            {
                Condition.CreatePropertyRestriction <int>((PropTag)277872643U, 2),
                Condition.CreatePropertyRestriction <string>(propertyTag, this.action)
            }));
        }
Esempio n. 4
0
 protected static Restriction CreateORGuidContentRestriction(Guid[] values, PropTag propertyTag)
 {
     if (values.Length > 1)
     {
         Restriction[] array = new Restriction.PropertyRestriction[values.Length];
         for (int i = 0; i < values.Length; i++)
         {
             array[i] = Condition.CreatePropertyRestriction <Guid>(propertyTag, values[i]);
         }
         return(Restriction.Or(array));
     }
     if (values.Length == 1)
     {
         return(Condition.CreatePropertyRestriction <Guid>(propertyTag, values[0]));
     }
     return(null);
 }
Esempio n. 5
0
        internal override Restriction BuildRestriction()
        {
            PropTag propertyTag = base.Rule.PropertyDefinitionToPropTagFromCache(Rule.NamedDefinitions[1]);

            if (base.Text == null || base.Text.Length == 0)
            {
                return(Condition.CreatePropertyRestriction <bool>(propertyTag, true));
            }
            PropTag     propertyTag2 = base.Rule.PropertyDefinitionToPropTagFromCache(Rule.NamedDefinitions[2]);
            Restriction restriction  = (1 == base.Text.Length) ? Condition.CreatePropertyRestriction <string>(propertyTag2, base.Text[0]) : Condition.CreateAndStringPropertyRestriction(propertyTag2, base.Text);

            return(Condition.CreateAndRestriction(new Restriction[]
            {
                Condition.CreatePropertyRestriction <bool>(propertyTag, true),
                restriction
            }));
        }
        internal override Restriction BuildRestriction()
        {
            PropTag propertyTag = base.Rule.PropertyDefinitionToPropTagFromCache(Rule.NamedDefinitions[0]);

            return((1 == base.Text.Length) ? Condition.CreatePropertyRestriction <string>(propertyTag, base.Text[0]) : Condition.CreateAndStringPropertyRestriction(propertyTag, base.Text));
        }
 internal override Restriction BuildRestriction()
 {
     return(Condition.CreatePropertyRestriction <bool>(PropTag.AutoForwarded, true));
 }