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
- NativeActivityTransactionContext.cs
- FrameDimension.cs
- GPRECTF.cs
- PieceDirectory.cs
- InternalSafeNativeMethods.cs
- DataGridViewControlCollection.cs
- HtmlControl.cs
- WCFModelStrings.Designer.cs
- WizardPanelChangingEventArgs.cs
- Rule.cs
- UserControlBuildProvider.cs
- DescendentsWalkerBase.cs
- BamlLocalizableResource.cs
- ViewSimplifier.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- DropShadowBitmapEffect.cs
- XappLauncher.cs
- TableColumnCollectionInternal.cs
- GACMembershipCondition.cs
- Label.cs
- ValidatorCollection.cs
- CodeArgumentReferenceExpression.cs
- WebBrowserNavigatingEventHandler.cs
- MultipleViewProviderWrapper.cs
- ChannelManager.cs
- FileCodeGroup.cs
- CompositionDesigner.cs
- Number.cs
- SHA512CryptoServiceProvider.cs
- GenericIdentity.cs
- MatrixCamera.cs
- InternalConfigEventArgs.cs
- IOThreadTimer.cs
- infer.cs
- BufferedGraphicsManager.cs
- ToolStripGrip.cs
- SocketInformation.cs
- DataGridViewTextBoxEditingControl.cs
- SqlWebEventProvider.cs
- ManifestSignatureInformation.cs
- ScrollChangedEventArgs.cs
- BitmapPalette.cs
- LongTypeConverter.cs
- AnimatedTypeHelpers.cs
- XsltOutput.cs
- InputLangChangeEvent.cs
- FramingChannels.cs
- BuilderPropertyEntry.cs
- ScrollBarRenderer.cs
- QueryCacheEntry.cs
- BitConverter.cs
- ReadOnlyHierarchicalDataSourceView.cs
- ThreadExceptionEvent.cs
- StringDictionary.cs
- System.Data.OracleClient_BID.cs
- XmlSchemaRedefine.cs
- NumericExpr.cs
- ConditionBrowserDialog.cs
- JapaneseLunisolarCalendar.cs
- XpsFontSubsetter.cs
- ValueChangedEventManager.cs
- WebContext.cs
- ComplexBindingPropertiesAttribute.cs
- SemaphoreSecurity.cs
- LayoutEditorPart.cs
- DetailsViewInsertEventArgs.cs
- SqlBuilder.cs
- SafeRightsManagementHandle.cs
- SystemColorTracker.cs
- UserControl.cs
- UserMapPath.cs
- WorkflowInlining.cs
- StateMachine.cs
- SapiRecoInterop.cs
- DurableInstanceProvider.cs
- DataRowCollection.cs
- PropertyManager.cs
- ProgressChangedEventArgs.cs
- AnimatedTypeHelpers.cs
- FontClient.cs
- WindowsListViewItemStartMenu.cs
- VerticalAlignConverter.cs
- DecoderFallback.cs
- RuntimeCompatibilityAttribute.cs
- SqlComparer.cs
- UIElementIsland.cs
- WebScriptMetadataFormatter.cs
- MetadataUtil.cs
- basenumberconverter.cs
- SetIndexBinder.cs
- RegexCaptureCollection.cs
- AutoGeneratedField.cs
- Html32TextWriter.cs
- TransformDescriptor.cs
- NullableIntSumAggregationOperator.cs
- Activator.cs
- InputProcessorProfilesLoader.cs
- TreeView.cs
- DataGridViewSortCompareEventArgs.cs
- FileStream.cs