// Token: 0x06000F95 RID: 3989 RVA: 0x0002EBE0 File Offset: 0x0002CDE0
 protected override void FillProperty(Type type, PSObject psObject, ConfigurableObject configObject, string propertyName)
 {
     if (propertyName == "RemoveOldMeetingMessages")
     {
         configObject.propertyBag[CalendarConfigurationSchema.RemoveOldMeetingMessages] = MockObjectCreator.GetSingleProperty(psObject.Members[propertyName].Value, CalendarConfigurationSchema.RemoveOldMeetingMessages.Type);
         return;
     }
     if (propertyName == "AddNewRequestsTentatively")
     {
         configObject.propertyBag[CalendarConfigurationSchema.AddNewRequestsTentatively] = MockObjectCreator.GetSingleProperty(psObject.Members[propertyName].Value, CalendarConfigurationSchema.AddNewRequestsTentatively.Type);
         return;
     }
     if (propertyName == "ProcessExternalMeetingMessages")
     {
         configObject.propertyBag[CalendarConfigurationSchema.ProcessExternalMeetingMessages] = MockObjectCreator.GetSingleProperty(psObject.Members[propertyName].Value, CalendarConfigurationSchema.ProcessExternalMeetingMessages.Type);
         return;
     }
     base.FillProperty(type, psObject, configObject, propertyName);
 }
 protected override void FillProperty(Type type, PSObject psObject, ConfigurableObject configObject, string propertyName)
 {
     if (propertyName == "DisplaySenderName")
     {
         configObject.propertyBag[DomainContentConfigSchema.DisplaySenderName] = MockObjectCreator.GetPropertyBasedOnDefinition(DomainContentConfigSchema.DisplaySenderName, psObject.Members[propertyName].Value);
     }
     base.FillProperty(type, psObject, configObject, propertyName);
 }
Пример #3
0
 protected override void FillProperty(Type type, PSObject psObject, ConfigurableObject configObject, string propertyName)
 {
     if (propertyName == "RequireSenderAuthenticationEnabled")
     {
         configObject.propertyBag[MailEnabledRecipientSchema.RequireSenderAuthenticationEnabled] = MockObjectCreator.GetSingleProperty(psObject.Members[propertyName].Value, MailEnabledRecipientSchema.RequireSenderAuthenticationEnabled.Type);
         return;
     }
     base.FillProperty(type, psObject, configObject, propertyName);
 }
