Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx35 / System.ServiceModel.Web / System / ServiceModel / Configuration / WebHttpSecurityElement.cs / 1305376 / WebHttpSecurityElement.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Configuration { using System.Configuration; using System.ServiceModel; public sealed partial class WebHttpSecurityElement : ConfigurationElement { ConfigurationPropertyCollection properties; [ConfigurationProperty(ConfigurationStrings.Mode, DefaultValue = WebHttpSecurity.DefaultMode)] [InternalEnumValidator(typeof(WebHttpSecurityModeHelper))] public WebHttpSecurityMode Mode { get { return (WebHttpSecurityMode) base[ConfigurationStrings.Mode]; } set { base[ConfigurationStrings.Mode] = value; } } [ConfigurationProperty(ConfigurationStrings.Transport)] public HttpTransportSecurityElement Transport { get { return (HttpTransportSecurityElement) base[ConfigurationStrings.Transport]; } } protected override ConfigurationPropertyCollection Properties { get { if (this.properties == null) { ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); properties.Add(new ConfigurationProperty("mode", typeof(WebHttpSecurityMode), System.ServiceModel.WebHttpSecurityMode.None, null, new InternalEnumValidator(typeof(WebHttpSecurityModeHelper)), System.Configuration.ConfigurationPropertyOptions.None)); properties.Add(new ConfigurationProperty("transport", typeof(HttpTransportSecurityElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); this.properties = properties; } return this.properties; } } internal void ApplyConfiguration(WebHttpSecurity security) { if (security == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("security"); } if (this.ElementInformation.Properties["mode"].IsModified) { security.Mode = this.Mode; this.Transport.ApplyConfiguration(security.Transport); } } internal void InitializeFrom(WebHttpSecurity security) { if (security == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("security"); } this.Mode = security.Mode; this.InitializeTransportSecurity(security.Transport); } void ApplyConfiguration(HttpTransportSecurity security) { if (security == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("security"); } security.ClientCredentialType = this.Transport.ClientCredentialType; security.ProxyCredentialType = this.Transport.ProxyCredentialType; security.Realm = this.Transport.Realm; } void InitializeTransportSecurity(HttpTransportSecurity security) { if (security == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("security"); } this.Transport.ClientCredentialType = security.ClientCredentialType; this.Transport.ProxyCredentialType = security.ProxyCredentialType; this.Transport.Realm = security.Realm; } } } // 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
- EntityCollection.cs
- XmlQueryStaticData.cs
- TCEAdapterGenerator.cs
- StringSource.cs
- PrivilegedConfigurationManager.cs
- PeerTransportElement.cs
- DrawingContextDrawingContextWalker.cs
- DataFieldConverter.cs
- EncodingNLS.cs
- InputBuffer.cs
- Canvas.cs
- MailDefinition.cs
- PageSetupDialog.cs
- NumberFunctions.cs
- XmlTypeMapping.cs
- Point4DValueSerializer.cs
- Form.cs
- DataGridBoolColumn.cs
- RelativeSource.cs
- DebugView.cs
- TraceSwitch.cs
- HitTestDrawingContextWalker.cs
- BamlLocalizer.cs
- AppSettingsExpressionBuilder.cs
- MaskInputRejectedEventArgs.cs
- RpcCryptoContext.cs
- DefaultPropertyAttribute.cs
- MachineSettingsSection.cs
- TopClause.cs
- LightweightCodeGenerator.cs
- PhysicalAddress.cs
- Stack.cs
- ValidatingReaderNodeData.cs
- DrawingAttributeSerializer.cs
- DataControlLinkButton.cs
- CanonicalFormWriter.cs
- Int32RectValueSerializer.cs
- SecurityKeyType.cs
- XmlStringTable.cs
- Serializer.cs
- SplitterCancelEvent.cs
- Application.cs
- _SafeNetHandles.cs
- SimpleBitVector32.cs
- panel.cs
- ValueTable.cs
- PersonalizablePropertyEntry.cs
- LayoutExceptionEventArgs.cs
- EdgeProfileValidation.cs
- StoreItemCollection.Loader.cs
- X509ChainPolicy.cs
- HealthMonitoringSectionHelper.cs
- DrawingAttributeSerializer.cs
- rsa.cs
- DbgCompiler.cs
- DataGridRow.cs
- NotCondition.cs
- Empty.cs
- NewExpression.cs
- EntityModelBuildProvider.cs
- SafeFileMapViewHandle.cs
- XmlSchemaValidationException.cs
- TextAdaptor.cs
- StorageRoot.cs
- ExtendedProtectionPolicyTypeConverter.cs
- ItemsChangedEventArgs.cs
- HuffCodec.cs
- DbConnectionPoolCounters.cs
- SmtpDigestAuthenticationModule.cs
- CollectionViewGroupRoot.cs
- CodeNamespaceImportCollection.cs
- SQLInt32Storage.cs
- AccessDataSourceDesigner.cs
- EntityContainerEmitter.cs
- IntPtr.cs
- ProjectionAnalyzer.cs
- HttpHandlersSection.cs
- TemplateBamlTreeBuilder.cs
- TreeNodeBindingCollection.cs
- MeshGeometry3D.cs
- DocumentViewerHelper.cs
- MonikerHelper.cs
- DayRenderEvent.cs
- DefaultEvaluationContext.cs
- WorkflowServiceHost.cs
- DataGridToolTip.cs
- BitmapEffectvisualstate.cs
- DocumentViewerAutomationPeer.cs
- StickyNoteAnnotations.cs
- GridItemPatternIdentifiers.cs
- ResourceAttributes.cs
- OracleTransaction.cs
- HttpServerUtilityWrapper.cs
- EventProviderWriter.cs
- EndpointDiscoveryMetadataCD1.cs
- CommandLibraryHelper.cs
- OrthographicCamera.cs
- SystemDiagnosticsSection.cs
- SByteConverter.cs
- SHA256Managed.cs