Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / Net / System / Net / Mail / SmtpFailedRecipientsException.cs / 1 / SmtpFailedRecipientsException.cs
using System;
using System.Collections;
using System.Runtime.Serialization;
using System.Security.Permissions;
namespace System.Net.Mail
{
///
/// Summary description for SmtpFailedRecipientsException.
///
[Serializable]
public class SmtpFailedRecipientsException : SmtpFailedRecipientException, ISerializable
{
SmtpFailedRecipientException[] innerExceptions;
// FxCop
public SmtpFailedRecipientsException()
{
innerExceptions = new SmtpFailedRecipientException[0];
}
public SmtpFailedRecipientsException(string message) : base(message)
{
innerExceptions = new SmtpFailedRecipientException[0];
}
public SmtpFailedRecipientsException(string message, Exception innerException) : base(message, innerException)
{
SmtpFailedRecipientException smtpException = innerException as SmtpFailedRecipientException;
this.innerExceptions = smtpException == null ? new SmtpFailedRecipientException[0] : new SmtpFailedRecipientException[] { smtpException };
}
protected SmtpFailedRecipientsException(SerializationInfo info, StreamingContext context) : base(info, context)
{
innerExceptions = (SmtpFailedRecipientException[]) info.GetValue("innerExceptions", typeof(SmtpFailedRecipientException[]));
}
public SmtpFailedRecipientsException(string message, SmtpFailedRecipientException[] innerExceptions) :
base(message, innerExceptions != null && innerExceptions.Length > 0 ? innerExceptions[0].FailedRecipient : null,
innerExceptions != null && innerExceptions.Length > 0 ? innerExceptions[0] : null)
{
if (innerExceptions == null)
{
throw new ArgumentNullException("innerExceptions");
}
this.innerExceptions = innerExceptions == null ? new SmtpFailedRecipientException[0] : innerExceptions;
}
internal SmtpFailedRecipientsException(ArrayList innerExceptions, bool allFailed) :
base(allFailed ? SR.GetString(SR.SmtpAllRecipientsFailed) : SR.GetString(SR.SmtpRecipientFailed),
innerExceptions != null && innerExceptions.Count > 0 ? ((SmtpFailedRecipientException) innerExceptions[0]).FailedRecipient : null,
innerExceptions != null && innerExceptions.Count > 0 ? (SmtpFailedRecipientException) innerExceptions[0] : null)
{
if (innerExceptions == null)
{
throw new ArgumentNullException("innerExceptions");
}
this.innerExceptions = new SmtpFailedRecipientException[innerExceptions.Count];
int i = 0;
foreach(SmtpFailedRecipientException e in innerExceptions) {
this.innerExceptions[i++]=e;
}
}
public SmtpFailedRecipientException[] InnerExceptions
{
get
{
return innerExceptions;
}
}
//
// ISerializable
//
///
[SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.SerializationFormatter)]
void ISerializable.GetObjectData(SerializationInfo serializationInfo, StreamingContext streamingContext)
{
GetObjectData(serializationInfo, streamingContext);
}
//
// FxCop: provide some way for derived classes to access GetObjectData even if the derived class
// explicitly re-inherits ISerializable.
//
[SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.SerializationFormatter)]
public override void GetObjectData(SerializationInfo serializationInfo, StreamingContext streamingContext)
{
base.GetObjectData(serializationInfo, streamingContext);
serializationInfo.AddValue("innerExceptions", innerExceptions, typeof(SmtpFailedRecipientException[]));
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
using System;
using System.Collections;
using System.Runtime.Serialization;
using System.Security.Permissions;
namespace System.Net.Mail
{
///
/// Summary description for SmtpFailedRecipientsException.
///
[Serializable]
public class SmtpFailedRecipientsException : SmtpFailedRecipientException, ISerializable
{
SmtpFailedRecipientException[] innerExceptions;
// FxCop
public SmtpFailedRecipientsException()
{
innerExceptions = new SmtpFailedRecipientException[0];
}
public SmtpFailedRecipientsException(string message) : base(message)
{
innerExceptions = new SmtpFailedRecipientException[0];
}
public SmtpFailedRecipientsException(string message, Exception innerException) : base(message, innerException)
{
SmtpFailedRecipientException smtpException = innerException as SmtpFailedRecipientException;
this.innerExceptions = smtpException == null ? new SmtpFailedRecipientException[0] : new SmtpFailedRecipientException[] { smtpException };
}
protected SmtpFailedRecipientsException(SerializationInfo info, StreamingContext context) : base(info, context)
{
innerExceptions = (SmtpFailedRecipientException[]) info.GetValue("innerExceptions", typeof(SmtpFailedRecipientException[]));
}
public SmtpFailedRecipientsException(string message, SmtpFailedRecipientException[] innerExceptions) :
base(message, innerExceptions != null && innerExceptions.Length > 0 ? innerExceptions[0].FailedRecipient : null,
innerExceptions != null && innerExceptions.Length > 0 ? innerExceptions[0] : null)
{
if (innerExceptions == null)
{
throw new ArgumentNullException("innerExceptions");
}
this.innerExceptions = innerExceptions == null ? new SmtpFailedRecipientException[0] : innerExceptions;
}
internal SmtpFailedRecipientsException(ArrayList innerExceptions, bool allFailed) :
base(allFailed ? SR.GetString(SR.SmtpAllRecipientsFailed) : SR.GetString(SR.SmtpRecipientFailed),
innerExceptions != null && innerExceptions.Count > 0 ? ((SmtpFailedRecipientException) innerExceptions[0]).FailedRecipient : null,
innerExceptions != null && innerExceptions.Count > 0 ? (SmtpFailedRecipientException) innerExceptions[0] : null)
{
if (innerExceptions == null)
{
throw new ArgumentNullException("innerExceptions");
}
this.innerExceptions = new SmtpFailedRecipientException[innerExceptions.Count];
int i = 0;
foreach(SmtpFailedRecipientException e in innerExceptions) {
this.innerExceptions[i++]=e;
}
}
public SmtpFailedRecipientException[] InnerExceptions
{
get
{
return innerExceptions;
}
}
//
// ISerializable
//
///
[SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.SerializationFormatter)]
void ISerializable.GetObjectData(SerializationInfo serializationInfo, StreamingContext streamingContext)
{
GetObjectData(serializationInfo, streamingContext);
}
//
// FxCop: provide some way for derived classes to access GetObjectData even if the derived class
// explicitly re-inherits ISerializable.
//
[SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.SerializationFormatter)]
public override void GetObjectData(SerializationInfo serializationInfo, StreamingContext streamingContext)
{
base.GetObjectData(serializationInfo, streamingContext);
serializationInfo.AddValue("innerExceptions", innerExceptions, typeof(SmtpFailedRecipientException[]));
}
}
}
// 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
- XmlValidatingReaderImpl.cs
- SemaphoreFullException.cs
- ObjectDataSourceSelectingEventArgs.cs
- BaseComponentEditor.cs
- FileNameEditor.cs
- IntranetCredentialPolicy.cs
- TokenBasedSetEnumerator.cs
- DefaultProxySection.cs
- XmlKeywords.cs
- SqlTypeConverter.cs
- SemanticBasicElement.cs
- TimeZone.cs
- ValueTable.cs
- ComponentResourceManager.cs
- HttpContextServiceHost.cs
- NativeBuffer.cs
- Vector3DCollection.cs
- WebPartMinimizeVerb.cs
- DocumentPage.cs
- IssuedTokenParametersElement.cs
- Expressions.cs
- XPathChildIterator.cs
- XmlElementAttributes.cs
- StyleSelector.cs
- ColumnPropertiesGroup.cs
- MessageQueueException.cs
- HostAdapter.cs
- SurrogateDataContract.cs
- AuthStoreRoleProvider.cs
- _Rfc2616CacheValidators.cs
- Function.cs
- TextRangeBase.cs
- DesignerAutoFormatCollection.cs
- SupportsEventValidationAttribute.cs
- Repeater.cs
- DataSourceCache.cs
- ReadOnlyPropertyMetadata.cs
- DesignerTransactionCloseEvent.cs
- StatusCommandUI.cs
- ParameterElement.cs
- TypeNameParser.cs
- EventWaitHandleSecurity.cs
- DocumentStatusResources.cs
- PagerStyle.cs
- XmlSerializerFactory.cs
- OutputScopeManager.cs
- ProcessModelSection.cs
- ObjectListField.cs
- EntityDesignerUtils.cs
- DefaultProxySection.cs
- Lease.cs
- CorePropertiesFilter.cs
- PermissionRequestEvidence.cs
- PlatformCulture.cs
- SoapMessage.cs
- UnsafePeerToPeerMethods.cs
- IsolatedStorageException.cs
- TrackBarDesigner.cs
- WorkflowApplicationEventArgs.cs
- Cursor.cs
- GuidTagList.cs
- WindowsListViewItemCheckBox.cs
- UnsafeCollabNativeMethods.cs
- AudioDeviceOut.cs
- DataGridViewHeaderCell.cs
- BuilderPropertyEntry.cs
- CommentEmitter.cs
- Bold.cs
- elementinformation.cs
- ExpandCollapseProviderWrapper.cs
- Manipulation.cs
- SubclassTypeValidatorAttribute.cs
- ContextActivityUtils.cs
- WebPartConnectionsCancelVerb.cs
- DesignerCategoryAttribute.cs
- InstancePersistenceCommand.cs
- ActivityBindForm.Designer.cs
- HotSpot.cs
- WindowsIdentity.cs
- EntityCommandExecutionException.cs
- ImageListUtils.cs
- SqlCommand.cs
- GPRECTF.cs
- Converter.cs
- SimpleHandlerBuildProvider.cs
- PreloadedPackages.cs
- TemplateBindingExpressionConverter.cs
- RowParagraph.cs
- SqlCacheDependency.cs
- Part.cs
- ConstrainedGroup.cs
- ToolboxItemCollection.cs
- ITextView.cs
- ComplexLine.cs
- IndexingContentUnit.cs
- SafeNativeMethods.cs
- TabPanel.cs
- UriTemplate.cs
- EFTableProvider.cs
- TabControlDesigner.cs