コード例 #1
0
 public static bool IsActivityLoggingEnabled(bool forceRefresh = false)
 {
     if (ActivityLogHelper.isActivityLoggingEnabled == null || forceRefresh)
     {
         bool?activityLoggingRegkeyOverride = ActivityLogHelper.GetActivityLoggingRegkeyOverride();
         if (activityLoggingRegkeyOverride != null)
         {
             ActivityLogHelper.isActivityLoggingEnabled = new bool?(activityLoggingRegkeyOverride.Value);
         }
         else
         {
             ActivityLogHelper.isActivityLoggingEnabled = new bool?(VariantConfiguration.InvariantNoFlightingSnapshot.Inference.ActivityLogging.Enabled);
         }
     }
     return(ActivityLogHelper.isActivityLoggingEnabled.Value);
 }
コード例 #2
0
 public static IEnumerable <Activity> FixupItemIds(IEnumerable <Activity> activities)
 {
     return(ActivityLogHelper.FixupItemIds(activities, false));
 }
コード例 #3
0
        internal static IDictionary <string, string> ExtractDeliveryDetails(StoreSession session, Item item)
        {
            IDictionary <string, string> customProperties = null;

            ActivityLogHelper.CatchNonFatalExceptions(delegate
            {
                MessageItem messageItem = item as MessageItem;
                if (messageItem == null)
                {
                    return;
                }
                bool flag    = false;
                bool flag2   = false;
                string value = null;
                ConversationId conversationId = null;
                string value2 = null;
                bool?flag3    = null;
                if (((IDirectPropertyBag)messageItem.PropertyBag).IsLoaded(InternalSchema.InferenceClassificationResult))
                {
                    InferenceClassificationResult?valueAsNullable = messageItem.GetValueAsNullable <InferenceClassificationResult>(InternalSchema.InferenceClassificationResult);
                    flag3 = new bool?(valueAsNullable != null && valueAsNullable.Value.HasFlag(InferenceClassificationResult.IsClutterFinal));
                }
                string value3 = string.Empty;
                if (flag3 != null)
                {
                    value3 = (flag3.Value ? bool.TrueString : bool.FalseString);
                }
                bool?flag4    = new bool?(messageItem.IsGroupEscalationMessage);
                string value4 = string.Empty;
                if (flag4 != null)
                {
                    value4 = (flag4.Value ? bool.TrueString : bool.FalseString);
                }
                StoreObjectId parentId = messageItem.ParentId;
                DefaultFolderType defaultFolderType = DefaultFolderType.None;
                bool flag5 = false;
                if (parentId != null)
                {
                    StoreObjectId defaultFolderId = session.GetDefaultFolderId(DefaultFolderType.Inbox);
                    flag = parentId.Equals(defaultFolderId);
                    StoreObjectId defaultFolderId2 = session.GetDefaultFolderId(DefaultFolderType.Clutter);
                    flag2 = (defaultFolderId2 != null && parentId.Equals(defaultFolderId2));
                    MailboxSession mailboxSession = session as MailboxSession;
                    if (mailboxSession != null)
                    {
                        defaultFolderType = mailboxSession.IsDefaultFolderType(parentId);
                        flag5             = true;
                    }
                }
                value = messageItem.InternetMessageId;
                ConversationIndex index;
                if (ConversationIndex.TryCreate(messageItem.ConversationIndex, out index))
                {
                    conversationId = ConversationId.Create(index);
                }
                string value5 = string.Empty;
                if (((IDirectPropertyBag)messageItem.PropertyBag).IsLoaded(InternalSchema.InferenceMessageIdentifier))
                {
                    value5 = messageItem.GetValueAsNullable <Guid>(InternalSchema.InferenceMessageIdentifier).ToString();
                }
                if (messageItem.Sender != null)
                {
                    value2 = messageItem.Sender.SmtpEmailAddress;
                }
                List <string> list  = null;
                List <string> list2 = null;
                foreach (Recipient recipient in messageItem.Recipients)
                {
                    if (recipient.Participant != null)
                    {
                        if (recipient.IsDistributionList() == true)
                        {
                            if (list == null)
                            {
                                list = new List <string>(2);
                            }
                            list.Add(recipient.SmtpAddress());
                        }
                        else if (recipient.IsGroupMailbox() == true)
                        {
                            if (list2 == null)
                            {
                                list2 = new List <string>(2);
                            }
                            list2.Add(recipient.SmtpAddress());
                        }
                    }
                }
                Dictionary <string, string> dictionary = new Dictionary <string, string>
                {
                    {
                        "IsClutter",
                        value3
                    },
                    {
                        "DeliveredToInbox",
                        flag ? bool.TrueString : bool.FalseString
                    },
                    {
                        "DeliveredToClutter",
                        flag2 ? bool.TrueString : bool.FalseString
                    },
                    {
                        "IsGroupEscalationMessage",
                        value4
                    },
                    {
                        "InternetMessageId",
                        value
                    },
                    {
                        "ConversationId",
                        (conversationId == null) ? string.Empty : conversationId.ToString()
                    },
                    {
                        "MessageGuid",
                        value5
                    },
                    {
                        "SenderSmtpAddress",
                        value2
                    }
                };
                if (list != null && list.Count > 0)
                {
                    dictionary.Add("DLRecipients", string.Join(";", list));
                }
                if (list2 != null)
                {
                    dictionary.Add("GMRecipients", string.Join(";", list2));
                }
                if (flag5)
                {
                    Dictionary <string, string> dictionary2 = dictionary;
                    string key = "DeliveredFolderType";
                    int num    = (int)defaultFolderType;
                    dictionary2.Add(key, num.ToString());
                    if (defaultFolderType == DefaultFolderType.None && parentId != null)
                    {
                        dictionary.Add("DeliveredFolderId", parentId.ToString());
                    }
                }
                customProperties = dictionary;
            }, null);
            return(customProperties);
        }