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
- SimpleRecyclingCache.cs
- Menu.cs
- NavigationPropertyEmitter.cs
- StringUtil.cs
- TextSpanModifier.cs
- Listener.cs
- SystemSounds.cs
- DataRecordInternal.cs
- TreeNodeBinding.cs
- UICuesEvent.cs
- SimpleLine.cs
- Menu.cs
- ButtonRenderer.cs
- OneWayChannelListener.cs
- CommonGetThemePartSize.cs
- _Win32.cs
- StreamGeometry.cs
- Metadata.cs
- FlowDocumentScrollViewer.cs
- NamespaceQuery.cs
- ImageDrawing.cs
- WebPartConnectionsCancelVerb.cs
- filewebrequest.cs
- CodeStatementCollection.cs
- Semaphore.cs
- SimpleHandlerBuildProvider.cs
- NavigationProgressEventArgs.cs
- Tuple.cs
- FacetChecker.cs
- GridLength.cs
- PrimarySelectionAdorner.cs
- Privilege.cs
- DataServiceQueryOfT.cs
- PresentationAppDomainManager.cs
- DesignerLoader.cs
- ObjectHandle.cs
- FixedTextSelectionProcessor.cs
- CustomTypeDescriptor.cs
- DragDrop.cs
- FormsAuthentication.cs
- ISessionStateStore.cs
- ConfigDefinitionUpdates.cs
- ExeConfigurationFileMap.cs
- XamlContextStack.cs
- ObjectListCommandCollection.cs
- XmlAtomicValue.cs
- XmlIlGenerator.cs
- TableItemPattern.cs
- SystemUdpStatistics.cs
- TextContainer.cs
- SqlMethodTransformer.cs
- IdentityNotMappedException.cs
- XmlQueryStaticData.cs
- MemberMaps.cs
- AssemblyBuilder.cs
- SelectingProviderEventArgs.cs
- Int64Storage.cs
- FilteredAttributeCollection.cs
- SmtpReplyReader.cs
- BitmapEffectGeneralTransform.cs
- Point3D.cs
- AssemblyHash.cs
- SecurityDescriptor.cs
- SchemaRegistration.cs
- XmlDataDocument.cs
- EntityContainerRelationshipSet.cs
- TextBoxLine.cs
- MD5CryptoServiceProvider.cs
- wmiutil.cs
- ExpressionVisitorHelpers.cs
- TextUtf8RawTextWriter.cs
- GiveFeedbackEventArgs.cs
- ConfigurationSectionHelper.cs
- SchemaImporterExtensionElement.cs
- ButtonColumn.cs
- AttributeEmitter.cs
- ImportCatalogPart.cs
- IsolatedStorageFile.cs
- Style.cs
- ApplicationHost.cs
- DrawListViewColumnHeaderEventArgs.cs
- WsdlBuildProvider.cs
- DecimalKeyFrameCollection.cs
- RC2CryptoServiceProvider.cs
- Compiler.cs
- MultiPropertyDescriptorGridEntry.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- MetadataPropertyCollection.cs
- MetadataItem_Static.cs
- TraceShell.cs
- QilInvokeLateBound.cs
- WorkflowFormatterBehavior.cs
- ScriptControlDescriptor.cs
- CqlParserHelpers.cs
- ExpressionEditorAttribute.cs
- XPathDocument.cs
- ISAPIRuntime.cs
- SqlDataSourceView.cs
- OutputCacheProfile.cs
- DiffuseMaterial.cs