Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / Mail / SmtpAuthenticationManager.cs / 1305376 / SmtpAuthenticationManager.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Net.Mail
{
using System;
using System.Collections;
using System.IO;
using System.Net;
internal static class SmtpAuthenticationManager
{
static ArrayList modules = new ArrayList();
static SmtpAuthenticationManager()
{
//
#if !FEATURE_PAL
if (ComNetOS.IsWin2K)
{
// Negotiate supported only if Win2K or later
Register(new SmtpNegotiateAuthenticationModule());
}
Register(new SmtpNtlmAuthenticationModule());
Register(new SmtpDigestAuthenticationModule());
#endif // !FEATURE_PAL
Register(new SmtpLoginAuthenticationModule());
}
internal static void Register(ISmtpAuthenticationModule module)
{
if (module == null)
throw new ArgumentNullException("module");
lock (modules)
{
modules.Add(module);
}
}
/*
// Consider removing.
internal static void Unregister(ISmtpAuthenticationModule module)
{
if (module == null)
throw new ArgumentNullException("module");
lock (modules)
{
modules.Remove(module);
}
}
*/
/*
// Consider removing.
internal static void Unregister(string authenticationType)
{
if (authenticationType == null)
throw new ArgumentNullException("authenticationType");
lock (modules)
{
foreach (ISmtpAuthenticationModule module in modules)
{
if (0 == string.Compare(module.AuthenticationType, authenticationType, StringComparison.OrdinalIgnoreCase))
{
modules.Remove(module);
}
}
}
}
*/
internal static ISmtpAuthenticationModule[] GetModules()
{
lock (modules)
{
ISmtpAuthenticationModule[] copy = new ISmtpAuthenticationModule[modules.Count];
modules.CopyTo(0, copy, 0, modules.Count);
return copy;
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Net.Mail
{
using System;
using System.Collections;
using System.IO;
using System.Net;
internal static class SmtpAuthenticationManager
{
static ArrayList modules = new ArrayList();
static SmtpAuthenticationManager()
{
//
#if !FEATURE_PAL
if (ComNetOS.IsWin2K)
{
// Negotiate supported only if Win2K or later
Register(new SmtpNegotiateAuthenticationModule());
}
Register(new SmtpNtlmAuthenticationModule());
Register(new SmtpDigestAuthenticationModule());
#endif // !FEATURE_PAL
Register(new SmtpLoginAuthenticationModule());
}
internal static void Register(ISmtpAuthenticationModule module)
{
if (module == null)
throw new ArgumentNullException("module");
lock (modules)
{
modules.Add(module);
}
}
/*
// Consider removing.
internal static void Unregister(ISmtpAuthenticationModule module)
{
if (module == null)
throw new ArgumentNullException("module");
lock (modules)
{
modules.Remove(module);
}
}
*/
/*
// Consider removing.
internal static void Unregister(string authenticationType)
{
if (authenticationType == null)
throw new ArgumentNullException("authenticationType");
lock (modules)
{
foreach (ISmtpAuthenticationModule module in modules)
{
if (0 == string.Compare(module.AuthenticationType, authenticationType, StringComparison.OrdinalIgnoreCase))
{
modules.Remove(module);
}
}
}
}
*/
internal static ISmtpAuthenticationModule[] GetModules()
{
lock (modules)
{
ISmtpAuthenticationModule[] copy = new ISmtpAuthenticationModule[modules.Count];
modules.CopyTo(0, copy, 0, modules.Count);
return copy;
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- GeometryHitTestParameters.cs
- FixedPageProcessor.cs
- CompositeFontParser.cs
- TraceListeners.cs
- CompilerCollection.cs
- FlowLayoutPanelDesigner.cs
- MultipleViewProviderWrapper.cs
- RowUpdatedEventArgs.cs
- PageSetupDialog.cs
- TileModeValidation.cs
- RemoteWebConfigurationHost.cs
- MessageHeader.cs
- WSSecurityJan2004.cs
- CorrelationKeyCalculator.cs
- UndoManager.cs
- ManifestResourceInfo.cs
- cookiecontainer.cs
- WizardPanel.cs
- ImageFormat.cs
- CancellationTokenSource.cs
- SetIterators.cs
- PresentationTraceSources.cs
- CodeExpressionStatement.cs
- GetCryptoTransformRequest.cs
- FixedStringLookup.cs
- ListViewContainer.cs
- TimerElapsedEvenArgs.cs
- HttpValueCollection.cs
- BitmapEffectDrawingContextState.cs
- SubMenuStyleCollectionEditor.cs
- TransformedBitmap.cs
- DataGridViewButtonColumn.cs
- Rect3DConverter.cs
- Triplet.cs
- BypassElementCollection.cs
- QueryOpcode.cs
- SR.cs
- CodeGenerator.cs
- ArrayList.cs
- MDIControlStrip.cs
- ConfigurationConverterBase.cs
- ManagementOptions.cs
- ClientSideQueueItem.cs
- LinkArea.cs
- ScalarRestriction.cs
- StrokeNodeOperations2.cs
- TableLayoutPanel.cs
- UnSafeCharBuffer.cs
- GPStream.cs
- ToolboxItemCollection.cs
- Vector3DCollection.cs
- wgx_sdk_version.cs
- AsyncSerializedWorker.cs
- jithelpers.cs
- ResourceReferenceExpressionConverter.cs
- StackSpiller.Generated.cs
- BaseCodeDomTreeGenerator.cs
- WindowsScrollBar.cs
- SelectorItemAutomationPeer.cs
- BackEase.cs
- Timeline.cs
- PeerEndPoint.cs
- TrackingRecord.cs
- SmtpMail.cs
- MobileListItemCollection.cs
- RequestTimeoutManager.cs
- HtmlInputRadioButton.cs
- AssemblyContextControlItem.cs
- StatusBarDesigner.cs
- ResourceCategoryAttribute.cs
- XmlSchemaSimpleContent.cs
- DataGridTablesFactory.cs
- Control.cs
- sqlpipe.cs
- MultipartContentParser.cs
- CodePageUtils.cs
- URIFormatException.cs
- TouchFrameEventArgs.cs
- XmlSchemaSequence.cs
- ApplicationSecurityManager.cs
- ProtectedConfigurationSection.cs
- Visual3DCollection.cs
- ProxyElement.cs
- MouseButton.cs
- hresults.cs
- InputReportEventArgs.cs
- DataGridColumnHeadersPresenter.cs
- NativeObjectSecurity.cs
- ReachPageContentCollectionSerializerAsync.cs
- AnimationClockResource.cs
- CustomAssemblyResolver.cs
- AnonymousIdentificationModule.cs
- ClientFactory.cs
- FixedFlowMap.cs
- TemplateParser.cs
- DBAsyncResult.cs
- XmlUtilWriter.cs
- FtpCachePolicyElement.cs
- MouseEvent.cs
- DataDocumentXPathNavigator.cs