Ejemplo n.º 1
0
        private void Initialize()
        {
            base.Load(new PropertyDefinition[]
            {
                InternalSchema.ItemClass
            });
            string text = base.TryGetProperty(InternalSchema.ItemClass) as string;

            if (!ObjectClass.IsDistributionList(text))
            {
                if (!string.IsNullOrEmpty(text))
                {
                    ExTraceGlobals.StorageTracer.TraceWarning <string, string>(0L, "DistributionList::Initialize. Overwriting ItemClass from \"{0}\" to \"{1}\".", text, "IPM.DistList");
                }
                this[InternalSchema.ItemClass] = "IPM.DistList";
            }
        }
Ejemplo n.º 2
0
            protected override object[][] TransformRow(object[] unfilteredRow)
            {
                this.unfilteredPropertyBag.SetQueryResultRow(unfilteredRow);
                List <Participant> list           = new List <Participant>();
                string             valueOrDefault = this.unfilteredPropertyBag.GetValueOrDefault <string>(InternalSchema.ItemClass);

                if (ObjectClass.IsDistributionList(valueOrDefault))
                {
                    list.Add(Microsoft.Exchange.Data.Storage.PropertyBag.CheckPropertyValue <Participant>(InternalSchema.DistributionListParticipant, base.PropertySets.TryGetProperty(unfilteredRow, InternalSchema.DistributionListParticipant), null));
                }
                else if (ObjectClass.IsContact(valueOrDefault))
                {
                    foreach (ContactEmailSlotParticipantProperty contactEmailSlotParticipantProperty in ContactEmailSlotParticipantProperty.AllInstances.Values)
                    {
                        list.Add(Microsoft.Exchange.Data.Storage.PropertyBag.CheckPropertyValue <Participant>(contactEmailSlotParticipantProperty, base.PropertySets.TryGetProperty(unfilteredRow, contactEmailSlotParticipantProperty), null));
                    }
                }
                List <object[]> list2 = new List <object[]>();

                foreach (Participant participant in list)
                {
                    if (!(participant == null) && !(participant.IsRoutable(this.contacts.Session) == false))
                    {
                        object[] array = (object[])unfilteredRow.Clone();
                        foreach (ContactEmailSlotParticipantProperty contactEmailSlotParticipantProperty2 in ContactEmailSlotParticipantProperty.AllInstances.Values)
                        {
                            base.PropertySets.DeleteProperty(array, contactEmailSlotParticipantProperty2);
                            foreach (NativeStorePropertyDefinition propertyDefinition in contactEmailSlotParticipantProperty2.EmailSlotProperties)
                            {
                                base.PropertySets.DeleteProperty(array, propertyDefinition);
                            }
                        }
                        base.PropertySets.SetProperty(array, InternalSchema.AnrViewParticipant, participant);
                        base.PropertySets.SetProperty(array, ParticipantSchema.DisplayName, participant.DisplayName);
                        base.PropertySets.SetProperty(array, ParticipantSchema.EmailAddress, participant.EmailAddress);
                        base.PropertySets.SetProperty(array, ParticipantSchema.RoutingType, participant.RoutingType);
                        this.unfilteredPropertyBag.SetQueryResultRow(array);
                        if (this.filterCriteria(this.unfilteredPropertyBag))
                        {
                            list2.Add(array);
                        }
                    }
                }
                return(list2.ToArray());
            }
Ejemplo n.º 3
0
        public bool UpdateProperties(ICorePropertyBag propertyBag)
        {
            string valueOrDefault = propertyBag.GetValueOrDefault <string>(StoreObjectSchema.ItemClass, null);

            if (string.IsNullOrEmpty(valueOrDefault))
            {
                return(false);
            }
            if (!ObjectClass.IsContact(valueOrDefault) && !ObjectClass.IsDistributionList(valueOrDefault))
            {
                return(false);
            }
            bool valueOrDefault2 = propertyBag.GetValueOrDefault <bool>(InternalSchema.ConversationIndexTracking, false);

            if (valueOrDefault2)
            {
                return(false);
            }
            propertyBag[InternalSchema.ConversationIndexTracking] = true;
            return(true);
        }
