public virtual PushNotificationSubscriptionOption ReadSubscriptionOnMailboxTable(IMailboxSession session)
        {
            session.Mailbox.Load(new PropertyDefinition[]
            {
                MailboxSchema.PushNotificationSubscriptionType
            });
            object obj = session.Mailbox.TryGetProperty(MailboxSchema.PushNotificationSubscriptionType);

            byte[] array = obj as byte[];
            if (!(obj is PropertyError) && !PushNotificationSubscriptionTableEntry.IsSubscriptionDisabled(array))
            {
                return((PushNotificationSubscriptionOption)array[0]);
            }
            return(PushNotificationSubscriptionOption.NoSubscription);
        }
 public static bool IsSubscriptionDisabled(byte[] subscriptionOption)
 {
     return(subscriptionOption == null || subscriptionOption.Length == 0 || PushNotificationSubscriptionTableEntry.IsSubscriptionDisabled((PushNotificationSubscriptionOption)subscriptionOption[0]));
 }