예제 #1
0
 public override void ProcessPolicyParams(ActiveSyncMailboxPolicyObject originalPolicy)
 {
     if (originalPolicy == null)
     {
         throw new ArgumentNullException("originalPolicy");
     }
     base.ProcessPolicyParams(originalPolicy);
 }
예제 #2
0
        public virtual void ProcessPolicyParams(ActiveSyncMailboxPolicyObject originalPolicy)
        {
            bool   flag  = originalPolicy == null;
            bool   flag2 = this.DevicePasswordEnabled ?? (!flag && originalPolicy.DevicePasswordEnabled);
            object value;

            if (this.CheckAndParseParams <EnhancedTimeSpan>(true, this.IsDevicePolicyRefreshIntervalSet, flag ? null : new bool?(originalPolicy.IsDevicePolicyRefreshIntervalSet), this.DevicePolicyRefreshInterval, (string x) => EnhancedTimeSpan.FromHours(double.Parse(x)), out value))
            {
                base["DevicePolicyRefreshInterval"] = value;
            }
            if (this.CheckAndParseParams <int>(true, this.IsMaxEmailBodyTruncationSizeSet, flag ? null : new bool?(originalPolicy.IsMaxEmailBodyTruncationSizeSet), this.MaxEmailBodyTruncationSize, (string x) => int.Parse(x), out value))
            {
                base["MaxEmailBodyTruncationSize"] = value;
            }
            if (this.CheckAndParseParams <ByteQuantifiedSize>(true, this.IsMaxAttachmentSizeSet, flag ? null : new bool?(originalPolicy.IsMaxAttachmentSizeSet), this.MaxAttachmentSize, (string x) => ByteQuantifiedSize.FromKB(ulong.Parse(x)), out value))
            {
                base["MaxAttachmentSize"] = value;
            }
            if (flag2)
            {
                if (this.AlphanumericDevicePasswordRequired == true || (!flag && this.AlphanumericDevicePasswordRequired == null && originalPolicy.AlphanumericDevicePasswordRequired))
                {
                    int?minDevicePasswordComplexCharacters = this.MinDevicePasswordComplexCharacters;
                    int?num = (minDevicePasswordComplexCharacters != null) ? new int?(minDevicePasswordComplexCharacters.GetValueOrDefault()) : ((flag || originalPolicy.AlphanumericDevicePasswordRequired) ? this.MinDevicePasswordComplexCharacters : new int?(3));
                    if (num != null)
                    {
                        base["MinDevicePasswordComplexCharacters"] = num;
                    }
                }
                if (this.CheckAndParseParams <int>(false, this.IsMinDevicePasswordLengthSet, flag ? null : new bool?(originalPolicy.IsMinDevicePasswordLengthSet), this.MinDevicePasswordLength ?? ((flag || originalPolicy.IsMinDevicePasswordLengthSet) ? this.MinDevicePasswordLength : "4"), (string x) => int.Parse(x), out value))
                {
                    base["MinDevicePasswordLength"] = value;
                }
                if (this.CheckAndParseParams <int>(false, this.IsMinDevicePasswordLengthSet, flag ? null : new bool?(originalPolicy.IsMinDevicePasswordLengthSet), this.MinDevicePasswordLength ?? ((flag || originalPolicy.IsMinDevicePasswordLengthSet) ? this.MinDevicePasswordLength : "4"), (string x) => int.Parse(x), out value))
                {
                    base["MinDevicePasswordLength"] = value;
                }
                if (this.CheckAndParseParams <int>(true, this.IsMaxDevicePasswordFailedAttemptsSet, flag ? null : new bool?(originalPolicy.IsMaxDevicePasswordFailedAttemptsSet), this.MaxDevicePasswordFailedAttempts ?? ((flag || originalPolicy.IsMaxDevicePasswordFailedAttemptsSet) ? this.MaxDevicePasswordFailedAttempts : "8"), (string x) => int.Parse(x), out value))
                {
                    base["MaxDevicePasswordFailedAttempts"] = value;
                }
                if (this.CheckAndParseParams <EnhancedTimeSpan>(true, this.IsDevicePasswordExpirationSet, flag ? null : new bool?(originalPolicy.IsDevicePasswordExpirationSet), this.DevicePasswordExpiration ?? ((flag || originalPolicy.IsDevicePasswordExpirationSet) ? this.DevicePasswordExpiration : "90"), (string x) => EnhancedTimeSpan.FromDays(double.Parse(x)), out value))
                {
                    base["DevicePasswordExpiration"] = value;
                }
                if (this.CheckAndParseParams <EnhancedTimeSpan>(true, this.IsMaxInactivityTimeDeviceLockSet, flag ? null : new bool?(originalPolicy.IsMaxInactivityTimeDeviceLockSet), this.MaxInactivityTimeDeviceLock ?? ((flag || originalPolicy.IsMaxInactivityTimeDeviceLockSet) ? this.MaxInactivityTimeDeviceLock : "15"), (string x) => EnhancedTimeSpan.FromMinutes(double.Parse(x)), out value))
                {
                    base["MaxInactivityTimeDeviceLock"] = value;
                }
                if (this.RequireDeviceEncryption != null)
                {
                    base["RequireDeviceEncryption"] = this.RequireDeviceEncryption;
                }
                if (this.RequireStorageCardEncryption != null)
                {
                    base["RequireStorageCardEncryption"] = this.RequireStorageCardEncryption;
                }
                if (this.AllowSimpleDevicePassword != null)
                {
                    base["AllowSimpleDevicePassword"] = this.AllowSimpleDevicePassword;
                }
                if (this.AlphanumericDevicePasswordRequired != null)
                {
                    base["AlphanumericDevicePasswordRequired"] = this.AlphanumericDevicePasswordRequired;
                }
                if (this.PasswordRecoveryEnabled != null)
                {
                    base["PasswordRecoveryEnabled"] = this.PasswordRecoveryEnabled;
                }
                if (this.DevicePasswordHistory != null)
                {
                    base["DevicePasswordHistory"] = this.DevicePasswordHistory;
                }
            }
        }