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
- Hashtable.cs
- ClassGenerator.cs
- SegmentTree.cs
- FilterEventArgs.cs
- UsernameTokenFactoryCredential.cs
- BindingCollection.cs
- XamlPoint3DCollectionSerializer.cs
- DropShadowBitmapEffect.cs
- ReferenceAssemblyAttribute.cs
- EmptyElement.cs
- SqlCacheDependencyDatabaseCollection.cs
- ISCIIEncoding.cs
- XamlFilter.cs
- TextTreeUndoUnit.cs
- XmlBinaryWriterSession.cs
- DropTarget.cs
- AuthStoreRoleProvider.cs
- BindingWorker.cs
- BamlMapTable.cs
- SapiRecoContext.cs
- CustomTrackingRecord.cs
- HtmlMeta.cs
- DataServiceException.cs
- FloatAverageAggregationOperator.cs
- SoapElementAttribute.cs
- Encoder.cs
- DelayedRegex.cs
- TdsParserStaticMethods.cs
- NegationPusher.cs
- ZipIOExtraField.cs
- BitmapSourceSafeMILHandle.cs
- CompModSwitches.cs
- PrimitiveType.cs
- ExpressionVisitorHelpers.cs
- TableItemStyle.cs
- ControlDesignerState.cs
- EntityClientCacheEntry.cs
- PrivilegedConfigurationManager.cs
- XmlFormatExtensionAttribute.cs
- DataListCommandEventArgs.cs
- RequestQueryProcessor.cs
- ApplicationHost.cs
- MouseGestureConverter.cs
- TextServicesContext.cs
- OdbcConnection.cs
- RightsDocument.cs
- oledbmetadatacollectionnames.cs
- NameSpaceEvent.cs
- TextServicesCompartmentContext.cs
- CollectionMarkupSerializer.cs
- GrabHandleGlyph.cs
- DispatcherOperation.cs
- EncryptedKeyHashIdentifierClause.cs
- ValidationEventArgs.cs
- SubpageParaClient.cs
- DispatchWrapper.cs
- CompilerWrapper.cs
- WorkflowRuntime.cs
- SqlRetyper.cs
- Menu.cs
- PathFigureCollectionConverter.cs
- PhoneCallDesigner.cs
- MimeXmlImporter.cs
- CachedCompositeFamily.cs
- StylusCaptureWithinProperty.cs
- JapaneseCalendar.cs
- PeerToPeerException.cs
- BaseAsyncResult.cs
- ScriptReference.cs
- StateFinalizationDesigner.cs
- TextTreeTextNode.cs
- EndOfStreamException.cs
- TypeUnloadedException.cs
- GroupQuery.cs
- OlePropertyStructs.cs
- x509utils.cs
- DateTimeConverter2.cs
- CopyNamespacesAction.cs
- BitmapSizeOptions.cs
- RepeatBehaviorConverter.cs
- ScriptResourceInfo.cs
- TableLayoutPanelCellPosition.cs
- EmptyElement.cs
- WebPartVerb.cs
- XpsS0ValidatingLoader.cs
- ChannelListenerBase.cs
- WsatServiceCertificate.cs
- MenuItem.cs
- IPPacketInformation.cs
- Comparer.cs
- PropertyInformationCollection.cs
- SqlLiftWhereClauses.cs
- ObservableCollection.cs
- DataPager.cs
- LinqDataSourceHelper.cs
- DropDownList.cs
- VirtualDirectoryMapping.cs
- DateTimeParse.cs
- FormsAuthenticationTicket.cs
- RuleInfoComparer.cs