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
- LinkButton.cs
- DataColumnChangeEvent.cs
- HwndProxyElementProvider.cs
- XmlSerializationReader.cs
- WindowsListBox.cs
- PngBitmapDecoder.cs
- ContextMenuService.cs
- DataServiceBehavior.cs
- ProviderConnectionPointCollection.cs
- SafeProcessHandle.cs
- ASCIIEncoding.cs
- ObjectNavigationPropertyMapping.cs
- Encoder.cs
- Internal.cs
- DocumentSchemaValidator.cs
- FlowDocumentFormatter.cs
- JournalEntryStack.cs
- NavigatingCancelEventArgs.cs
- DataSourceControl.cs
- ScrollItemPattern.cs
- TemplateApplicationHelper.cs
- DesignBinding.cs
- MarshalDirectiveException.cs
- SystemDropShadowChrome.cs
- FormParameter.cs
- DesignUtil.cs
- RequestResponse.cs
- WebEvents.cs
- ElementFactory.cs
- DateTimeFormat.cs
- BitmapEncoder.cs
- TreeNode.cs
- Keyboard.cs
- TransformPatternIdentifiers.cs
- EntryPointNotFoundException.cs
- SqlIdentifier.cs
- FlowDocumentReader.cs
- ExtendedProperty.cs
- RegisteredScript.cs
- ContextMenuStripActionList.cs
- XmlSchemaObject.cs
- ClientRolePrincipal.cs
- EvidenceTypeDescriptor.cs
- SerializeAbsoluteContext.cs
- ProxyWebPartConnectionCollection.cs
- BitmapEffectOutputConnector.cs
- IUnknownConstantAttribute.cs
- DataListItem.cs
- WebContext.cs
- FontDriver.cs
- RawKeyboardInputReport.cs
- SequentialUshortCollection.cs
- ObjectListItem.cs
- SqlCommandBuilder.cs
- DesignTimeVisibleAttribute.cs
- DesignerHelpers.cs
- MetricEntry.cs
- ZeroOpNode.cs
- DataGrid.cs
- PictureBoxDesigner.cs
- FigureParagraph.cs
- GradientSpreadMethodValidation.cs
- DataPager.cs
- baseaxisquery.cs
- QilXmlReader.cs
- PerformanceCounterLib.cs
- XmlSchemaObject.cs
- BufferedConnection.cs
- SoapHeaderException.cs
- filewebrequest.cs
- NativeObjectSecurity.cs
- HttpSessionStateBase.cs
- DesignerWidgets.cs
- DataSetViewSchema.cs
- ContextMenuService.cs
- TypeConverters.cs
- ListBindingHelper.cs
- ProtocolsSection.cs
- Comparer.cs
- cookie.cs
- MustUnderstandBehavior.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- SafeBitVector32.cs
- SoapIgnoreAttribute.cs
- SerializableAttribute.cs
- TabPanel.cs
- StandardBindingReliableSessionElement.cs
- ThreadStateException.cs
- BuildProvidersCompiler.cs
- _StreamFramer.cs
- DataGridViewCell.cs
- AutomationPropertyInfo.cs
- ConfigXmlSignificantWhitespace.cs
- PathSegmentCollection.cs
- coordinatorscratchpad.cs
- FlagsAttribute.cs
- __Error.cs
- SmiConnection.cs
- ComNativeDescriptor.cs
- FlatButtonAppearance.cs