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
- MessageBuffer.cs
- PermissionListSet.cs
- sqlmetadatafactory.cs
- _FtpDataStream.cs
- NavigationEventArgs.cs
- DateTimeUtil.cs
- ViewPort3D.cs
- ReferenceEqualityComparer.cs
- HierarchicalDataSourceControl.cs
- PaginationProgressEventArgs.cs
- FileSystemWatcher.cs
- DelayDesigner.cs
- AdornerHitTestResult.cs
- MinimizableAttributeTypeConverter.cs
- HitTestWithGeometryDrawingContextWalker.cs
- Attachment.cs
- CryptographicAttribute.cs
- Error.cs
- DataGridTextBox.cs
- CodeBlockBuilder.cs
- Soap.cs
- RichListBox.cs
- RequestStatusBarUpdateEventArgs.cs
- ColumnReorderedEventArgs.cs
- BinaryFormatterWriter.cs
- DateTimeValueSerializer.cs
- Font.cs
- ListItemParagraph.cs
- GroupBoxRenderer.cs
- codemethodreferenceexpression.cs
- GeometryModel3D.cs
- ContainerControl.cs
- Script.cs
- ArrayWithOffset.cs
- MulticastNotSupportedException.cs
- ResourceCategoryAttribute.cs
- AssertFilter.cs
- ControlTemplate.cs
- SecurityHeaderTokenResolver.cs
- PersonalizationStateInfoCollection.cs
- TextBox.cs
- QilInvoke.cs
- DataGridViewUtilities.cs
- SingleResultAttribute.cs
- OptimalBreakSession.cs
- COM2Enum.cs
- EndPoint.cs
- ButtonBase.cs
- TextBoxBase.cs
- AutomationFocusChangedEventArgs.cs
- TemplateBindingExtension.cs
- HttpPostedFile.cs
- XmlQueryOutput.cs
- Win32MouseDevice.cs
- DataGridViewSelectedCellCollection.cs
- XmlElementAttribute.cs
- RowBinding.cs
- InternalRelationshipCollection.cs
- CompilationAssemblyInstallComponent.cs
- ViewBox.cs
- processwaithandle.cs
- CodeAttributeDeclarationCollection.cs
- VScrollProperties.cs
- StringHandle.cs
- Expressions.cs
- ContextInformation.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- NamespaceInfo.cs
- CheckBoxRenderer.cs
- AttributeCollection.cs
- SortAction.cs
- MethodToken.cs
- TextProperties.cs
- ImageIndexConverter.cs
- VectorAnimationUsingKeyFrames.cs
- XsltFunctions.cs
- MemoryRecordBuffer.cs
- ellipse.cs
- MachineKeyConverter.cs
- CursorConverter.cs
- DivideByZeroException.cs
- ToolBarButton.cs
- SourceChangedEventArgs.cs
- MimePart.cs
- DataControlLinkButton.cs
- ListItem.cs
- EventDescriptorCollection.cs
- RenamedEventArgs.cs
- DbgUtil.cs
- SrgsRulesCollection.cs
- TreeNodeCollection.cs
- StrokeNode.cs
- altserialization.cs
- QuaternionKeyFrameCollection.cs
- ThrowHelper.cs
- OracleInfoMessageEventArgs.cs
- ISO2022Encoding.cs
- KeyedCollection.cs
- CalendarData.cs
- Vector3D.cs