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
- XsltFunctions.cs
- Confirm.cs
- MonitoringDescriptionAttribute.cs
- RegionData.cs
- DataGridRowEventArgs.cs
- activationcontext.cs
- StringSorter.cs
- PathStreamGeometryContext.cs
- GeneralTransform3D.cs
- PageThemeCodeDomTreeGenerator.cs
- ForeignConstraint.cs
- DrawingVisual.cs
- XmlSchemaComplexContentExtension.cs
- ConfigurationStrings.cs
- ServiceNotStartedException.cs
- CommandHelpers.cs
- HealthMonitoringSectionHelper.cs
- XmlILCommand.cs
- DbProviderServices.cs
- StylusPoint.cs
- XmlSignificantWhitespace.cs
- ParenthesizePropertyNameAttribute.cs
- ListSortDescriptionCollection.cs
- _AutoWebProxyScriptWrapper.cs
- UnsafeNativeMethods.cs
- DataObjectEventArgs.cs
- IssuedTokensHeader.cs
- VariantWrapper.cs
- TransportDefaults.cs
- EventHandlersDesigner.cs
- LinqDataSourceContextEventArgs.cs
- HttpProfileBase.cs
- TcpSocketManager.cs
- diagnosticsswitches.cs
- GridViewColumn.cs
- ComponentResourceKey.cs
- ListBindableAttribute.cs
- NotifyIcon.cs
- XmlException.cs
- SystemIPInterfaceProperties.cs
- XmlSchemaObject.cs
- AbandonedMutexException.cs
- MissingSatelliteAssemblyException.cs
- MultipleViewProviderWrapper.cs
- ConstructorArgumentAttribute.cs
- ToolStripItemImageRenderEventArgs.cs
- JournalNavigationScope.cs
- Vector3DCollectionConverter.cs
- RemoveFromCollection.cs
- XmlNullResolver.cs
- DurableOperationAttribute.cs
- WebPartConnectVerb.cs
- Properties.cs
- SafePointer.cs
- EventHandlerService.cs
- DebugInfo.cs
- WebBrowserProgressChangedEventHandler.cs
- _SslState.cs
- TypeUsageBuilder.cs
- CommandCollectionEditor.cs
- BasicSecurityProfileVersion.cs
- PageCatalogPart.cs
- ZipIOExtraField.cs
- XmlWriterTraceListener.cs
- SlotInfo.cs
- RIPEMD160Managed.cs
- Constants.cs
- NativeMethods.cs
- HuffModule.cs
- XmlWriterSettings.cs
- LockRenewalTask.cs
- XPathExpr.cs
- TemplatedWizardStep.cs
- XXXOnTypeBuilderInstantiation.cs
- ColumnResizeUndoUnit.cs
- SchemaImporterExtensionElement.cs
- TableItemStyle.cs
- OneOfConst.cs
- ConnectionManagementSection.cs
- HotSpotCollection.cs
- FormsAuthenticationUserCollection.cs
- DragStartedEventArgs.cs
- XamlRtfConverter.cs
- WebDisplayNameAttribute.cs
- SeekableMessageNavigator.cs
- TreeViewCancelEvent.cs
- XLinq.cs
- PartialClassGenerationTaskInternal.cs
- SparseMemoryStream.cs
- Focus.cs
- MSAANativeProvider.cs
- SqlMetaData.cs
- DataGridPageChangedEventArgs.cs
- ReliabilityContractAttribute.cs
- OledbConnectionStringbuilder.cs
- DynamicControl.cs
- DecimalAnimationBase.cs
- MembershipSection.cs
- ToolStripPanelRow.cs
- CompilerParameters.cs