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
- SocketSettings.cs
- Bits.cs
- WorkflowIdleElement.cs
- PropertyDescriptorCollection.cs
- RSACryptoServiceProvider.cs
- ToolStripRenderEventArgs.cs
- BevelBitmapEffect.cs
- NullableLongMinMaxAggregationOperator.cs
- StateDesigner.CommentLayoutGlyph.cs
- SR.cs
- OdbcCommand.cs
- HorizontalAlignConverter.cs
- SecurityDocument.cs
- FieldBuilder.cs
- WebPartDisplayModeCollection.cs
- NavigationEventArgs.cs
- BasePattern.cs
- XmlArrayAttribute.cs
- ProxyAttribute.cs
- APCustomTypeDescriptor.cs
- FixedFindEngine.cs
- ClientBuildManager.cs
- DbSetClause.cs
- RenderData.cs
- CornerRadiusConverter.cs
- CellRelation.cs
- SapiRecoInterop.cs
- XamlHttpHandlerFactory.cs
- graph.cs
- TextTrailingWordEllipsis.cs
- ControlBuilder.cs
- Duration.cs
- TextWriterTraceListener.cs
- BaseCAMarshaler.cs
- ItemsChangedEventArgs.cs
- FatalException.cs
- ExpressionWriter.cs
- connectionpool.cs
- OdbcConnectionOpen.cs
- ExistsInCollection.cs
- TypeBuilderInstantiation.cs
- CoreSwitches.cs
- ModulesEntry.cs
- PanelStyle.cs
- PerfService.cs
- NetSectionGroup.cs
- Byte.cs
- SecurityTokenParameters.cs
- SocketElement.cs
- SpeechUI.cs
- InstallerTypeAttribute.cs
- ScriptServiceAttribute.cs
- SimpleParser.cs
- GeneralTransform3DTo2D.cs
- TableLayoutSettingsTypeConverter.cs
- StatusBarDesigner.cs
- PartialArray.cs
- StringFunctions.cs
- SafeTimerHandle.cs
- NodeLabelEditEvent.cs
- ContentElementAutomationPeer.cs
- ReferencedCollectionType.cs
- ProviderIncompatibleException.cs
- Column.cs
- DescendantOverDescendantQuery.cs
- ResourceReader.cs
- TextPenaltyModule.cs
- NameValueFileSectionHandler.cs
- SendContent.cs
- FunctionQuery.cs
- PagesChangedEventArgs.cs
- SqlError.cs
- AutomationPropertyInfo.cs
- StateMachineHistory.cs
- DataTable.cs
- If.cs
- StringValueConverter.cs
- ErrorLog.cs
- ObjectContext.cs
- DisplayNameAttribute.cs
- CodeCommentStatementCollection.cs
- InputLangChangeRequestEvent.cs
- SapiInterop.cs
- WebPartCatalogAddVerb.cs
- TypeEnumerableViewSchema.cs
- LZCodec.cs
- ComEventsInfo.cs
- StreamInfo.cs
- URLAttribute.cs
- NativeMethods.cs
- IMembershipProvider.cs
- DataDocumentXPathNavigator.cs
- EndpointAddressProcessor.cs
- HtmlHead.cs
- BrowserCapabilitiesCodeGenerator.cs
- SettingsProviderCollection.cs
- GetMemberBinder.cs
- CodeSnippetExpression.cs
- HttpHandlerAction.cs
- ObjectConverter.cs