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
- VisualStyleInformation.cs
- MenuBase.cs
- PropertyMappingExceptionEventArgs.cs
- _TLSstream.cs
- MultitargetingHelpers.cs
- ValidationHelper.cs
- DecoratedNameAttribute.cs
- WindowsSspiNegotiation.cs
- SqlInfoMessageEvent.cs
- CodeDOMUtility.cs
- GroupBoxAutomationPeer.cs
- ListChangedEventArgs.cs
- SqlUdtInfo.cs
- Scene3D.cs
- BitmapEffectRenderDataResource.cs
- StrokeCollectionConverter.cs
- SettingsPropertyWrongTypeException.cs
- BooleanKeyFrameCollection.cs
- TextParaClient.cs
- EpmCustomContentDeSerializer.cs
- SoapMessage.cs
- StylusButton.cs
- VectorCollectionConverter.cs
- DataSourceConverter.cs
- validationstate.cs
- OdbcInfoMessageEvent.cs
- NetWebProxyFinder.cs
- DataStreamFromComStream.cs
- TypeDescriptionProviderAttribute.cs
- DBConnection.cs
- selecteditemcollection.cs
- SchemaNotation.cs
- SqlComparer.cs
- DataGridViewCellPaintingEventArgs.cs
- AsyncCompletedEventArgs.cs
- AncillaryOps.cs
- RadioButtonPopupAdapter.cs
- HtmlButton.cs
- ItemsControl.cs
- Calendar.cs
- CodeStatement.cs
- DesignerActionPanel.cs
- InfoCardConstants.cs
- Int16AnimationBase.cs
- ProgressBar.cs
- UIElement.cs
- DataFieldConverter.cs
- WinFormsSpinner.cs
- UnsafeNativeMethods.cs
- UrlPath.cs
- PolyLineSegmentFigureLogic.cs
- EntityDataSourceQueryBuilder.cs
- GridToolTip.cs
- WindowsListBox.cs
- Base64Stream.cs
- TableItemPatternIdentifiers.cs
- DbConnectionPool.cs
- LZCodec.cs
- NetworkAddressChange.cs
- BitmapEffectOutputConnector.cs
- ParagraphVisual.cs
- WaveHeader.cs
- CheckBoxList.cs
- XmlSchemaChoice.cs
- XmlAutoDetectWriter.cs
- IList.cs
- MaskInputRejectedEventArgs.cs
- ProfileEventArgs.cs
- RepeaterCommandEventArgs.cs
- WpfKnownType.cs
- SQLGuid.cs
- TypeReference.cs
- Registry.cs
- IndexedSelectQueryOperator.cs
- AutomationProperties.cs
- StorageInfo.cs
- MatrixValueSerializer.cs
- CardSpacePolicyElement.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- StringDictionary.cs
- ListControlConvertEventArgs.cs
- TextEndOfSegment.cs
- Model3D.cs
- CatalogZoneDesigner.cs
- LinkConverter.cs
- HttpModuleAction.cs
- BitmapEffectrendercontext.cs
- PointAnimationUsingPath.cs
- RuntimeCompatibilityAttribute.cs
- HttpApplicationStateBase.cs
- ArrayTypeMismatchException.cs
- EnumMemberAttribute.cs
- BufferedGraphics.cs
- MsmqVerifier.cs
- CleanUpVirtualizedItemEventArgs.cs
- CodeMethodInvokeExpression.cs
- ProcessHostConfigUtils.cs
- SoapMessage.cs
- EtwProvider.cs
- SelectorAutomationPeer.cs