Code:
/ DotNET / DotNET / 8.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
- WebControl.cs
- ISessionStateStore.cs
- SemanticResultValue.cs
- Solver.cs
- DependencyPropertyKind.cs
- SecureConversationDriver.cs
- MethodExpr.cs
- XmlILAnnotation.cs
- DrawTreeNodeEventArgs.cs
- LayoutEditorPart.cs
- WebPartConnectionsEventArgs.cs
- CollectionTypeElement.cs
- RenderContext.cs
- DelimitedListTraceListener.cs
- InvokeGenerator.cs
- Documentation.cs
- MultiTrigger.cs
- ChannelBinding.cs
- ResizeGrip.cs
- WebResponse.cs
- GenericsInstances.cs
- ObjectNavigationPropertyMapping.cs
- TCPClient.cs
- StoreItemCollection.Loader.cs
- KeyConverter.cs
- RtfNavigator.cs
- ValueChangedEventManager.cs
- ResponseBodyWriter.cs
- SettingsContext.cs
- SynchronousSendBindingElement.cs
- EngineSiteSapi.cs
- EntityContainerEntitySet.cs
- SafeViewOfFileHandle.cs
- DesignerSerializationOptionsAttribute.cs
- NavigationEventArgs.cs
- MetadataItemEmitter.cs
- XmlSchemaDatatype.cs
- XomlDesignerLoader.cs
- OleStrCAMarshaler.cs
- ResXResourceSet.cs
- ResourceDescriptionAttribute.cs
- CodeGenerator.cs
- ArgumentElement.cs
- UIElementParaClient.cs
- StringPropertyBuilder.cs
- UpdateRecord.cs
- ParseChildrenAsPropertiesAttribute.cs
- ObjectItemCollectionAssemblyCacheEntry.cs
- TimeZone.cs
- CompiledIdentityConstraint.cs
- LocalIdKeyIdentifierClause.cs
- PersonalizationProviderHelper.cs
- MDIWindowDialog.cs
- URLEditor.cs
- CanonicalFormWriter.cs
- State.cs
- NamespaceTable.cs
- ObjectPersistData.cs
- ResourceDictionaryCollection.cs
- GenerateHelper.cs
- TranslateTransform.cs
- ControlValuePropertyAttribute.cs
- TemplateBindingExtension.cs
- SqlNotificationEventArgs.cs
- StrongNameIdentityPermission.cs
- InkCollectionBehavior.cs
- WebServiceErrorEvent.cs
- PrivacyNoticeBindingElement.cs
- XhtmlConformanceSection.cs
- Normalizer.cs
- StringWriter.cs
- CqlLexer.cs
- DataGridViewAccessibleObject.cs
- LocationUpdates.cs
- SelectingProviderEventArgs.cs
- oledbconnectionstring.cs
- ToolStripTemplateNode.cs
- IdentityNotMappedException.cs
- PeerContact.cs
- StaticExtensionConverter.cs
- PersonalizableAttribute.cs
- designeractionbehavior.cs
- DataGridColumnHeader.cs
- BigIntegerStorage.cs
- WorkflowOperationBehavior.cs
- webbrowsersite.cs
- SinglePageViewer.cs
- ItemDragEvent.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- CheckBoxFlatAdapter.cs
- RuntimeEnvironment.cs
- SafeNativeMethods.cs
- DataGridViewCellStyleChangedEventArgs.cs
- ProcessModelSection.cs
- XmlIlVisitor.cs
- DocumentApplication.cs
- SR.cs
- RuleElement.cs
- SoapServerProtocol.cs
- XmlSchemaImporter.cs