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
- PropertyBuilder.cs
- ImageUrlEditor.cs
- XmlDataImplementation.cs
- MsmqIntegrationBindingElement.cs
- XmlExpressionDumper.cs
- Int32AnimationUsingKeyFrames.cs
- ListViewSelectEventArgs.cs
- ToolStripScrollButton.cs
- safePerfProviderHandle.cs
- EventDescriptorCollection.cs
- HtmlSelect.cs
- MinMaxParagraphWidth.cs
- NgenServicingAttributes.cs
- SapiRecognizer.cs
- CursorConverter.cs
- MergeFilterQuery.cs
- WebBrowserEvent.cs
- SqlFileStream.cs
- KeyboardNavigation.cs
- SortQuery.cs
- ValidationRule.cs
- CompositeFontInfo.cs
- BinaryConverter.cs
- XsltOutput.cs
- ParserContext.cs
- DirectoryObjectSecurity.cs
- InputBindingCollection.cs
- WebPartConnectionsConnectVerb.cs
- DoubleConverter.cs
- D3DImage.cs
- StorageConditionPropertyMapping.cs
- Array.cs
- IHttpResponseInternal.cs
- Transactions.cs
- RuntimeTransactionHandle.cs
- UpdateTracker.cs
- WebPartZoneCollection.cs
- XmlSchemaExternal.cs
- ListContractAdapter.cs
- SqlUserDefinedAggregateAttribute.cs
- DoubleCollection.cs
- RowBinding.cs
- VerificationAttribute.cs
- EventLog.cs
- ToolStripDesignerAvailabilityAttribute.cs
- CodeIdentifiers.cs
- KeyboardDevice.cs
- GridViewItemAutomationPeer.cs
- InvalidEnumArgumentException.cs
- ReaderContextStackData.cs
- ClaimTypes.cs
- ProxyFragment.cs
- SystemColorTracker.cs
- ColorMatrix.cs
- MailAddressParser.cs
- LocalizationCodeDomSerializer.cs
- FreezableCollection.cs
- CodeArrayCreateExpression.cs
- SqlOuterApplyReducer.cs
- BinaryWriter.cs
- CacheVirtualItemsEvent.cs
- EncodingDataItem.cs
- CodeTypeMember.cs
- TransformedBitmap.cs
- XmlSchemaSimpleContentRestriction.cs
- UserControl.cs
- BrowserDefinition.cs
- clipboard.cs
- UriSection.cs
- StandardBindingElement.cs
- DiscreteKeyFrames.cs
- AdornerDecorator.cs
- AsyncPostBackTrigger.cs
- SqlConnectionPoolGroupProviderInfo.cs
- IntSecurity.cs
- TemplateDefinition.cs
- FontStyles.cs
- SerializationSectionGroup.cs
- UIElement3D.cs
- ZipIOLocalFileDataDescriptor.cs
- WizardPanelChangingEventArgs.cs
- TypeContext.cs
- WorkflowQueuingService.cs
- X509Certificate.cs
- WeakReferenceList.cs
- CompressStream.cs
- datacache.cs
- PrintingPermission.cs
- CompositeActivityCodeGenerator.cs
- DictionarySectionHandler.cs
- FieldAccessException.cs
- EntityModelBuildProvider.cs
- GuidTagList.cs
- XmlSchemaException.cs
- HtmlLabelAdapter.cs
- PropertyPushdownHelper.cs
- unsafenativemethodsother.cs
- PeerToPeerException.cs
- HttpApplication.cs
- HyperLinkColumn.cs