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
- ParagraphResult.cs
- OdbcParameter.cs
- DifferencingCollection.cs
- ListBoxItemAutomationPeer.cs
- PackagingUtilities.cs
- SplitterPanelDesigner.cs
- ContextInformation.cs
- HitTestParameters.cs
- XsdValidatingReader.cs
- MsmqBindingElementBase.cs
- TraversalRequest.cs
- InteropEnvironment.cs
- ComponentGuaranteesAttribute.cs
- Material.cs
- WindowAutomationPeer.cs
- EntityClientCacheKey.cs
- WebBrowserNavigatedEventHandler.cs
- WebPartZoneAutoFormat.cs
- Variable.cs
- SiteMapProvider.cs
- PatternMatcher.cs
- HttpCachePolicyElement.cs
- ScriptReferenceEventArgs.cs
- ButtonAutomationPeer.cs
- HtmlListAdapter.cs
- DependencyPropertyChangedEventArgs.cs
- WebEventTraceProvider.cs
- DistributedTransactionPermission.cs
- Evidence.cs
- TraceRecord.cs
- HandlerWithFactory.cs
- OletxCommittableTransaction.cs
- AccessControlEntry.cs
- SQLDouble.cs
- ClientOptions.cs
- RecipientIdentity.cs
- SqlBooleanMismatchVisitor.cs
- ContextItem.cs
- FontNamesConverter.cs
- ScriptReference.cs
- NetworkInformationException.cs
- AuthorizationRule.cs
- DataObject.cs
- CookieHandler.cs
- XmlSchemaRedefine.cs
- ClientEndpointLoader.cs
- RepeaterItemCollection.cs
- AutoScrollHelper.cs
- BufferedWebEventProvider.cs
- Repeater.cs
- InputBuffer.cs
- HeaderedContentControl.cs
- UiaCoreApi.cs
- sortedlist.cs
- ZoneLinkButton.cs
- SerializationObjectManager.cs
- HttpApplicationFactory.cs
- ConsumerConnectionPoint.cs
- DecimalAverageAggregationOperator.cs
- BeginEvent.cs
- DataGridViewToolTip.cs
- FormsAuthenticationEventArgs.cs
- SequentialWorkflowHeaderFooter.cs
- MethodImplAttribute.cs
- ParseChildrenAsPropertiesAttribute.cs
- ExtensionDataObject.cs
- Soap11ServerProtocol.cs
- XmlLanguageConverter.cs
- SystemTcpConnection.cs
- ModelVisual3D.cs
- SimpleApplicationHost.cs
- DictionaryManager.cs
- OutputCacheSettings.cs
- SqlCharStream.cs
- SimpleLine.cs
- WmlPhoneCallAdapter.cs
- TargetException.cs
- TextTreeExtractElementUndoUnit.cs
- XmlProcessingInstruction.cs
- ListViewContainer.cs
- DoubleLink.cs
- ExtenderProvidedPropertyAttribute.cs
- ConfigXmlWhitespace.cs
- SQLGuidStorage.cs
- CodeNamespaceCollection.cs
- XmlSchemaRedefine.cs
- ScrollViewer.cs
- UrlMappingCollection.cs
- SqlMethodAttribute.cs
- RefExpr.cs
- FixedDSBuilder.cs
- TypedReference.cs
- querybuilder.cs
- ThreadExceptionDialog.cs
- PerformanceCounterManager.cs
- XmlCharacterData.cs
- DataGridViewButtonColumn.cs
- exports.cs
- ImageSourceTypeConverter.cs
- coordinator.cs