Ejemplo n.º 1
0
        private static bool HasTimerFired(ReliableTimer.Feature feature, IItem item)
        {
            StorePropertyDefinition storePropertyDefinition = ReliableTimer.featureToStorePropertyMapping[feature];

            item.Load(new List <PropertyDefinition>
            {
                storePropertyDefinition
            });
            object obj = item.TryGetProperty(storePropertyDefinition);

            if (PropertyError.IsPropertyNotFound(obj))
            {
                ExTraceGlobals.ReliableTimerTracer.TraceDebug <ReliableTimer.Feature>(0L, "Timer not set for feature={0}", feature);
                return(false);
            }
            if (PropertyError.IsPropertyError(obj))
            {
                PropertyError propertyError = (PropertyError)obj;
                ExTraceGlobals.ReliableTimerTracer.TraceError <ReliableTimer.Feature, PropertyErrorCode>(0L, "Property error for feature={0}, propertyErrorCode={1}", feature, propertyError.PropertyErrorCode);
                throw PropertyError.ToException(new PropertyError[]
                {
                    propertyError
                });
            }
            ExDateTime exDateTime = (ExDateTime)obj;

            ExTraceGlobals.ReliableTimerTracer.TraceDebug <ReliableTimer.Feature, ExDateTime>(0L, "Timer value for feature={0}, timerValue={1}", feature, exDateTime);
            return(exDateTime == ReliableTimer.FiredTimerPropertyValue);
        }
