Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / security / system / security / authentication / ExtendedProtection / configuration / ExtendedProtectionPolicyElement.cs / 1305376 / ExtendedProtectionPolicyElement.cs
//------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System.Collections.Generic; using System.Configuration; namespace System.Security.Authentication.ExtendedProtection.Configuration { public sealed class ExtendedProtectionPolicyElement : ConfigurationElement { public ExtendedProtectionPolicyElement() { this.properties.Add(this.policyEnforcement); this.properties.Add(this.protectionScenario); this.properties.Add(this.customServiceNames); } protected override ConfigurationPropertyCollection Properties { get { return this.properties; } } [ConfigurationProperty(ExtendedProtectionConfigurationStrings.PolicyEnforcement)] public PolicyEnforcement PolicyEnforcement { get { return (PolicyEnforcement)this[this.policyEnforcement]; } set { this[this.policyEnforcement] = value; } } [ConfigurationProperty(ExtendedProtectionConfigurationStrings.ProtectionScenario, DefaultValue=ProtectionScenario.TransportSelected)] public ProtectionScenario ProtectionScenario { get { return (ProtectionScenario)this[this.protectionScenario]; } set { this[this.protectionScenario] = value; } } [ConfigurationProperty(ExtendedProtectionConfigurationStrings.CustomServiceNames)] public ServiceNameElementCollection CustomServiceNames { get { return (ServiceNameElementCollection)this[this.customServiceNames]; } } public ExtendedProtectionPolicy BuildPolicy() { if (PolicyEnforcement == PolicyEnforcement.Never) { return new ExtendedProtectionPolicy(PolicyEnforcement.Never); } ServiceNameCollection spns = null; ServiceNameElementCollection spnCollection = CustomServiceNames; if (spnCollection != null && spnCollection.Count > 0) { ListspnList = new List (spnCollection.Count); foreach (ServiceNameElement element in spnCollection) { spnList.Add(element.Name); } spns = new ServiceNameCollection(spnList); } return new ExtendedProtectionPolicy(PolicyEnforcement, ProtectionScenario, spns); } ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); private static PolicyEnforcement DefaultPolicyEnforcement { get { return PolicyEnforcement.Never; } } readonly ConfigurationProperty policyEnforcement = new ConfigurationProperty(ExtendedProtectionConfigurationStrings.PolicyEnforcement, typeof(PolicyEnforcement), DefaultPolicyEnforcement, ConfigurationPropertyOptions.None); readonly ConfigurationProperty protectionScenario = new ConfigurationProperty(ExtendedProtectionConfigurationStrings.ProtectionScenario, typeof(ProtectionScenario), ProtectionScenario.TransportSelected, ConfigurationPropertyOptions.None); readonly ConfigurationProperty customServiceNames = new ConfigurationProperty(ExtendedProtectionConfigurationStrings.CustomServiceNames, typeof(ServiceNameElementCollection), null, ConfigurationPropertyOptions.None); } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Tile.cs
- ConditionalDesigner.cs
- DataGridViewRowsAddedEventArgs.cs
- EncryptedData.cs
- ConnectionConsumerAttribute.cs
- BCLDebug.cs
- HighContrastHelper.cs
- AuthorizationContext.cs
- DefaultPrintController.cs
- RevocationPoint.cs
- OutputCacheSection.cs
- HwndProxyElementProvider.cs
- AutomationPropertyInfo.cs
- SplitContainer.cs
- ExtensionFile.cs
- ImageIndexEditor.cs
- RegionData.cs
- WizardPanel.cs
- HotSpot.cs
- ImageCodecInfo.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- PropertyChangedEventArgs.cs
- StylusDownEventArgs.cs
- ReadOnlyPropertyMetadata.cs
- BaseParser.cs
- DbConnectionPoolGroup.cs
- DesignerVerb.cs
- InstanceNameConverter.cs
- SubMenuStyleCollection.cs
- MetadataArtifactLoaderCompositeFile.cs
- XPathSelfQuery.cs
- PasswordBoxAutomationPeer.cs
- WebPartDisplayModeEventArgs.cs
- NgenServicingAttributes.cs
- OracleRowUpdatedEventArgs.cs
- IdentityValidationException.cs
- WebCategoryAttribute.cs
- DecoderFallback.cs
- ObjectNotFoundException.cs
- JournalEntry.cs
- FontUnitConverter.cs
- XmlStrings.cs
- Random.cs
- Monitor.cs
- SafeViewOfFileHandle.cs
- DocumentPageViewAutomationPeer.cs
- Typeface.cs
- WebPartDeleteVerb.cs
- DataSourceControl.cs
- NativeMethodsCLR.cs
- SAPIEngineTypes.cs
- BindingContext.cs
- CommandEventArgs.cs
- StoreConnection.cs
- PrintController.cs
- CustomExpressionEventArgs.cs
- WindowsImpersonationContext.cs
- WebPartManager.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- TreeViewItemAutomationPeer.cs
- ComponentSerializationService.cs
- SEHException.cs
- ValidationResult.cs
- RequestCacheValidator.cs
- Itemizer.cs
- Site.cs
- MetabaseSettings.cs
- AdapterSwitches.cs
- activationcontext.cs
- ZipIOBlockManager.cs
- MemberMemberBinding.cs
- RequestBringIntoViewEventArgs.cs
- MetadataCollection.cs
- XmlSerializer.cs
- CacheRequest.cs
- Size.cs
- FixedLineResult.cs
- Types.cs
- VirtualizingPanel.cs
- NGCUIElementCollectionSerializerAsync.cs
- ToolStripPanelDesigner.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- ValuePattern.cs
- InstanceCreationEditor.cs
- DataKey.cs
- CaseInsensitiveComparer.cs
- EmptyStringExpandableObjectConverter.cs
- DesignTimeTemplateParser.cs
- SiteMapNodeCollection.cs
- OutputCacheProfile.cs
- ElementUtil.cs
- DataControlPagerLinkButton.cs
- OleDbConnectionInternal.cs
- HttpProfileBase.cs
- ScriptComponentDescriptor.cs
- ResourceManagerWrapper.cs
- AnnotationStore.cs
- FormViewUpdateEventArgs.cs
- FunctionGenerator.cs
- MasterPageParser.cs