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
- TextBlock.cs
- VirtualDirectoryMapping.cs
- Renderer.cs
- VisualTreeHelper.cs
- ArgumentDirectionHelper.cs
- ToolStripDropDownMenu.cs
- RemoveFromCollection.cs
- DataGridViewRowsAddedEventArgs.cs
- _Win32.cs
- SortedList.cs
- BamlReader.cs
- ObjectTypeMapping.cs
- SimpleFileLog.cs
- regiisutil.cs
- MatrixAnimationUsingPath.cs
- SuppressIldasmAttribute.cs
- FileDialogPermission.cs
- GeometryValueSerializer.cs
- NavigatingCancelEventArgs.cs
- Subset.cs
- PieceDirectory.cs
- SqlCrossApplyToCrossJoin.cs
- SecurityCookieModeValidator.cs
- CachedCompositeFamily.cs
- StaticTextPointer.cs
- EmptyStringExpandableObjectConverter.cs
- PreApplicationStartMethodAttribute.cs
- PrinterUnitConvert.cs
- CacheHelper.cs
- DataControlLinkButton.cs
- _AcceptOverlappedAsyncResult.cs
- TimeSpanSecondsConverter.cs
- TextElementCollectionHelper.cs
- PeerContact.cs
- CompensationHandlingFilter.cs
- DeploymentSectionCache.cs
- FileSystemWatcher.cs
- StatusBar.cs
- ContentOperations.cs
- UnsafeNetInfoNativeMethods.cs
- AttributeQuery.cs
- ImageSourceValueSerializer.cs
- SigningCredentials.cs
- QilTernary.cs
- PropertyNames.cs
- AutomationElement.cs
- AdornerPresentationContext.cs
- DataAccessor.cs
- DashStyle.cs
- DataGridViewLinkColumn.cs
- ResourceCategoryAttribute.cs
- CultureMapper.cs
- DPCustomTypeDescriptor.cs
- TextTreeUndoUnit.cs
- AssemblyCollection.cs
- ToolStripMenuItem.cs
- BindToObject.cs
- CompressedStack.cs
- Filter.cs
- ValuePattern.cs
- SqlGatherProducedAliases.cs
- ExplicitDiscriminatorMap.cs
- webbrowsersite.cs
- ObjectStateManagerMetadata.cs
- DateBoldEvent.cs
- PathSegmentCollection.cs
- ScriptMethodAttribute.cs
- EntityDataSourceWrapperCollection.cs
- ProgressBarRenderer.cs
- EntityTypeEmitter.cs
- PowerStatus.cs
- GlyphRunDrawing.cs
- SolidBrush.cs
- DoubleAnimation.cs
- CipherData.cs
- AsyncOperation.cs
- AttachedAnnotation.cs
- RowType.cs
- securitycriticaldataformultiplegetandset.cs
- Propagator.cs
- MasterPageParser.cs
- InlineUIContainer.cs
- PaperSize.cs
- XNodeNavigator.cs
- ImageAttributes.cs
- ReaderWriterLock.cs
- PtsCache.cs
- InstanceDataCollection.cs
- NCryptSafeHandles.cs
- SchemaLookupTable.cs
- BasicKeyConstraint.cs
- SafeProcessHandle.cs
- cookiecollection.cs
- GraphicsState.cs
- ListBox.cs
- BoundsDrawingContextWalker.cs
- Variant.cs
- UInt32.cs
- ReverseInheritProperty.cs
- WebPartsPersonalizationAuthorization.cs