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
- DataControlImageButton.cs
- AttributeAction.cs
- DelegatingConfigHost.cs
- ScrollBarRenderer.cs
- NullableIntAverageAggregationOperator.cs
- SafeLocalMemHandle.cs
- CharAnimationBase.cs
- InstanceDataCollectionCollection.cs
- ScriptingProfileServiceSection.cs
- TypeDelegator.cs
- Rule.cs
- DataGridViewCellStyleChangedEventArgs.cs
- BindingExpressionBase.cs
- SupportedAddressingMode.cs
- VScrollProperties.cs
- MetadataArtifactLoaderCompositeResource.cs
- ClientConfigurationHost.cs
- ConfigurationManager.cs
- InternalMappingException.cs
- OleDbReferenceCollection.cs
- EntityReference.cs
- CheckBoxField.cs
- RelatedPropertyManager.cs
- MsmqHostedTransportManager.cs
- PerfCounters.cs
- PasswordTextNavigator.cs
- PrePrepareMethodAttribute.cs
- OleDbRowUpdatingEvent.cs
- ServiceObjectContainer.cs
- ProviderMetadata.cs
- TagMapCollection.cs
- RemoveStoryboard.cs
- SubpageParaClient.cs
- DelayedRegex.cs
- Vector3DIndependentAnimationStorage.cs
- FamilyCollection.cs
- XmlC14NWriter.cs
- Stream.cs
- Boolean.cs
- ClientTargetSection.cs
- WindowsImpersonationContext.cs
- DataGridTextBox.cs
- IImplicitResourceProvider.cs
- RecognizedAudio.cs
- BufferAllocator.cs
- AnnotationComponentManager.cs
- DataGridViewBand.cs
- HelpKeywordAttribute.cs
- NamespaceDisplay.xaml.cs
- IRCollection.cs
- LinkUtilities.cs
- XmlNodeList.cs
- Attachment.cs
- DataGridViewTopRowAccessibleObject.cs
- Int64Converter.cs
- PropertyKey.cs
- BlockCollection.cs
- MsmqActivation.cs
- ProvidersHelper.cs
- ListViewInsertedEventArgs.cs
- ResourceDictionary.cs
- OracleTimeSpan.cs
- StreamWriter.cs
- DataGridViewAutoSizeModeEventArgs.cs
- XmlNodeReader.cs
- OleDbEnumerator.cs
- FamilyMap.cs
- ContainsRowNumberChecker.cs
- FormatConvertedBitmap.cs
- TypeValidationEventArgs.cs
- securitycriticaldata.cs
- SafeSecurityHelper.cs
- Pkcs7Recipient.cs
- XmlStreamStore.cs
- WorkflowDurableInstance.cs
- WebPartTransformerCollection.cs
- DocumentGridContextMenu.cs
- LineInfo.cs
- XmlDeclaration.cs
- InstanceData.cs
- PartialTrustHelpers.cs
- Event.cs
- ToolBarOverflowPanel.cs
- EntityContainerEmitter.cs
- PixelFormatConverter.cs
- DependencyPropertyValueSerializer.cs
- Parameter.cs
- ObjectConverter.cs
- TemplateComponentConnector.cs
- CloseSequenceResponse.cs
- BaseParser.cs
- SchemaImporterExtension.cs
- DecimalConverter.cs
- _UncName.cs
- _OSSOCK.cs
- BitmapSource.cs
- ControlIdConverter.cs
- WebScriptEnablingBehavior.cs
- CharacterShapingProperties.cs
- XPathArrayIterator.cs