internal static GccType ConvertJournalRuleTypeToGccType(JournalRuleType journalRuleType)
        {
            switch (journalRuleType)
            {
            case JournalRuleType.Prtt:
                return(GccType.Prtt);

            case JournalRuleType.Full:
                return(GccType.Full);
            }
            return(GccType.None);
        }
        internal void Deserialize(JournalingRule rule)
        {
            base.Name = rule.Name;
            this.ReadAction(rule);
            this.enabled    = (rule.Enabled == RuleState.Enabled);
            this.ExpiryDate = rule.ExpiryDate;
            this.RuleType   = JournalRuleObject.ConvertGccTypeToJournalRuleType(rule.GccRuleType);
            this.Recipient  = null;
            this.Scope      = JournalRuleScope.Global;
            if (rule.Condition.ConditionType == ConditionType.True)
            {
                return;
            }
            if (this.TryReadScopeCondition(rule.Condition))
            {
                return;
            }
            if (this.TryReadRecipientCondition(rule.Condition))
            {
                return;
            }
            if (rule.Condition.ConditionType != ConditionType.And)
            {
                throw new JournalRuleCorruptException();
            }
            List <Microsoft.Exchange.MessagingPolicies.Rules.Condition> subConditions = ((AndCondition)rule.Condition).SubConditions;

            if (subConditions.Count != 2)
            {
                throw new JournalRuleCorruptException();
            }
            foreach (Microsoft.Exchange.MessagingPolicies.Rules.Condition condition in subConditions)
            {
                if (!this.TryReadScopeCondition(condition) && !this.TryReadRecipientCondition(condition))
                {
                    throw new JournalRuleCorruptException();
                }
            }
        }