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
- PasswordRecovery.cs
- SmtpFailedRecipientException.cs
- BuiltInExpr.cs
- ValueSerializer.cs
- ApplicationBuildProvider.cs
- DockPatternIdentifiers.cs
- OleDbPermission.cs
- ComplexObject.cs
- ModelUIElement3D.cs
- ExecutionContext.cs
- CssStyleCollection.cs
- TypeSchema.cs
- TextTreeUndoUnit.cs
- ScriptReference.cs
- WSFederationHttpBinding.cs
- PaintEvent.cs
- WithStatement.cs
- GAC.cs
- HandlerBase.cs
- NativeCompoundFileAPIs.cs
- ListControlBoundActionList.cs
- ToolStripRenderEventArgs.cs
- SuppressMergeCheckAttribute.cs
- SimpleTextLine.cs
- Regex.cs
- BuiltInExpr.cs
- BindingCollection.cs
- WindowAutomationPeer.cs
- ListCollectionView.cs
- DesignerSerializationOptionsAttribute.cs
- CrossAppDomainChannel.cs
- MultiDataTrigger.cs
- StringResourceManager.cs
- RadioButton.cs
- Aes.cs
- XmlSchemaExternal.cs
- MimePart.cs
- DBCSCodePageEncoding.cs
- XmlIlGenerator.cs
- RegexCompiler.cs
- TokenBasedSetEnumerator.cs
- StreamGeometry.cs
- CustomLineCap.cs
- SmtpNtlmAuthenticationModule.cs
- PresentationAppDomainManager.cs
- invalidudtexception.cs
- DataPagerField.cs
- ImportedNamespaceContextItem.cs
- HotSpotCollection.cs
- BasePattern.cs
- RuntimeEnvironment.cs
- AdapterDictionary.cs
- NetworkInformationPermission.cs
- RemotingConfiguration.cs
- Highlights.cs
- DocumentReferenceCollection.cs
- KeyedByTypeCollection.cs
- PropertyGeneratedEventArgs.cs
- AutomationIdentifierGuids.cs
- ZipIOFileItemStream.cs
- HwndHostAutomationPeer.cs
- Adorner.cs
- OleDbDataReader.cs
- CngKey.cs
- WindowsListViewItemStartMenu.cs
- NTAccount.cs
- TaskExtensions.cs
- ExceptionRoutedEventArgs.cs
- DecimalAverageAggregationOperator.cs
- FileLogRecordEnumerator.cs
- ObjectPersistData.cs
- TemplateControlCodeDomTreeGenerator.cs
- ProviderIncompatibleException.cs
- HttpListenerElement.cs
- indexingfiltermarshaler.cs
- ColorBlend.cs
- PageThemeBuildProvider.cs
- PrivilegeNotHeldException.cs
- TabControlCancelEvent.cs
- SafeNativeHandle.cs
- UnauthorizedAccessException.cs
- ScriptDescriptor.cs
- TextContainer.cs
- Facet.cs
- oledbmetadatacolumnnames.cs
- IpcChannel.cs
- NumericPagerField.cs
- BinaryMethodMessage.cs
- oledbmetadatacolumnnames.cs
- HyperLinkStyle.cs
- DesignTimeHTMLTextWriter.cs
- ConnectionPool.cs
- EncoderNLS.cs
- SqlInternalConnectionTds.cs
- formatter.cs
- Viewport2DVisual3D.cs
- IsolatedStorageFile.cs
- CharacterBuffer.cs
- ToolboxItemFilterAttribute.cs
- RNGCryptoServiceProvider.cs