internal static ExtendedProtectionFlag ExtendedProtectionMultiValuedPropertyToFlags(MultiValuedProperty <ExtendedProtectionFlag> flagsCollection) { ExtendedProtectionFlag extendedProtectionFlag = ExtendedProtectionFlag.None; if (flagsCollection != null) { foreach (ExtendedProtectionFlag extendedProtectionFlag2 in flagsCollection) { extendedProtectionFlag |= extendedProtectionFlag2; } } return(extendedProtectionFlag); }
protected override IConfigurable PrepareDataObject() { ExchangeVirtualDirectory exchangeVirtualDirectory = (ExchangeVirtualDirectory)base.PrepareDataObject(); if (base.HasErrors) { return(null); } if (base.Fields.Contains("ExtendedProtectionTokenChecking")) { exchangeVirtualDirectory.ExtendedProtectionTokenChecking = (ExtendedProtectionTokenCheckingMode)base.Fields["ExtendedProtectionTokenChecking"]; } if (base.Fields.Contains("ExtendedProtectionSPNList")) { exchangeVirtualDirectory.ExtendedProtectionSPNList = (MultiValuedProperty <string>)base.Fields["ExtendedProtectionSPNList"]; } if (base.Fields.Contains("ExtendedProtectionFlags")) { ExtendedProtectionFlag flags = (ExtendedProtectionFlag)base.Fields["ExtendedProtectionFlags"]; exchangeVirtualDirectory.ExtendedProtectionFlags = ExchangeVirtualDirectory.ExtendedProtectionFlagsToMultiValuedProperty(flags); } return(exchangeVirtualDirectory); }
internal static MultiValuedProperty <ExtendedProtectionFlag> ExtendedProtectionFlagsToMultiValuedProperty(ExtendedProtectionFlag flags) { if (flags == ExtendedProtectionFlag.None) { return(ExchangeVirtualDirectory.EmptyExtendedProtectionFlagsPropertyValue); } MultiValuedProperty <ExtendedProtectionFlag> multiValuedProperty = new MultiValuedProperty <ExtendedProtectionFlag>(); foreach (ExtendedProtectionFlag extendedProtectionFlag in ExchangeVirtualDirectory.extendedProtectionFlagMasks) { if ((flags & extendedProtectionFlag) == extendedProtectionFlag) { multiValuedProperty.Add(extendedProtectionFlag); } } return(multiValuedProperty); }
protected override IConfigurable PrepareDataObject() { ADMobileVirtualDirectory admobileVirtualDirectory = (ADMobileVirtualDirectory)base.PrepareDataObject(); if (base.HasErrors) { return(null); } if (base.Fields.Contains("ActiveSyncServer")) { admobileVirtualDirectory.ActiveSyncServer = (string)base.Fields["ActiveSyncServer"]; } if (base.Fields.Contains("MobileClientCertificateProvisioningEnabled")) { admobileVirtualDirectory.MobileClientCertificateProvisioningEnabled = (bool)base.Fields["MobileClientCertificateProvisioningEnabled"]; } if (base.Fields.Contains("BadItemReportingEnabled")) { admobileVirtualDirectory.BadItemReportingEnabled = (bool)base.Fields["BadItemReportingEnabled"]; } if (base.Fields.Contains("SendWatsonReport")) { admobileVirtualDirectory.SendWatsonReport = (bool)base.Fields["SendWatsonReport"]; } if (base.Fields.Contains("MobileClientCertificateAuthorityURL")) { admobileVirtualDirectory.MobileClientCertificateAuthorityURL = (string)base.Fields["MobileClientCertificateAuthorityURL"]; } if (base.Fields.Contains("MobileClientCertTemplateName")) { admobileVirtualDirectory.MobileClientCertTemplateName = (string)base.Fields["MobileClientCertTemplateName"]; } if (base.Fields.Contains("ClientCertAuth")) { admobileVirtualDirectory.ClientCertAuth = new ClientCertAuthTypes?((ClientCertAuthTypes)base.Fields["ClientCertAuth"]); } if (base.Fields.Contains("BasicAuthEnabled")) { admobileVirtualDirectory.BasicAuthEnabled = (bool)base.Fields["BasicAuthEnabled"]; } if (base.Fields.Contains("WindowsAuthEnabled")) { admobileVirtualDirectory.WindowsAuthEnabled = (bool)base.Fields["WindowsAuthEnabled"]; } if (base.Fields.Contains("CompressionEnabled")) { admobileVirtualDirectory.CompressionEnabled = (bool)base.Fields["CompressionEnabled"]; } if (base.Fields.Contains("RemoteDocumentsActionForUnknownServers")) { admobileVirtualDirectory.RemoteDocumentsActionForUnknownServers = (RemoteDocumentsActions?)base.Fields["RemoteDocumentsActionForUnknownServers"]; } if (base.Fields.Contains("RemoteDocumentsAllowedServers")) { admobileVirtualDirectory.RemoteDocumentsAllowedServers = (MultiValuedProperty <string>)base.Fields["RemoteDocumentsAllowedServers"]; } if (base.Fields.Contains("RemoteDocumentsBlockedServers")) { admobileVirtualDirectory.RemoteDocumentsBlockedServers = (MultiValuedProperty <string>)base.Fields["RemoteDocumentsBlockedServers"]; } if (base.Fields.Contains("RemoteDocumentsInternalDomainSuffixList")) { admobileVirtualDirectory.RemoteDocumentsInternalDomainSuffixList = (MultiValuedProperty <string>)base.Fields["RemoteDocumentsInternalDomainSuffixList"]; } if (base.Fields.Contains("ExtendedProtectionTokenCheckingField")) { admobileVirtualDirectory.ExtendedProtectionTokenChecking = (ExtendedProtectionTokenCheckingMode)base.Fields["ExtendedProtectionTokenCheckingField"]; } if (base.Fields.Contains("ExtendedProtectionSpnListField")) { admobileVirtualDirectory.ExtendedProtectionSPNList = (MultiValuedProperty <string>)base.Fields["ExtendedProtectionSpnListField"]; } if (base.Fields.Contains("ExtendedProtectionFlagsField")) { ExtendedProtectionFlag flags = (ExtendedProtectionFlag)base.Fields["ExtendedProtectionFlagsField"]; admobileVirtualDirectory.ExtendedProtectionFlags = ExchangeVirtualDirectory.ExtendedProtectionFlagsToMultiValuedProperty(flags); } return(admobileVirtualDirectory); }