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
- DbConnectionClosed.cs
- PasswordRecovery.cs
- LicenseManager.cs
- CodeDelegateInvokeExpression.cs
- PageParser.cs
- Renderer.cs
- RowToFieldTransformer.cs
- ExpressionDumper.cs
- HtmlTextArea.cs
- OracleLob.cs
- SyndicationPerson.cs
- SatelliteContractVersionAttribute.cs
- StyleBamlTreeBuilder.cs
- Pair.cs
- EntryIndex.cs
- MemberMemberBinding.cs
- Page.cs
- Transform3DGroup.cs
- SafeTimerHandle.cs
- HttpWebRequestElement.cs
- OpenTypeLayoutCache.cs
- IdnMapping.cs
- ColorPalette.cs
- Hyperlink.cs
- FixedPageProcessor.cs
- COM2Properties.cs
- ApplicationServicesHostFactory.cs
- login.cs
- DocumentReferenceCollection.cs
- DbConnectionPoolIdentity.cs
- SuppressIldasmAttribute.cs
- DbSetClause.cs
- ProfileModule.cs
- CommonXSendMessage.cs
- LineSegment.cs
- SpotLight.cs
- HtmlInputPassword.cs
- ToolBarButtonClickEvent.cs
- SimpleApplicationHost.cs
- PersonalizablePropertyEntry.cs
- GridViewColumnHeaderAutomationPeer.cs
- ObjectParameterCollection.cs
- WriteFileContext.cs
- XmlSchemaAnnotated.cs
- FormattedText.cs
- InputProviderSite.cs
- ClipboardProcessor.cs
- COM2ExtendedBrowsingHandler.cs
- XmlBinaryReaderSession.cs
- SqlTypesSchemaImporter.cs
- __Error.cs
- ConnectionManagementElement.cs
- HotSpotCollectionEditor.cs
- IsolatedStorageFile.cs
- SubMenuStyleCollection.cs
- RangeValueProviderWrapper.cs
- CommonObjectSecurity.cs
- DocumentEventArgs.cs
- ClientUtils.cs
- TransactionWaitAsyncResult.cs
- XmlCharType.cs
- PreDigestedSignedInfo.cs
- ReflectTypeDescriptionProvider.cs
- rsa.cs
- PositiveTimeSpanValidator.cs
- PackagingUtilities.cs
- ListenerElementsCollection.cs
- UnsafeMethods.cs
- MasterPageBuildProvider.cs
- TypeProvider.cs
- XmlByteStreamWriter.cs
- ResourcePart.cs
- ControlValuePropertyAttribute.cs
- VariableAction.cs
- EventBuilder.cs
- DesignerForm.cs
- ListComponentEditorPage.cs
- _AuthenticationState.cs
- GenericRootAutomationPeer.cs
- TextRunCacheImp.cs
- WorkflowInstanceProxy.cs
- RijndaelManagedTransform.cs
- TablePattern.cs
- BindingContext.cs
- ScriptControl.cs
- KeyFrames.cs
- SqlDataSourceEnumerator.cs
- ResourceReferenceExpressionConverter.cs
- UIHelper.cs
- CompositeDuplexBindingElement.cs
- MeasureItemEvent.cs
- TableFieldsEditor.cs
- DataGridViewCellPaintingEventArgs.cs
- EditorBrowsableAttribute.cs
- ADMembershipUser.cs
- Helper.cs
- ObjectToken.cs
- ConnectionDemuxer.cs
- XmlWriterSettings.cs
- WinCategoryAttribute.cs