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
- ScriptControl.cs
- TextSegment.cs
- WebPartCloseVerb.cs
- XPathSingletonIterator.cs
- X509CertificateChain.cs
- PropertyGridCommands.cs
- VisualStyleRenderer.cs
- SqlLiftIndependentRowExpressions.cs
- SerializationSectionGroup.cs
- PipelineModuleStepContainer.cs
- CompatibleIComparer.cs
- _SslState.cs
- GenericEnumConverter.cs
- CaseInsensitiveHashCodeProvider.cs
- RenderCapability.cs
- SystemIcmpV4Statistics.cs
- FormatConvertedBitmap.cs
- CodeCatchClauseCollection.cs
- XmlElementList.cs
- DetailsViewDeleteEventArgs.cs
- UIPermission.cs
- CodeAssignStatement.cs
- QueryContinueDragEventArgs.cs
- UrlMapping.cs
- SiteMembershipCondition.cs
- InvariantComparer.cs
- StyleCollectionEditor.cs
- HttpHandlerAction.cs
- PublisherMembershipCondition.cs
- dsa.cs
- AssemblyNameProxy.cs
- BindingContext.cs
- Pen.cs
- ReachDocumentPageSerializerAsync.cs
- StringCollection.cs
- DesignerInterfaces.cs
- DefaultTextStoreTextComposition.cs
- x509utils.cs
- PeerName.cs
- BuildProviderCollection.cs
- LinearGradientBrush.cs
- QilTernary.cs
- Ref.cs
- InputProcessorProfilesLoader.cs
- SqlDataRecord.cs
- MarshalByValueComponent.cs
- XmlSchemaSimpleTypeList.cs
- CodeCompiler.cs
- HashHelpers.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- AttributeEmitter.cs
- NamespaceCollection.cs
- EncoderNLS.cs
- RecordManager.cs
- DataTableMapping.cs
- TemplatePartAttribute.cs
- ControlPropertyNameConverter.cs
- CollaborationHelperFunctions.cs
- CommandConverter.cs
- MessageQueueInstaller.cs
- MarkupExtensionReturnTypeAttribute.cs
- SmiContext.cs
- CodeDelegateInvokeExpression.cs
- XmlNamespaceDeclarationsAttribute.cs
- CodeSnippetExpression.cs
- PropertyMapper.cs
- XmlIlTypeHelper.cs
- Util.cs
- TransformGroup.cs
- DragEvent.cs
- RuntimeIdentifierPropertyAttribute.cs
- BrowserDefinition.cs
- ComplexType.cs
- FtpWebRequest.cs
- X509Utils.cs
- DetailsViewDeleteEventArgs.cs
- ConnectionPoolManager.cs
- BufferedMessageWriter.cs
- AtomMaterializerLog.cs
- MetadataArtifactLoaderCompositeResource.cs
- Timer.cs
- TransportBindingElementImporter.cs
- Utils.cs
- DropDownButton.cs
- SerialReceived.cs
- SoapExtensionStream.cs
- MessageHeaderAttribute.cs
- EmptyQuery.cs
- Utility.cs
- XmlDictionaryReaderQuotasElement.cs
- ListView.cs
- EntityDataSourceReferenceGroup.cs
- RectIndependentAnimationStorage.cs
- StandardOleMarshalObject.cs
- CalendarDesigner.cs
- FrameworkReadOnlyPropertyMetadata.cs
- DBBindings.cs
- SolidColorBrush.cs
- UnmanagedHandle.cs
- BypassElementCollection.cs