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 / MailAddressCollection.cs / 1 / MailAddressCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net.Mail { using System; using System.Collections; using System.Collections.ObjectModel; using System.Text; using System.Net.Mime; public class MailAddressCollection: Collection{ public MailAddressCollection(){ } public void Add(string addresses) { if (addresses == null) { throw new ArgumentNullException("addresses"); } if (addresses == string.Empty) { throw new ArgumentException(SR.GetString(SR.net_emptystringcall, "addresses"), "addresses"); } ParseValue(addresses); } /* // Consider removing. internal void Populate(string[] addresses) { if (addresses == null) { throw new ArgumentNullException("addresses"); } if (addresses.Length == 0) { throw new ArgumentException(SR.GetString(SR.net_emptystringcall, "addresses"), "addresses"); } ParseValue(addresses); } */ protected override void SetItem(int index, MailAddress item){ if(item==null) { throw new ArgumentNullException("item"); } base.SetItem(index,item); } protected override void InsertItem(int index, MailAddress item){ if(item==null){ throw new ArgumentNullException("item"); } base.InsertItem(index,item); } /* // Consider removing. internal bool IsChanged { get { return this.isChanged; } set { this.isChanged = value; } } */ /* // Consider removing. internal void ParseValue(string[] addresses) { for (int i = 0; i < addresses.Length; i++) { int offset = 0; MailAddress address = MailBnfHelper.ReadMailAddress(addresses[i],ref offset); if (address == null) break; this.Add(address); } } */ internal void ParseValue(string addresses) { for (int offset = 0; offset < addresses.Length; offset++) { MailAddress address = MailBnfHelper.ReadMailAddress(addresses, ref offset); if (address == null) break; this.Add(address); if (!MailBnfHelper.SkipCFWS(addresses, ref offset) || addresses[offset] != ',') break; } } internal string ToEncodedString() { bool first = true; StringBuilder builder = new StringBuilder(); foreach (MailAddress address in this) { if (!first) { builder.Append(", "); } builder.Append(address.ToEncodedString()); first = false; } return builder.ToString();; } public override string ToString() { bool first = true; StringBuilder builder = new StringBuilder(); foreach (MailAddress address in this) { if (!first) { builder.Append(", "); } builder.Append(address.ToString()); first = false; } return builder.ToString();; } /* // Consider removing. internal string ToAddressString() { bool first = true; StringBuilder builder = new StringBuilder(); foreach (MailAddress address in this) { if (!first) { builder.Append(", "); } builder.Append(address.Address); first = false; } return builder.ToString();; } */ } } // 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.Collections.ObjectModel; using System.Text; using System.Net.Mime; public class MailAddressCollection: Collection{ public MailAddressCollection(){ } public void Add(string addresses) { if (addresses == null) { throw new ArgumentNullException("addresses"); } if (addresses == string.Empty) { throw new ArgumentException(SR.GetString(SR.net_emptystringcall, "addresses"), "addresses"); } ParseValue(addresses); } /* // Consider removing. internal void Populate(string[] addresses) { if (addresses == null) { throw new ArgumentNullException("addresses"); } if (addresses.Length == 0) { throw new ArgumentException(SR.GetString(SR.net_emptystringcall, "addresses"), "addresses"); } ParseValue(addresses); } */ protected override void SetItem(int index, MailAddress item){ if(item==null) { throw new ArgumentNullException("item"); } base.SetItem(index,item); } protected override void InsertItem(int index, MailAddress item){ if(item==null){ throw new ArgumentNullException("item"); } base.InsertItem(index,item); } /* // Consider removing. internal bool IsChanged { get { return this.isChanged; } set { this.isChanged = value; } } */ /* // Consider removing. internal void ParseValue(string[] addresses) { for (int i = 0; i < addresses.Length; i++) { int offset = 0; MailAddress address = MailBnfHelper.ReadMailAddress(addresses[i],ref offset); if (address == null) break; this.Add(address); } } */ internal void ParseValue(string addresses) { for (int offset = 0; offset < addresses.Length; offset++) { MailAddress address = MailBnfHelper.ReadMailAddress(addresses, ref offset); if (address == null) break; this.Add(address); if (!MailBnfHelper.SkipCFWS(addresses, ref offset) || addresses[offset] != ',') break; } } internal string ToEncodedString() { bool first = true; StringBuilder builder = new StringBuilder(); foreach (MailAddress address in this) { if (!first) { builder.Append(", "); } builder.Append(address.ToEncodedString()); first = false; } return builder.ToString();; } public override string ToString() { bool first = true; StringBuilder builder = new StringBuilder(); foreach (MailAddress address in this) { if (!first) { builder.Append(", "); } builder.Append(address.ToString()); first = false; } return builder.ToString();; } /* // Consider removing. internal string ToAddressString() { bool first = true; StringBuilder builder = new StringBuilder(); foreach (MailAddress address in this) { if (!first) { builder.Append(", "); } builder.Append(address.Address); first = false; } return builder.ToString();; } */ } } // 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
- HwndSource.cs
- ArrayElementGridEntry.cs
- BindingManagerDataErrorEventArgs.cs
- PeerResolverBindingElement.cs
- DynamicDataRoute.cs
- TdsParserStateObject.cs
- HttpWebRequestElement.cs
- ResourceContainer.cs
- WorkItem.cs
- HtmlButton.cs
- SiteOfOriginPart.cs
- ObjectItemNoOpAssemblyLoader.cs
- WebPartMovingEventArgs.cs
- TraversalRequest.cs
- EnterpriseServicesHelper.cs
- CompModSwitches.cs
- XMLSchema.cs
- PrintDialog.cs
- DataQuery.cs
- BatchServiceHost.cs
- NativeMethodsOther.cs
- SecurityElement.cs
- InvalidPrinterException.cs
- MapPathBasedVirtualPathProvider.cs
- ComPlusDiagnosticTraceRecords.cs
- SecurityTokenValidationException.cs
- MulticastOption.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- Schema.cs
- BindingSource.cs
- TextComposition.cs
- MimeMapping.cs
- ProcessHostMapPath.cs
- ArgumentException.cs
- SqlInfoMessageEvent.cs
- ToolStripSettings.cs
- InvokePattern.cs
- OrderingQueryOperator.cs
- LOSFormatter.cs
- ButtonFlatAdapter.cs
- UnsafeNativeMethods.cs
- base64Transforms.cs
- WinInetCache.cs
- SwitchLevelAttribute.cs
- CatalogZoneAutoFormat.cs
- WindowAutomationPeer.cs
- AppDomainGrammarProxy.cs
- AuthenticateEventArgs.cs
- HierarchicalDataSourceDesigner.cs
- BaseServiceProvider.cs
- WebPartConnection.cs
- ColorConverter.cs
- FixedDocumentPaginator.cs
- TagMapInfo.cs
- SerializationEventsCache.cs
- SQLDoubleStorage.cs
- RectAnimationBase.cs
- UserControl.cs
- ProviderConnectionPoint.cs
- NumberFunctions.cs
- DataGridViewTopLeftHeaderCell.cs
- SizeConverter.cs
- DirectionalLight.cs
- Simplifier.cs
- WindowClosedEventArgs.cs
- _ShellExpression.cs
- ServiceProviders.cs
- ToolboxItemFilterAttribute.cs
- RtType.cs
- PeerNameRegistration.cs
- TextBox.cs
- ExtractorMetadata.cs
- ColumnMapProcessor.cs
- SoapFault.cs
- Rfc2898DeriveBytes.cs
- TransformerInfoCollection.cs
- TabControl.cs
- ProcessHostServerConfig.cs
- EventWaitHandle.cs
- RectConverter.cs
- SetterTriggerConditionValueConverter.cs
- Expression.cs
- SqlProfileProvider.cs
- ConstraintConverter.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- OdbcParameter.cs
- MetadataUtilsSmi.cs
- TextDecorations.cs
- DiffuseMaterial.cs
- ClientBuildManager.cs
- EditorZone.cs
- WarningException.cs
- ByteStorage.cs
- DateTimeSerializationSection.cs
- CatalogPartCollection.cs
- Tablet.cs
- Int32AnimationBase.cs
- Section.cs
- FileResponseElement.cs
- CodeDefaultValueExpression.cs