Ejemplo n.º 4
0
        public bool SkipItemOperation(COWSettings settings, IDumpsterItemOperations dumpster, COWTriggerAction operation, COWTriggerActionState state, StoreSession session, StoreObjectId itemId, CoreItem item, bool onBeforeNotification, bool onDumpster, bool success, CallbackContext callbackContext)
        {
            if (!COWContactLogging.COWContactLoggingConfiguration.Instance.IsLoggingEnabled())
            {
                return(true);
            }
            Util.ThrowOnNullArgument(session, "session");
            EnumValidator.ThrowIfInvalid <COWTriggerAction>(operation, "operation");
            EnumValidator.ThrowIfInvalid <COWTriggerActionState>(state, "state");
            if (item == null)
            {
                COWContactLogging.Tracer.TraceDebug((long)this.GetHashCode(), "COWContactLogging.SkipItemOperation: Item is null");
                return(true);
            }
            if (!onBeforeNotification)
            {
                COWContactLogging.Tracer.TraceDebug((long)this.GetHashCode(), "COWContactLogging.SkipItemOperation: Not onBeforeNotification");
                return(true);
            }
            string valueOrDefault = item.PropertyBag.GetValueOrDefault <string>(StoreObjectSchema.ItemClass, string.Empty);

            COWContactLogging.Tracer.TraceDebug <string>((long)this.GetHashCode(), "COWContactLogging.SkipItemOperation: ItemClass: {0}", valueOrDefault);
            if (ObjectClass.IsPlace(valueOrDefault))
            {
                return(true);
            }
            if (!ObjectClass.IsContact(valueOrDefault) && !ObjectClass.IsDistributionList(valueOrDefault) && !ObjectClass.IsContactsFolder(valueOrDefault))
            {
                return(true);
            }
            foreach (IContactChangeTracker contactChangeTracker in COWContactLogging.ChangeTrackers)
            {
                if (contactChangeTracker.ShouldLoadPropertiesForFurtherCheck(operation, valueOrDefault, itemId, item))
                {
                    COWContactLogging.Tracer.TraceDebug((long)this.GetHashCode(), "COWContactLogging.SkipItemOperation: A tracker interested.");
                    return(false);
                }
            }
            return(true);
        }
Ejemplo n.º 5
0
        protected override object InternalTryGetValue(PropertyBag.BasicPropertyStore propertyBag)
        {
            object obj = PersonTypeProperty.ExceptionHandlingGetValueOrDefault <object>(propertyBag, InternalSchema.InternalPersonType, null);

            if (obj is int)
            {
                return((PersonType)obj);
            }
            bool flag = PersonTypeProperty.ExceptionHandlingGetValueOrDefault <bool>(propertyBag, InternalSchema.IsDistributionListContact, false);

            if (flag)
            {
                return(PersonType.DistributionList);
            }
            string itemClass = PersonTypeProperty.ExceptionHandlingGetValueOrDefault <string>(propertyBag, InternalSchema.ItemClass, string.Empty);

            if (ObjectClass.IsDistributionList(itemClass))
            {
                return(PersonType.DistributionList);
            }
            return(new PropertyError(this, PropertyErrorCode.NotFound));
        }
Ejemplo n.º 6
0
 public void MoveNext()
 {
     this.CheckDisposed("MoveNext");
     for (;;)
     {
         this.currentRow++;
         if (this.rows == null || this.currentRow >= this.rows.Length)
         {
             this.currentRow = 0;
             this.rows       = this.query.GetPropertyBags(this.chunkSize);
             if (this.rows.Length == 0)
             {
                 break;
             }
             this.chunkSize = Math.Min(this.chunkSize * 2, 1000);
         }
         IStorePropertyBag storePropertyBag = this.Current;
         object            obj = storePropertyBag.TryGetProperty(StoreObjectSchema.ItemClass);
         if (storePropertyBag != null && !(storePropertyBag.TryGetProperty(ItemSchema.Id) is PropertyError) && !(obj is PropertyError) && (ObjectClass.IsContact((string)obj) || ObjectClass.IsDistributionList((string)obj)))
         {
             return;
         }
         AllContactsCursor.Tracer.TraceDebug(0L, "AllContactsCursor.MoveNext: Skipping bogus contact");
     }
     this.rows = null;
 }
Ejemplo n.º 7
0
 private static OutlookModule GetModuleForObjectClass(string objectClass)
 {
     if (objectClass == null)
     {
         return(OutlookModule.None);
     }
     if (ObjectClass.IsCalendarFolder(objectClass) || ObjectClass.IsCalendarItem(objectClass))
     {
         return(OutlookModule.Calendar);
     }
     if (ObjectClass.IsContactsFolder(objectClass) || ObjectClass.IsContact(objectClass) || ObjectClass.IsDistributionList(objectClass))
     {
         return(OutlookModule.Contacts);
     }
     if (ObjectClass.IsJournalFolder(objectClass) || ObjectClass.IsJournalItem(objectClass))
     {
         return(OutlookModule.Journal);
     }
     if (ObjectClass.IsNotesFolder(objectClass) || ObjectClass.IsNotesItem(objectClass))
     {
         return(OutlookModule.Notes);
     }
     if (ObjectClass.IsTaskFolder(objectClass) || ObjectClass.IsTask(objectClass))
     {
         return(OutlookModule.Tasks);
     }
     if (ObjectClass.IsMessageFolder(objectClass) || ObjectClass.IsMessage(objectClass, false) || ObjectClass.IsMeetingMessage(objectClass) || ObjectClass.IsTaskRequest(objectClass) || ObjectClass.IsReport(objectClass))
     {
         return(OutlookModule.Mail);
     }
     return(OutlookModule.None);
 }