Пример #4
0
 protected override void FillProperty(Type type, PSObject psObject, ConfigurableObject configObject, string propertyName)
 {
     if (propertyName == "ItemCount")
     {
         configObject.propertyBag.DangerousSetValue(MapiPropertyDefinitions.ItemCount, psObject.Members[propertyName].Value);
         return;
     }
     if (propertyName == "TotalItemSize")
     {
         configObject.propertyBag.DangerousSetValue(MapiPropertyDefinitions.TotalItemSize, MockObjectCreator.GetSingleProperty(psObject.Members[propertyName].Value, MapiPropertyDefinitions.TotalItemSize.Type));
         return;
     }
     if (propertyName == "LastLoggedOnUserAccount")
     {
         configObject.propertyBag.DangerousSetValue(MapiPropertyDefinitions.LastLoggedOnUserAccount, psObject.Members[propertyName].Value);
         return;
     }
     base.FillProperty(type, psObject, configObject, propertyName);
 }
 // Token: 0x06000FC8 RID: 4040 RVA: 0x00030360 File Offset: 0x0002E560
 protected override void FillProperty(Type type, PSObject psObject, ConfigurableObject configObject, string propertyName)
 {
     if (propertyName == "AllowCallAnsweringRules")
     {
         configObject.propertyBag[UMMailboxPolicySchema.AllowPersonalAutoAttendant] = MockObjectCreator.GetSingleProperty(psObject.Members[propertyName].Value, UMMailboxPolicySchema.AllowPersonalAutoAttendant.Type);
         return;
     }
     if (propertyName == "AllowCommonPatterns")
     {
         configObject.propertyBag[UMMailboxPolicySchema.AllowCommonPatterns] = MockObjectCreator.GetSingleProperty(psObject.Members[propertyName].Value, typeof(bool));
         return;
     }
     base.FillProperty(type, psObject, configObject, propertyName);
 }
        // Token: 0x06000F79 RID: 3961 RVA: 0x0002D890 File Offset: 0x0002BA90
        protected static object GetSingleProperty(object prop, Type type)
        {
            if (prop == null)
            {
                return(null);
            }
            object obj = null;

            if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable <>))
            {
                obj = MockObjectCreator.GetSingleProperty(prop, type.GetGenericArguments()[0]);
            }
            else if (type == typeof(ADObjectId) && prop is PSObject)
            {
                obj = new ADObjectId(((PSObject)prop).Members["DistinguishedName"].Value.ToString(), new Guid(((PSObject)prop).Members["ObjectGuid"].Value.ToString()));
            }
            else if (type == typeof(EnhancedTimeSpan))
            {
                obj = EnhancedTimeSpan.Parse(prop.ToString());
            }
            else if (type == typeof(Unlimited <EnhancedTimeSpan>))
            {
                obj = Unlimited <EnhancedTimeSpan> .Parse(prop.ToString());
            }
            else if (type == typeof(ByteQuantifiedSize))
            {
                obj = ByteQuantifiedSize.Parse(prop.ToString());
            }
            else if (type == typeof(Unlimited <ByteQuantifiedSize>))
            {
                obj = Unlimited <ByteQuantifiedSize> .Parse(prop.ToString());
            }
            else if (type == typeof(Unlimited <int>))
            {
                obj = Unlimited <int> .Parse(prop.ToString());
            }
            else if (type == typeof(ProxyAddress))
            {
                obj = ProxyAddress.Parse(prop.ToString());
            }
            else if (type == typeof(SmtpAddress))
            {
                obj = new SmtpAddress(prop.ToString());
            }
            else if (type == typeof(SmtpDomain))
            {
                obj = SmtpDomain.Parse(prop.ToString());
            }
            else if (type == typeof(CountryInfo))
            {
                obj = CountryInfo.Parse(prop.ToString());
            }
            else if (type == typeof(SharingPolicyDomain))
            {
                obj = SharingPolicyDomain.Parse(prop.ToString());
            }
            else if (type == typeof(ApprovedApplication))
            {
                obj = ApprovedApplication.Parse(prop.ToString());
            }
            else if (type == typeof(SmtpDomainWithSubdomains))
            {
                obj = SmtpDomainWithSubdomains.Parse(prop.ToString());
            }
            else if (type == typeof(UMLanguage))
            {
                obj = UMLanguage.Parse(prop.ToString());
            }
            else if (type == typeof(UMSmartHost))
            {
                obj = UMSmartHost.Parse(prop.ToString());
            }
            else if (type == typeof(ScheduleInterval))
            {
                obj = ScheduleInterval.Parse(prop.ToString());
            }
            else if (type == typeof(NumberFormat))
            {
                obj = NumberFormat.Parse(prop.ToString());
            }
            else if (type == typeof(DialGroupEntry))
            {
                obj = DialGroupEntry.Parse(prop.ToString());
            }
            else if (type == typeof(CustomMenuKeyMapping))
            {
                obj = CustomMenuKeyMapping.Parse(prop.ToString());
            }
            else if (type == typeof(HolidaySchedule))
            {
                obj = HolidaySchedule.Parse(prop.ToString());
            }
            else if (type == typeof(UMTimeZone))
            {
                obj = UMTimeZone.Parse(prop.ToString());
            }
            else if (type == typeof(ServerVersion))
            {
                obj = ServerVersion.ParseFromSerialNumber(prop.ToString());
            }
            else if (type == typeof(X509Certificate2))
            {
                obj = new X509Certificate2(((PSObject)prop).Members["RawData"].Value as byte[]);
            }
            else if (type == typeof(LocalizedString))
            {
                obj = new LocalizedString(prop.ToString());
            }
            else if (type == typeof(ExchangeObjectVersion))
            {
                obj = ExchangeObjectVersion.Parse(prop.ToString());
            }
            else if (type == typeof(bool))
            {
                obj = bool.Parse(prop.ToString());
            }
            else if (type == typeof(SecurityPrincipalIdParameter))
            {
                obj = new SecurityPrincipalIdParameter(prop.ToString());
            }
            else if (type == typeof(ActiveDirectoryAccessRule))
            {
                obj = (prop as ActiveDirectoryAccessRule);
            }
            else if (type == typeof(ObjectId))
            {
                string text = prop.ToString();
                if (!ADObjectId.IsValidDistinguishedName(text) && text.Contains("/"))
                {
                    text = MockObjectCreator.ConvertDNFromTreeStructure(text);
                }
                obj = new ADObjectId(text);
            }
            else if (type.IsEnum)
            {
                try
                {
                    obj = Enum.Parse(type, prop.ToString());
                }
                catch (ArgumentException)
                {
                    obj = Enum.GetValues(type).GetValue(0);
                }
            }
            return(obj ?? prop);
        }
Пример #7
0
 protected override void FillProperty(Type type, PSObject psObject, ConfigurableObject configObject, string propertyName)
 {
     if (propertyName == "RequireSenderAuthenticationEnabled")
     {
         configObject.propertyBag[MailEnabledRecipientSchema.RequireSenderAuthenticationEnabled] = MockObjectCreator.GetSingleProperty(psObject.Members[propertyName].Value, MailEnabledRecipientSchema.RequireSenderAuthenticationEnabled.Type);
         return;
     }
     if (propertyName == "RetentionHoldEnabled")
     {
         configObject.propertyBag[MailboxSchema.ElcExpirationSuspensionEnabled] = MockObjectCreator.GetSingleProperty(psObject.Members[propertyName].Value, MailboxSchema.ElcExpirationSuspensionEnabled.Type);
         return;
     }
     if (propertyName == "StartDateForRetentionHold")
     {
         configObject.propertyBag[MailboxSchema.ElcExpirationSuspensionStartDate] = MockObjectCreator.GetSingleProperty(psObject.Members[propertyName].Value, MailboxSchema.ElcExpirationSuspensionStartDate.Type);
         return;
     }
     if (propertyName == "EndDateForRetentionHold")
     {
         configObject.propertyBag[MailboxSchema.ElcExpirationSuspensionEndDate] = MockObjectCreator.GetSingleProperty(psObject.Members[propertyName].Value, MailboxSchema.ElcExpirationSuspensionEndDate.Type);
         return;
     }
     base.FillProperty(type, psObject, configObject, propertyName);
 }
 // Token: 0x06000FAF RID: 4015 RVA: 0x0002F6FC File Offset: 0x0002D8FC
 protected override void FillProperty(Type type, PSObject psObject, ConfigurableObject configObject, string propertyName)
 {
     if (propertyName == "RetentionPolicyTagLinks")
     {
         configObject.propertyBag[RetentionPolicySchema.RetentionPolicyTagLinks] = MockObjectCreator.GetPropertyBasedOnDefinition(RetentionPolicySchema.RetentionPolicyTagLinks, psObject.Members[propertyName].Value);
         return;
     }
     base.FillProperty(type, psObject, configObject, propertyName);
 }