Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / StringConverter.cs / 1305376 / 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); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.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
- TimelineClockCollection.cs
- XPathNodeList.cs
- DetailsViewModeEventArgs.cs
- SafePEFileHandle.cs
- TemplateField.cs
- FormViewCommandEventArgs.cs
- MediaCommands.cs
- VectorValueSerializer.cs
- tooltip.cs
- CatalogPart.cs
- ToolStripEditorManager.cs
- mediaclock.cs
- WsatServiceCertificate.cs
- TextPointer.cs
- LicenseContext.cs
- DefaultProxySection.cs
- CharStorage.cs
- securitycriticaldata.cs
- TableCell.cs
- COM2ComponentEditor.cs
- Command.cs
- AssemblyResourceLoader.cs
- GridViewColumn.cs
- CapacityStreamGeometryContext.cs
- SortedSetDebugView.cs
- CommonDialog.cs
- RenameRuleObjectDialog.Designer.cs
- Image.cs
- TagMapCollection.cs
- COM2PictureConverter.cs
- CultureTable.cs
- Int32Converter.cs
- CacheMemory.cs
- MarkupProperty.cs
- XsdCachingReader.cs
- ServiceReference.cs
- XmlFormatWriterGenerator.cs
- DataTableMapping.cs
- ConfigurationSchemaErrors.cs
- DesignTimeParseData.cs
- EUCJPEncoding.cs
- SchemaInfo.cs
- SHA1Managed.cs
- Encoder.cs
- DataGridViewColumnDividerDoubleClickEventArgs.cs
- ControlBindingsConverter.cs
- DesignerForm.cs
- AutoSizeComboBox.cs
- PartitionerQueryOperator.cs
- GroupQuery.cs
- CollectionType.cs
- TypeDescriptor.cs
- TextMarkerSource.cs
- Lease.cs
- ResolveNameEventArgs.cs
- MsmqIntegrationMessagePool.cs
- CompiledQuery.cs
- ColumnMapVisitor.cs
- UrlMappingsSection.cs
- SerializerProvider.cs
- UInt32.cs
- XmlEventCache.cs
- DesignerDataSourceView.cs
- DefaultSection.cs
- TableLayoutRowStyleCollection.cs
- ListViewDeleteEventArgs.cs
- ParsedAttributeCollection.cs
- WindowsTab.cs
- Tokenizer.cs
- TypeSystem.cs
- MemberAssignmentAnalysis.cs
- ToolStripSeparatorRenderEventArgs.cs
- XmlWriter.cs
- ObjectConverter.cs
- XPathNodeIterator.cs
- DataListAutoFormat.cs
- StringArrayConverter.cs
- SamlAuthenticationStatement.cs
- DataListItemEventArgs.cs
- ContentElement.cs
- MarkupWriter.cs
- UrlMappingsSection.cs
- LinearGradientBrush.cs
- OptimisticConcurrencyException.cs
- CommandEventArgs.cs
- XmlAttribute.cs
- NotFiniteNumberException.cs
- DESCryptoServiceProvider.cs
- SystemIcons.cs
- FSWPathEditor.cs
- X509SubjectKeyIdentifierClause.cs
- XmlSchemaObjectTable.cs
- WebZone.cs
- AssociationType.cs
- Condition.cs
- SettingsPropertyNotFoundException.cs
- CommandID.cs
- IPipelineRuntime.cs
- QueryOperatorEnumerator.cs
- CheckBox.cs