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
- FloaterBaseParaClient.cs
- EntitySqlQueryCacheEntry.cs
- MarkupObject.cs
- EntityDataSourceStatementEditorForm.cs
- _NetworkingPerfCounters.cs
- GenericNameHandler.cs
- PrintingPermissionAttribute.cs
- FixedSOMPageElement.cs
- ToolStripHighContrastRenderer.cs
- ParseChildrenAsPropertiesAttribute.cs
- Enumerable.cs
- ExecutedRoutedEventArgs.cs
- ListViewEditEventArgs.cs
- PeerApplicationLaunchInfo.cs
- Rect3D.cs
- ToolTip.cs
- XmlAttributeCache.cs
- WSFederationHttpSecurityElement.cs
- UserMapPath.cs
- ToolBarButtonClickEvent.cs
- ScrollContentPresenter.cs
- SqlSupersetValidator.cs
- EmptyCollection.cs
- EntityDataSourceDesigner.cs
- Button.cs
- SortQuery.cs
- ValueQuery.cs
- LineSegment.cs
- ApplicationDirectoryMembershipCondition.cs
- ClientSettingsSection.cs
- XamlVector3DCollectionSerializer.cs
- ResourceManagerWrapper.cs
- SimpleType.cs
- BaseValidator.cs
- ConditionalDesigner.cs
- HostingEnvironment.cs
- MediaTimeline.cs
- VersionedStream.cs
- WinFormsSecurity.cs
- TheQuery.cs
- IdentifierService.cs
- DataSourceCache.cs
- ObjectQueryState.cs
- StreamingContext.cs
- Size3DValueSerializer.cs
- FontWeight.cs
- WindowsPen.cs
- EventProvider.cs
- DataGridViewTopLeftHeaderCell.cs
- XsltConvert.cs
- TraceSwitch.cs
- RotateTransform3D.cs
- XmlElementCollection.cs
- TraceData.cs
- OleDbDataAdapter.cs
- SecurityChannel.cs
- AutomationPattern.cs
- PolicyUnit.cs
- ProfileSettingsCollection.cs
- XmlSchemaObjectCollection.cs
- TemplateBindingExtensionConverter.cs
- _AuthenticationState.cs
- BamlBinaryWriter.cs
- AppSecurityManager.cs
- CategoryNameCollection.cs
- X509Certificate2Collection.cs
- ToolboxItemAttribute.cs
- WorkflowMarkupSerializationProvider.cs
- MemberDescriptor.cs
- ErrorStyle.cs
- IxmlLineInfo.cs
- TableHeaderCell.cs
- LockedHandleGlyph.cs
- DataContract.cs
- DesignOnlyAttribute.cs
- DirectoryNotFoundException.cs
- MappingMetadataHelper.cs
- CodeParameterDeclarationExpressionCollection.cs
- InterleavedZipPartStream.cs
- ListBindableAttribute.cs
- EllipseGeometry.cs
- RepeaterItemEventArgs.cs
- SlipBehavior.cs
- EdmTypeAttribute.cs
- UrlPath.cs
- PeerFlooder.cs
- UserControlCodeDomTreeGenerator.cs
- _BufferOffsetSize.cs
- XmlAttributeProperties.cs
- ClientEventManager.cs
- AutomationEventArgs.cs
- Stroke2.cs
- validation.cs
- EditorPartCollection.cs
- OleDbErrorCollection.cs
- CommandLibraryHelper.cs
- ObjRef.cs
- CreateUserWizard.cs
- QueryContext.cs
- ProfileService.cs