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
- HostExecutionContextManager.cs
- SymLanguageType.cs
- SEHException.cs
- Menu.cs
- DelimitedListTraceListener.cs
- ProjectionCamera.cs
- ToolStripPanelCell.cs
- ListViewUpdatedEventArgs.cs
- ControlParameter.cs
- CompilationSection.cs
- ChooseAction.cs
- XmlSchemaAny.cs
- XmlBinaryReader.cs
- TextTreeFixupNode.cs
- AttributeCollection.cs
- CachingHintValidation.cs
- SymmetricKey.cs
- ModelItemDictionaryImpl.cs
- SqlVersion.cs
- _NegotiateClient.cs
- ToolStripLabel.cs
- Serializer.cs
- ListViewDeletedEventArgs.cs
- CommandEventArgs.cs
- ObjectQueryProvider.cs
- EventKeyword.cs
- DeleteHelper.cs
- ContainerParagraph.cs
- EventSource.cs
- ComponentFactoryHelpers.cs
- VirtualizingPanel.cs
- ToolStripGripRenderEventArgs.cs
- DocumentXmlWriter.cs
- XmlText.cs
- SqlDataSource.cs
- WindowsStatic.cs
- RadioButtonRenderer.cs
- SecurityHeader.cs
- SerialPinChanges.cs
- ModelPropertyCollectionImpl.cs
- BufferedStream2.cs
- OneOf.cs
- TreeNodeCollection.cs
- Property.cs
- HtmlTableRowCollection.cs
- ClientFormsAuthenticationMembershipProvider.cs
- AttachedAnnotationChangedEventArgs.cs
- WebPartConnectVerb.cs
- ParameterCollectionEditorForm.cs
- TabItemAutomationPeer.cs
- AnnotationMap.cs
- StorageComplexTypeMapping.cs
- MasterPage.cs
- TypeDescriptionProvider.cs
- TextEditorTables.cs
- OneToOneMappingSerializer.cs
- Size3D.cs
- Number.cs
- DataGridBoolColumn.cs
- LabelLiteral.cs
- BuildProvider.cs
- ResourcesBuildProvider.cs
- Rules.cs
- ConfigurationStrings.cs
- StringDictionaryCodeDomSerializer.cs
- XmlTextEncoder.cs
- CategoriesDocument.cs
- ConvertEvent.cs
- CfgArc.cs
- CustomAttributeBuilder.cs
- SessionStateSection.cs
- MessageFault.cs
- AppearanceEditorPart.cs
- InvalidComObjectException.cs
- EntityClassGenerator.cs
- TextTreePropertyUndoUnit.cs
- SizeChangedInfo.cs
- FilterQueryOptionExpression.cs
- WebMessageFormatHelper.cs
- XmlSchemaAppInfo.cs
- MeshGeometry3D.cs
- ConfigurationErrorsException.cs
- XmlValidatingReaderImpl.cs
- Receive.cs
- NativeCppClassAttribute.cs
- Qualifier.cs
- Application.cs
- Schema.cs
- WizardStepBase.cs
- EventEntry.cs
- PriorityItem.cs
- SpotLight.cs
- Sequence.cs
- Message.cs
- ZeroOpNode.cs
- SqlUserDefinedTypeAttribute.cs
- ErrorFormatterPage.cs
- TypeToStringValueConverter.cs
- oledbmetadatacolumnnames.cs
- ToggleProviderWrapper.cs