Ejemplo n.º 2
0
        internal static IEnumerable <StoreObjectId> GetSubfolders(IDiagnosticsSession tracer, Folder parentFolder, QueryFilter filter)
        {
            XsoUtil.< > c__DisplayClass6 CS$ < > 8__locals1 = new XsoUtil.< > c__DisplayClass6();
            CS$ < > 8__locals1.parentFolder = parentFolder;
            CS$ < > 8__locals1.filter       = filter;
            Util.ThrowOnNullArgument(CS$ < > 8__locals1.parentFolder, "parentFolder");
            Guid mailboxGuid = CS$ < > 8__locals1.parentFolder.Session.MailboxGuid;

            using (QueryResult queryResult = XsoUtil.TranslateXsoExceptionsWithReturnValue <QueryResult>(tracer, Strings.ConnectionToMailboxFailed(mailboxGuid), () => CS$ < > 8__locals1.parentFolder.FolderQuery(FolderQueryFlags.DeepTraversal, CS$ < > 8__locals1.filter, null, new PropertyDefinition[]
            {
                FolderSchema.Id
            })))
            {
                for (;;)
                {
                    object[][] folders = XsoUtil.TranslateXsoExceptionsWithReturnValue <object[][]>(tracer, Strings.ConnectionToMailboxFailed(mailboxGuid), () => queryResult.GetRows(10000));
                    if (folders == null || folders.Length == 0)
                    {
                        break;
                    }
                    foreach (object[] folderProps in folders)
                    {
                        if (folderProps[0] != null && !PropertyError.IsPropertyError(folderProps[0]))
                        {
                            yield return(StoreId.GetStoreObjectId((StoreId)folderProps[0]));
                        }
                    }
                }
            }
            yield break;
        }
 // Token: 0x06000604 RID: 1540 RVA: 0x0002E2C8 File Offset: 0x0002C4C8
 private bool AreItemsLegallyEqual(ICollection <PropertyDefinition> legalTrackingProperties, Item originalItem, Item currentItem)
 {
     using (IEnumerator <PropertyDefinition> enumerator = legalTrackingProperties.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             PropertyDefinition legalTrackingProperty = enumerator.Current;
             object             value  = originalItem.GetValue(legalTrackingProperty);
             object             value2 = currentItem.GetValue(legalTrackingProperty);
             if (value != null && value2 != null)
             {
                 if (!PropertyError.IsPropertyNotFound(value) || !PropertyError.IsPropertyNotFound(value2))
                 {
                     if (PropertyError.IsPropertyValueTooBig(value) && PropertyError.IsPropertyValueTooBig(value2))
                     {
                         if (!this.CompareStreams(() => originalItem.GetStream(legalTrackingProperty), () => currentItem.GetStream(legalTrackingProperty)))
                         {
                             this.LogDirtyProperty(currentItem.Id, originalItem.Id, originalItem.ClassName, legalTrackingProperty);
                             return(false);
                         }
                     }
                     else if (!PropertyError.IsPropertyError(value) && !PropertyError.IsPropertyError(value2))
                     {
                         if (legalTrackingProperty.Type.IsArray)
                         {
                             if (!((Array)value).Compare((Array)value2))
                             {
                                 this.LogDirtyProperty(currentItem.Id, originalItem.Id, originalItem.ClassName, legalTrackingProperty);
                                 return(false);
                             }
                         }
                         else if (!value.Equals(value2))
                         {
                             this.LogDirtyProperty(currentItem.Id, originalItem.Id, originalItem.ClassName, legalTrackingProperty);
                             return(false);
                         }
                     }
                 }
             }
             else if (value != null || value2 != null)
             {
                 this.LogDirtyProperty(currentItem.Id, originalItem.Id, originalItem.ClassName, legalTrackingProperty);
                 return(false);
             }
         }
     }
     if (originalItem is MessageItem && !this.CompareRecipients(((MessageItem)originalItem).Recipients, ((MessageItem)currentItem).Recipients))
     {
         this.LogDirtyProperty(currentItem.Id, originalItem.Id, originalItem.ClassName, "Recipients");
         return(false);
     }
     if (!this.CompareAttachments(originalItem.AttachmentCollection, currentItem.AttachmentCollection))
     {
         this.LogDirtyProperty(currentItem.Id, originalItem.Id, originalItem.ClassName, "Attachments");
         return(false);
     }
     return(true);
 }
        public AnnotatedPropertyValue GetAnnotatedProperty(PropertyTag propertyTag)
        {
            if (propertyTag == PropertyTag.Mid)
            {
                return(new AnnotatedPropertyValue(propertyTag, new PropertyValue(propertyTag, 0L), null));
            }
            object        obj           = this.propertyBag.TryGetProperty(ActivityPropertyBagAdapter.PropDefFromPropTag(propertyTag));
            PropertyValue propertyValue = PropertyError.IsPropertyError(obj) ? PropertyValue.Error(propertyTag.PropertyId, (ErrorCode)2147746063U) : new PropertyValue(propertyTag, obj);

            return(new AnnotatedPropertyValue(propertyTag, propertyValue, null));
        }
 public IEnumerable <AnnotatedPropertyValue> GetAnnotatedProperties()
 {
     foreach (KeyValuePair <PropertyDefinition, object> prop in ((IEnumerable <KeyValuePair <PropertyDefinition, object> >) this.propertyBag))
     {
         KeyValuePair <PropertyDefinition, object> keyValuePair = prop;
         if (!PropertyError.IsPropertyError(keyValuePair.Value))
         {
             KeyValuePair <PropertyDefinition, object> keyValuePair2 = prop;
             PropertyTag propertyTag  = new PropertyTag(((PropertyTagPropertyDefinition)keyValuePair2.Key).PropertyTag);
             PropertyTag propertyTag2 = propertyTag;
             PropertyTag propertyTag3 = propertyTag;
             KeyValuePair <PropertyDefinition, object> keyValuePair3 = prop;
             yield return(new AnnotatedPropertyValue(propertyTag2, new PropertyValue(propertyTag3, keyValuePair3.Value), null));
         }
     }
     yield break;
 }
        private bool ValidateItem(string context, IStorePropertyBag item)
        {
            object obj = item[MailboxAssociationBaseSchema.LegacyDN];

            if (obj == null || PropertyError.IsPropertyError(obj) || string.IsNullOrEmpty(obj as string))
            {
                this.performanceTracker.IncrementMissingLegacyDns();
                string        arg            = item[ItemSchema.Id].ToString();
                string        valueOrDefault = item.GetValueOrDefault <string>(MailboxAssociationBaseSchema.ExternalId, "empty");
                PropertyError propertyError  = obj as PropertyError;
                string        arg2           = (propertyError == null) ? "null" : propertyError.ToString();
                string        errorMessage   = string.Format("LocalAssociationStore.QueryAssociationFolder: Missing LegacyDn for property bag with Id {0}, ExternalId {1}, PropertyError {2}", arg, valueOrDefault, arg2);
                this.LogError(context, errorMessage);
                return(false);
            }
            return(true);
        }
Ejemplo n.º 7
0
        private object GetProperty(PropertyDefinition propertyDefinition)
        {
            object obj = this.TryGetProperty(propertyDefinition);

            if (obj == null)
            {
                throw PropertyError.ToException(new PropertyError[]
                {
                    new PropertyError(propertyDefinition, PropertyErrorCode.NullValue)
                });
            }
            if (PropertyError.IsPropertyError(obj))
            {
                throw PropertyError.ToException(new PropertyError[]
                {
                    (PropertyError)obj
                });
            }
            return(obj);
        }
        private bool TryGetParticipantsFromReplyAllParticipantsProperty(IStorePropertyBag propertyBag, SmartPropertyDefinition propertyDefinition, out ParticipantTable participantTable)
        {
            participantTable = new ParticipantTable();
            object obj = propertyBag.TryGetProperty(propertyDefinition);

            if (PropertyError.IsPropertyError(obj))
            {
                return(false);
            }
            IDictionary <RecipientItemType, HashSet <string> > dictionary = (IDictionary <RecipientItemType, HashSet <string> >)obj;

            foreach (KeyValuePair <RecipientItemType, HashSet <string> > keyValuePair in dictionary)
            {
                IList <Participant> participants = new List <Participant>();
                if (!this.TryResolveParticipants(keyValuePair.Value, participants))
                {
                    return(false);
                }
                participantTable.Add(keyValuePair.Key, participants);
            }
            return(true);
        }