Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Configuration / System / Configuration / CommaDelimitedStringAttributeCollectionConverter.cs / 1305376 / CommaDelimitedStringAttributeCollectionConverter.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
using System;
using System.Collections;
using System.IO;
using System.Reflection;
using System.Security.Permissions;
using System.Xml;
using System.Collections.Specialized;
using System.Globalization;
using System.ComponentModel;
using System.Security;
using System.Text;
namespace System.Configuration {
public sealed class CommaDelimitedStringCollectionConverter : ConfigurationConverterBase {
public override object ConvertTo(ITypeDescriptorContext ctx, CultureInfo ci, object value, Type type) {
ValidateType(value, typeof(CommaDelimitedStringCollection));
CommaDelimitedStringCollection internalValue = value as CommaDelimitedStringCollection;
if (internalValue != null) {
return internalValue.ToString();
}
else {
return null;
}
}
public override object ConvertFrom(ITypeDescriptorContext ctx, CultureInfo ci, object data) {
CommaDelimitedStringCollection attributeCollection = new CommaDelimitedStringCollection();
attributeCollection.FromString((string)data);
return attributeCollection;
}
}
}
// 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.IO;
using System.Reflection;
using System.Security.Permissions;
using System.Xml;
using System.Collections.Specialized;
using System.Globalization;
using System.ComponentModel;
using System.Security;
using System.Text;
namespace System.Configuration {
public sealed class CommaDelimitedStringCollectionConverter : ConfigurationConverterBase {
public override object ConvertTo(ITypeDescriptorContext ctx, CultureInfo ci, object value, Type type) {
ValidateType(value, typeof(CommaDelimitedStringCollection));
CommaDelimitedStringCollection internalValue = value as CommaDelimitedStringCollection;
if (internalValue != null) {
return internalValue.ToString();
}
else {
return null;
}
}
public override object ConvertFrom(ITypeDescriptorContext ctx, CultureInfo ci, object data) {
CommaDelimitedStringCollection attributeCollection = new CommaDelimitedStringCollection();
attributeCollection.FromString((string)data);
return attributeCollection;
}
}
}
// 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
- jithelpers.cs
- BlurBitmapEffect.cs
- ShutDownListener.cs
- TypeViewSchema.cs
- SQLDecimalStorage.cs
- OleDbRowUpdatedEvent.cs
- WrapPanel.cs
- KeyTimeConverter.cs
- TemplateManager.cs
- datacache.cs
- DocComment.cs
- ClusterRegistryConfigurationProvider.cs
- WindowsScrollBarBits.cs
- BlurBitmapEffect.cs
- FormsAuthentication.cs
- PersonalizationStateInfoCollection.cs
- PolyQuadraticBezierSegment.cs
- JpegBitmapDecoder.cs
- IfAction.cs
- XmlSerializerNamespaces.cs
- XamlSerializerUtil.cs
- MenuItem.cs
- DataColumn.cs
- EndpointDispatcherTable.cs
- BaseConfigurationRecord.cs
- xsdvalidator.cs
- followingquery.cs
- SessionSwitchEventArgs.cs
- OrderedDictionary.cs
- CalendarTable.cs
- OleDbEnumerator.cs
- ContextMenu.cs
- _NegotiateClient.cs
- Compiler.cs
- ProcessHost.cs
- BooleanAnimationBase.cs
- UITypeEditor.cs
- TextEditor.cs
- ProtocolsConfiguration.cs
- XmlEncoding.cs
- DbConnectionFactory.cs
- TypeInfo.cs
- SyndicationDeserializer.cs
- Permission.cs
- EntityDataSourceValidationException.cs
- CommandConverter.cs
- ObjectDataSourceSelectingEventArgs.cs
- TextEffect.cs
- TaskResultSetter.cs
- CounterNameConverter.cs
- SafeHandles.cs
- IssuanceTokenProviderBase.cs
- BaseDataBoundControlDesigner.cs
- SynchronizationScope.cs
- AssemblyAssociatedContentFileAttribute.cs
- PolicyLevel.cs
- HyperLinkColumn.cs
- BitStream.cs
- CultureMapper.cs
- XmlDocument.cs
- ChtmlCalendarAdapter.cs
- Timer.cs
- InstanceKey.cs
- DataGridViewAdvancedBorderStyle.cs
- unsafeIndexingFilterStream.cs
- LineBreakRecord.cs
- SymbolMethod.cs
- Models.cs
- ControlUtil.cs
- DiffuseMaterial.cs
- ItemChangedEventArgs.cs
- GeometryCollection.cs
- InputScopeAttribute.cs
- EntityClientCacheKey.cs
- WsdlEndpointConversionContext.cs
- ComponentChangedEvent.cs
- SqlDependency.cs
- ScrollPatternIdentifiers.cs
- WindowsAltTab.cs
- ThreadExceptionEvent.cs
- CompilerResults.cs
- Image.cs
- Translator.cs
- ProxyManager.cs
- DataGridViewMethods.cs
- AutomationAttributeInfo.cs
- PartManifestEntry.cs
- SignatureHelper.cs
- GacUtil.cs
- RectAnimationClockResource.cs
- SiteOfOriginPart.cs
- ScrollChrome.cs
- XmlSerializerFaultFormatter.cs
- ColumnMapTranslator.cs
- WebCategoryAttribute.cs
- ForEachAction.cs
- MemberJoinTreeNode.cs
- StringReader.cs
- LambdaCompiler.Binary.cs
- EntityWithChangeTrackerStrategy.cs