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
- UnknownWrapper.cs
- EntityDataSourceReferenceGroup.cs
- LineBreak.cs
- AssemblyAttributes.cs
- sqlinternaltransaction.cs
- PageCodeDomTreeGenerator.cs
- FrameworkContentElement.cs
- ReferencedType.cs
- WorkflowItemPresenter.cs
- DateTimeFormat.cs
- TextHidden.cs
- VirtualPath.cs
- TraceHwndHost.cs
- GenerateHelper.cs
- CharacterMetricsDictionary.cs
- DataServiceResponse.cs
- MessageBox.cs
- SqlConnectionManager.cs
- RestClientProxyHandler.cs
- DynamicScriptObject.cs
- ContentFilePart.cs
- CatalogZoneBase.cs
- InputBinder.cs
- BooleanProjectedSlot.cs
- ClientBuildManager.cs
- ChtmlTextBoxAdapter.cs
- HtmlElementEventArgs.cs
- KnownTypeHelper.cs
- SynchronizationLockException.cs
- SqlDependencyUtils.cs
- XmlStreamedByteStreamReader.cs
- SqlTriggerAttribute.cs
- WorkflowOperationFault.cs
- RunClient.cs
- XmlSchemaException.cs
- WindowsListBox.cs
- Or.cs
- NameValueFileSectionHandler.cs
- FloaterParagraph.cs
- ColorTransformHelper.cs
- ParallelActivityDesigner.cs
- RewritingProcessor.cs
- HitTestParameters3D.cs
- DispatcherSynchronizationContext.cs
- MenuAdapter.cs
- MailFileEditor.cs
- DateTimePicker.cs
- PeerApplication.cs
- XmlSchemaObjectCollection.cs
- HotSpotCollection.cs
- WorkflowDesignerMessageFilter.cs
- DrawListViewSubItemEventArgs.cs
- MetadataResolver.cs
- GridViewAutomationPeer.cs
- ParamArrayAttribute.cs
- BoundField.cs
- UserControlDesigner.cs
- XmlUTF8TextReader.cs
- DynamicDataManager.cs
- ProtocolViolationException.cs
- ClientSideProviderDescription.cs
- RenamedEventArgs.cs
- TextInfo.cs
- Expression.cs
- DataGridViewCellParsingEventArgs.cs
- EntityContainerAssociationSetEnd.cs
- OutputScopeManager.cs
- PartitionResolver.cs
- ZipFileInfoCollection.cs
- IriParsingElement.cs
- DataGridViewUtilities.cs
- BitmapEffectInputData.cs
- CodePageUtils.cs
- RawUIStateInputReport.cs
- ResourcesBuildProvider.cs
- MsmqProcessProtocolHandler.cs
- Subtract.cs
- TypeSystem.cs
- GenericIdentity.cs
- AppLevelCompilationSectionCache.cs
- XmlILAnnotation.cs
- DateTimeFormatInfo.cs
- WindowsImpersonationContext.cs
- DbProviderServices.cs
- TreeViewImageIndexConverter.cs
- StartFileNameEditor.cs
- WeakReference.cs
- Effect.cs
- SharedPersonalizationStateInfo.cs
- TypeNameHelper.cs
- RadioButtonStandardAdapter.cs
- PackageDigitalSignature.cs
- TextElement.cs
- Marshal.cs
- PreviewKeyDownEventArgs.cs
- TTSEvent.cs
- ParsedAttributeCollection.cs
- DataTableMappingCollection.cs
- FormsAuthenticationTicket.cs
- ColumnWidthChangedEvent.cs