Ejemplo n.º 1
0
        private static ADPersonToContactConverter[] GetConverters(ICollection <PropertyDefinition> personProperties, IEnumerable <PropertyDefinition> additionalContactProperties)
        {
            new List <ADPersonToContactConverter>(personProperties.Count);
            HashSet <PropertyDefinition> hashSet = new HashSet <PropertyDefinition>();

            foreach (PropertyDefinition propertyDefinition in personProperties)
            {
                ApplicationAggregatedProperty applicationAggregatedProperty = propertyDefinition as ApplicationAggregatedProperty;
                if (applicationAggregatedProperty != null)
                {
                    foreach (PropertyDependency propertyDependency in applicationAggregatedProperty.Dependencies)
                    {
                        hashSet.Add(propertyDependency.Property);
                    }
                }
            }
            if (additionalContactProperties != null)
            {
                foreach (PropertyDefinition item in additionalContactProperties)
                {
                    hashSet.Add(item);
                }
            }
            return(ADPersonToContactConverterSet.GetConverters(hashSet));
        }
 public PersonSchemaProperties(PropertyDefinition[] extendedProperties, params IEnumerable <PropertyDefinition>[] otherPropertySets)
 {
     if (extendedProperties != null)
     {
         StorePropertyDefinition[] array = new StorePropertyDefinition[extendedProperties.Length];
         for (int i = 0; i < extendedProperties.Length; i++)
         {
             array[i] = (StorePropertyDefinition)extendedProperties[i];
         }
         ApplicationAggregatedProperty item    = new ApplicationAggregatedProperty(PersonSchema.ExtendedProperties, PersonPropertyAggregationStrategy.CreateExtendedPropertiesAggregation(array));
         HashSet <PropertyDefinition>  hashSet = new HashSet <PropertyDefinition>();
         hashSet.Add(item);
         if (otherPropertySets != null)
         {
             foreach (ICollection <PropertyDefinition> collection in otherPropertySets)
             {
                 if (collection != null)
                 {
                     foreach (PropertyDefinition propertyDefinition in collection)
                     {
                         if (!object.Equals(propertyDefinition, PersonSchema.ExtendedProperties))
                         {
                             hashSet.Add(propertyDefinition);
                         }
                     }
                 }
             }
         }
         this.All = new PropertyDefinition[hashSet.Count];
         hashSet.CopyTo(this.All);
         return;
     }
     this.All = PropertyDefinitionCollection.Merge <PropertyDefinition>(otherPropertySets);
 }
Ejemplo n.º 3
0
        private T PrepareItem <T>(List <IStorePropertyBag> sources, Func <PropertyBag, T> converResultItem)
        {
            this.aggregationExtension.BeforeAggregation(sources);
            PropertyAggregationContext propertyAggregationContext = this.aggregationExtension.GetPropertyAggregationContext(sources);
            PropertyBag arg = ApplicationAggregatedProperty.AggregateAsPropertyBag(propertyAggregationContext, this.originalProperties);

            return(converResultItem(arg));
        }
Ejemplo n.º 4
0
        internal static PropertyBag AggregateAsPropertyBag(PropertyAggregationContext context, IEnumerable <PropertyDefinition> properties)
        {
            MemoryPropertyBag memoryPropertyBag = new MemoryPropertyBag();

            foreach (PropertyDefinition propertyDefinition in properties)
            {
                ApplicationAggregatedProperty applicationAggregatedProperty = propertyDefinition as ApplicationAggregatedProperty;
                if (applicationAggregatedProperty != null)
                {
                    applicationAggregatedProperty.Aggregate(context, memoryPropertyBag);
                }
            }
            memoryPropertyBag.SetAllPropertiesLoaded();
            return(memoryPropertyBag);
        }
            public override QueryFilter NativeFilterToSmartFilter(QueryFilter filter, ApplicationAggregatedProperty aggregatedProperty)
            {
                SinglePropertyFilter singlePropertyFilter = filter as SinglePropertyFilter;

                if (singlePropertyFilter != null && singlePropertyFilter.Property.Equals(this.property))
                {
                    return(singlePropertyFilter.CloneWithAnotherProperty(aggregatedProperty));
                }
                return(base.NativeFilterToSmartFilter(filter, aggregatedProperty));
            }
 public virtual QueryFilter SmartFilterToNativeFilter(SinglePropertyFilter filter, ApplicationAggregatedProperty aggregatedProperty)
 {
     return(null);
 }
            public override QueryFilter SmartFilterToNativeFilter(SinglePropertyFilter filter, ApplicationAggregatedProperty aggregatedProperty)
            {
                ComparisonFilter comparisonFilter = filter as ComparisonFilter;

                if (comparisonFilter == null || !comparisonFilter.Property.Equals(PersonSchema.PersonType) || comparisonFilter.ComparisonOperator != ComparisonOperator.Equal)
                {
                    return(base.SmartFilterToNativeFilter(filter, aggregatedProperty));
                }
                string text;

                switch ((PersonType)comparisonFilter.PropertyValue)
                {
                case Microsoft.Exchange.Data.PersonType.Person:
                    text = "IPM.Contact";
                    break;

                case Microsoft.Exchange.Data.PersonType.DistributionList:
                    text = "IPM.DistList";
                    break;

                default:
                    return(base.SmartFilterToNativeFilter(filter, aggregatedProperty));
                }
                return(new OrFilter(new QueryFilter[]
                {
                    new ComparisonFilter(ComparisonOperator.Equal, AggregatedContactSchema.MessageClass, text),
                    new TextFilter(AggregatedContactSchema.MessageClass, text + ".", MatchOptions.Prefix, MatchFlags.IgnoreCase)
                }));
            }
 public override QueryFilter SmartFilterToNativeFilter(SinglePropertyFilter filter, ApplicationAggregatedProperty aggregatedProperty)
 {
     if (filter != null && filter.Property.Equals(aggregatedProperty))
     {
         return(filter.CloneWithAnotherProperty(this.property));
     }
     return(base.SmartFilterToNativeFilter(filter, aggregatedProperty));
 }
Ejemplo n.º 9
0
 public static IStorePropertyBag Aggregate(PropertyAggregationContext context, IEnumerable <PropertyDefinition> properties)
 {
     return(ApplicationAggregatedProperty.AggregateAsPropertyBag(context, properties).AsIStorePropertyBag());
 }
Ejemplo n.º 10
0
 public ApplicationAggregatedProperty(ApplicationAggregatedProperty basePropertyDefinition, PropertyAggregationStrategy propertyAggregationStrategy) : this(basePropertyDefinition.Name, basePropertyDefinition.Type, basePropertyDefinition.PropertyFlags, propertyAggregationStrategy, basePropertyDefinition.sortByAndFilterStrategy, basePropertyDefinition.aggregatedProperty)
 {
 }