internal JournalRuleObject(string name, bool enabled, SmtpAddress?recipient, SmtpAddress journalEmailAddress, JournalRuleScope ruleScope, DateTime?expiryDate, GccType gccRuleType)
 {
     base.Name                = name;
     this.enabled             = enabled;
     this.recipient           = recipient;
     this.ruleScope           = ruleScope;
     this.journalEmailAddress = journalEmailAddress;
     this.expiryDate          = expiryDate;
     this.ruleType            = JournalRuleObject.ConvertGccTypeToJournalRuleType(gccRuleType);
 }
        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();
                }
            }
        }