public static DelegateRuleType GetDelegateRuleType(MessageItem localFBMessage) { DelegateRuleType delegateRuleType = DelegateRuleType.ForwardAndDelete; bool valueOrDefault = localFBMessage.GetValueOrDefault <bool>(InternalSchema.DelegateDontMail); if (valueOrDefault) { delegateRuleType = DelegateRuleType.NoForward; } else { bool valueOrDefault2 = localFBMessage.GetValueOrDefault <bool>(InternalSchema.DelegateBossWantsCopy); bool valueOrDefault3 = localFBMessage.GetValueOrDefault <bool>(InternalSchema.DelegateBossWantsInfo); if (valueOrDefault2 && !valueOrDefault3) { delegateRuleType = DelegateRuleType.Forward; } else if (valueOrDefault2 && valueOrDefault3) { delegateRuleType = DelegateRuleType.ForwardAndSetAsInformationalUpdate; } else if (!valueOrDefault2) { delegateRuleType = DelegateRuleType.ForwardAndDelete; } } ExTraceGlobals.CalendarLoggingTracer.TraceDebug <DelegateRuleType>(0L, "FreeBusyUtil::GetDelegateRuleType. Returned DelegateRuleType: {0}", delegateRuleType); return(delegateRuleType); }
public static DelegateRuleType GetDelegateRuleType(MailboxSession session) { DelegateRuleType result = DelegateRuleType.ForwardAndDelete; FolderSaveResult folderSaveResult; byte[] freeBusyMsgId = FreeBusyUtil.GetFreeBusyMsgId(session, out folderSaveResult); if (freeBusyMsgId != null && freeBusyMsgId.Length > 0) { try { using (MessageItem messageItem = MessageItem.Bind(session, StoreObjectId.FromProviderSpecificId(freeBusyMsgId), FreeBusyUtil.FreeBusyMessageProperties)) { result = FreeBusyUtil.GetDelegateRuleType(messageItem); } } catch (ObjectNotFoundException) { ExTraceGlobals.CalendarLoggingTracer.TraceDebug((long)session.GetHashCode(), "FreeBusyUtil::GetDelegateRuleType. No FreeBusyMessage"); } } return(result); }