Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / CompMod / System / ComponentModel / StringConverter.cs / 1 / StringConverter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.ComponentModel { using System.Diagnostics; using System.Globalization; using System.Runtime.InteropServices; using System.Runtime.Remoting; using System.Runtime.Serialization.Formatters; using System.Security.Permissions; ////// [HostProtection(SharedState = true)] public class StringConverter : TypeConverter { ///Provides a type converter to convert string objects to and from various other /// representations. ////// public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) { if (sourceType == typeof(string)) { return true; } return base.CanConvertFrom(context, sourceType); } ///Gets a value indicating whether this converter can convert an object in the /// given source type to a string using the specified context. ////// public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { if (value is string) { return (string)value; } if (value == null) { return ""; } return base.ConvertFrom(context, culture, value); } } }Converts the specified value object to a string object. ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PassportAuthentication.cs
- ParsedAttributeCollection.cs
- ResourceDescriptionAttribute.cs
- HttpServerUtilityWrapper.cs
- ConfigurationManagerHelper.cs
- TimerTable.cs
- CurrentTimeZone.cs
- EventProviderWriter.cs
- LocalFileSettingsProvider.cs
- ThreadInterruptedException.cs
- XmlTextReader.cs
- HttpResponseInternalBase.cs
- SqlInternalConnectionSmi.cs
- InfocardExtendedInformationEntry.cs
- TimeStampChecker.cs
- PtsPage.cs
- OdbcHandle.cs
- SqlDataSourceFilteringEventArgs.cs
- TriggerActionCollection.cs
- ImageKeyConverter.cs
- KoreanCalendar.cs
- LinearGradientBrush.cs
- ItemsPresenter.cs
- DifferencingCollection.cs
- LinqExpressionNormalizer.cs
- ProfileSettingsCollection.cs
- DbConnectionStringCommon.cs
- FormViewModeEventArgs.cs
- BindableTemplateBuilder.cs
- StickyNoteContentControl.cs
- DispatchWrapper.cs
- ControlBuilder.cs
- LineInfo.cs
- Encoder.cs
- StringDictionary.cs
- WebPartConnectionsEventArgs.cs
- OleDbFactory.cs
- ProjectionPruner.cs
- MessagePropertyDescription.cs
- TaskScheduler.cs
- EventToken.cs
- PersonalizationStateInfo.cs
- HatchBrush.cs
- KeyedHashAlgorithm.cs
- TemplatedAdorner.cs
- log.cs
- DetailsViewActionList.cs
- DispatchWrapper.cs
- MenuItem.cs
- XmlSchemaObjectTable.cs
- filewebrequest.cs
- GroupItem.cs
- TypographyProperties.cs
- ErrorWebPart.cs
- WorkingDirectoryEditor.cs
- ViewStateModeByIdAttribute.cs
- ZipIOCentralDirectoryBlock.cs
- SqlXmlStorage.cs
- DirectoryRedirect.cs
- XmlSerializerAssemblyAttribute.cs
- ImageList.cs
- SessionStateSection.cs
- ResourceExpressionBuilder.cs
- BitmapCache.cs
- ScrollData.cs
- Transform3DGroup.cs
- COAUTHIDENTITY.cs
- SoapWriter.cs
- DataGridViewColumnStateChangedEventArgs.cs
- NullRuntimeConfig.cs
- SqlXmlStorage.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- TreeNodeClickEventArgs.cs
- XmlSchemaInfo.cs
- XmlDataSourceView.cs
- ObjectTypeMapping.cs
- CommentAction.cs
- ExpressionBuilder.cs
- CodeTypeDelegate.cs
- SymmetricCryptoHandle.cs
- Utils.cs
- ContextMarshalException.cs
- TypeDescriptionProvider.cs
- XmlSerializerNamespaces.cs
- PropertyValueUIItem.cs
- SHA256.cs
- Calendar.cs
- CompiledXpathExpr.cs
- WebPartTransformerCollection.cs
- DomainUpDown.cs
- StyleBamlTreeBuilder.cs
- FrameDimension.cs
- NavigationCommands.cs
- updateconfighost.cs
- RegistrySecurity.cs
- MetafileHeaderWmf.cs
- LinkArea.cs
- ReservationNotFoundException.cs
- ProtocolsConfiguration.cs
- Rights.cs