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
- ExpressionBuilder.cs
- RestClientProxyHandler.cs
- BehaviorEditorPart.cs
- ToolStripMenuItem.cs
- CommonDialog.cs
- X509IssuerSerialKeyIdentifierClause.cs
- AtomServiceDocumentSerializer.cs
- PageOutputColor.cs
- StylusPointPropertyInfoDefaults.cs
- SupportsPreviewControlAttribute.cs
- PagedDataSource.cs
- ElementHost.cs
- BaseTemplateParser.cs
- ButtonBase.cs
- LinkedDataMemberFieldEditor.cs
- ReferenceConverter.cs
- ImportCatalogPart.cs
- SchemaTableOptionalColumn.cs
- ControlEvent.cs
- Stack.cs
- FreezableDefaultValueFactory.cs
- Compiler.cs
- FloatUtil.cs
- SqlRemoveConstantOrderBy.cs
- DateTimeUtil.cs
- PeerResolverMode.cs
- BindingWorker.cs
- AuthenticationConfig.cs
- SQLInt64Storage.cs
- UpdatePanel.cs
- RectangleHotSpot.cs
- XmlDeclaration.cs
- DataGridViewAccessibleObject.cs
- PhonemeEventArgs.cs
- SafeEventLogWriteHandle.cs
- OutputWindow.cs
- GeneralTransform3D.cs
- ServiceSecurityAuditElement.cs
- UIElementAutomationPeer.cs
- ImageList.cs
- formatter.cs
- ObjectSpanRewriter.cs
- Compiler.cs
- SoapExtensionImporter.cs
- ExecutionContext.cs
- DetailsViewUpdatedEventArgs.cs
- MonthChangedEventArgs.cs
- ClonableStack.cs
- InternalException.cs
- ExpressionNode.cs
- CredentialCache.cs
- DataStreams.cs
- EvidenceBase.cs
- WebDescriptionAttribute.cs
- MetadataPropertyAttribute.cs
- InternalUserCancelledException.cs
- WebPartEditVerb.cs
- SqlConnectionManager.cs
- ScriptDescriptor.cs
- LicFileLicenseProvider.cs
- Variable.cs
- DataControlReference.cs
- ReadOnlyActivityGlyph.cs
- ResourcePermissionBase.cs
- SystemTcpConnection.cs
- NetTcpBindingCollectionElement.cs
- _SslState.cs
- SeverityFilter.cs
- FrameworkTemplate.cs
- DataTemplateSelector.cs
- XmlJsonWriter.cs
- XmlSchema.cs
- Schema.cs
- BehaviorEditorPart.cs
- SettingsAttributeDictionary.cs
- SerializationHelper.cs
- COAUTHINFO.cs
- AssemblyBuilder.cs
- Set.cs
- DesignRelationCollection.cs
- complextypematerializer.cs
- LOSFormatter.cs
- XmlSchemaExporter.cs
- ClientSideQueueItem.cs
- TrustManagerMoreInformation.cs
- DbProviderSpecificTypePropertyAttribute.cs
- webbrowsersite.cs
- DataControlHelper.cs
- BevelBitmapEffect.cs
- PermissionSetEnumerator.cs
- DriveNotFoundException.cs
- SmtpDigestAuthenticationModule.cs
- TextServicesProperty.cs
- CfgParser.cs
- CodeExpressionStatement.cs
- Select.cs
- UInt32Converter.cs
- EntityAdapter.cs
- HttpPostedFileBase.cs
- DataList.cs