Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / HttpProxyCredentialType.cs / 1 / HttpProxyCredentialType.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel { using System.Net; public enum HttpProxyCredentialType { None, Basic, Digest, Ntlm, Windows, } static class HttpProxyCredentialTypeHelper { internal static bool IsDefined(HttpProxyCredentialType value) { return (value == HttpProxyCredentialType.None || value == HttpProxyCredentialType.Basic || value == HttpProxyCredentialType.Digest || value == HttpProxyCredentialType.Ntlm || value == HttpProxyCredentialType.Windows); } internal static AuthenticationSchemes MapToAuthenticationScheme(HttpProxyCredentialType proxyCredentialType) { AuthenticationSchemes result; switch (proxyCredentialType) { case HttpProxyCredentialType.None: result = AuthenticationSchemes.Anonymous; break; case HttpProxyCredentialType.Basic: result = AuthenticationSchemes.Basic; break; case HttpProxyCredentialType.Digest: result = AuthenticationSchemes.Digest; break; case HttpProxyCredentialType.Ntlm: result = AuthenticationSchemes.Ntlm; break; case HttpProxyCredentialType.Windows: result = AuthenticationSchemes.Negotiate; break; default: DiagnosticUtility.DebugAssert("unsupported proxy credential type"); throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException()); } return result; } internal static HttpProxyCredentialType MapToProxyCredentialType(AuthenticationSchemes authenticationSchemes) { HttpProxyCredentialType result; switch (authenticationSchemes) { case AuthenticationSchemes.Anonymous: result = HttpProxyCredentialType.None; break; case AuthenticationSchemes.Basic: result = HttpProxyCredentialType.Basic; break; case AuthenticationSchemes.Digest: result = HttpProxyCredentialType.Digest; break; case AuthenticationSchemes.Ntlm: result = HttpProxyCredentialType.Ntlm; break; case AuthenticationSchemes.Negotiate: result = HttpProxyCredentialType.Windows; break; default: DiagnosticUtility.DebugAssert("unsupported authentication Scheme"); throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException()); } return result; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Repeater.cs
- OptimisticConcurrencyException.cs
- DefaultEventAttribute.cs
- ToolStripManager.cs
- ExeContext.cs
- DesignerMetadata.cs
- DbRetry.cs
- DataSourceHelper.cs
- BoundColumn.cs
- IndentedTextWriter.cs
- controlskin.cs
- StylusTip.cs
- SqlPersonalizationProvider.cs
- Base64Encoder.cs
- DragDrop.cs
- SqlFacetAttribute.cs
- IdentityModelStringsVersion1.cs
- HandlerBase.cs
- MessageEncodingBindingElementImporter.cs
- QueryContinueDragEvent.cs
- ConfigXmlText.cs
- AccessibleObject.cs
- CountdownEvent.cs
- TextSchema.cs
- DependencyObject.cs
- Color.cs
- RelOps.cs
- AnnotationAuthorChangedEventArgs.cs
- DesignerObject.cs
- CodeAttributeDeclarationCollection.cs
- FillBehavior.cs
- JapaneseCalendar.cs
- HyperLink.cs
- CommittableTransaction.cs
- AuthorizationRule.cs
- AmbiguousMatchException.cs
- RbTree.cs
- WebBrowser.cs
- DataListItemCollection.cs
- WebControlAdapter.cs
- TemplateControlCodeDomTreeGenerator.cs
- StorageComplexTypeMapping.cs
- BasePattern.cs
- SimplePropertyEntry.cs
- ApplicationGesture.cs
- RectAnimationUsingKeyFrames.cs
- PageSetupDialog.cs
- SourceSwitch.cs
- LazyInitializer.cs
- NamedPipeConnectionPoolSettingsElement.cs
- ComboBoxItem.cs
- InputLanguageProfileNotifySink.cs
- ActivityCodeDomSerializer.cs
- PenThreadWorker.cs
- ApplicationFileParser.cs
- HeaderedContentControl.cs
- Ops.cs
- ArgumentNullException.cs
- OptimizedTemplateContentHelper.cs
- ImageIndexConverter.cs
- Html32TextWriter.cs
- HtmlTable.cs
- PropertyIdentifier.cs
- SystemUnicastIPAddressInformation.cs
- ProgressBarBrushConverter.cs
- COM2ExtendedBrowsingHandler.cs
- NCryptSafeHandles.cs
- NegationPusher.cs
- DispatcherOperation.cs
- SkinIDTypeConverter.cs
- LostFocusEventManager.cs
- CodeRegionDirective.cs
- OpacityConverter.cs
- TextBounds.cs
- DesignTimeTemplateParser.cs
- PermissionSetEnumerator.cs
- ComplexObject.cs
- TemplateNameScope.cs
- PeerCustomResolverSettings.cs
- COAUTHIDENTITY.cs
- Vertex.cs
- StreamGeometry.cs
- OletxVolatileEnlistment.cs
- CodeGroup.cs
- RawStylusActions.cs
- XslTransform.cs
- SqlBuilder.cs
- DnsPermission.cs
- ControlBindingsCollection.cs
- TreeNode.cs
- XmlWrappingWriter.cs
- CommandBindingCollection.cs
- RtfToXamlReader.cs
- DaylightTime.cs
- PageTextBox.cs
- BufferedGraphicsContext.cs
- IndependentAnimationStorage.cs
- CompilerState.cs
- ButtonAutomationPeer.cs
- SiteMapNodeCollection.cs