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
- Decorator.cs
- HttpWriter.cs
- StringKeyFrameCollection.cs
- CodeGen.cs
- TextTreePropertyUndoUnit.cs
- XmlSerializationGeneratedCode.cs
- ColumnHeaderConverter.cs
- GridViewRowCollection.cs
- KeyEventArgs.cs
- PrimaryKeyTypeConverter.cs
- ConfigXmlElement.cs
- DbConnectionStringBuilder.cs
- WmlTextBoxAdapter.cs
- AutoCompleteStringCollection.cs
- PreservationFileWriter.cs
- BroadcastEventHelper.cs
- ScriptManagerProxy.cs
- CancellationHandlerDesigner.cs
- ApplicationSecurityManager.cs
- Predicate.cs
- AuthenticatedStream.cs
- ComplexType.cs
- StorageEntityTypeMapping.cs
- CallSiteBinder.cs
- SchemaTypeEmitter.cs
- DataGridViewColumn.cs
- AccessedThroughPropertyAttribute.cs
- GraphicsPathIterator.cs
- xamlnodes.cs
- OleAutBinder.cs
- XmlObjectSerializerReadContextComplexJson.cs
- ToolStripDropDownButton.cs
- ComEventsSink.cs
- ProvidePropertyAttribute.cs
- TempFiles.cs
- DataGridRowHeader.cs
- MetadataReference.cs
- QueryPageSettingsEventArgs.cs
- NamespaceQuery.cs
- AnimationException.cs
- GestureRecognitionResult.cs
- QueueProcessor.cs
- UpdateException.cs
- BitmapMetadataEnumerator.cs
- Constant.cs
- KeyedHashAlgorithm.cs
- ItemAutomationPeer.cs
- BufferedStream2.cs
- RemotingConfiguration.cs
- WebPartZoneCollection.cs
- DecoderBestFitFallback.cs
- SmtpMail.cs
- DataRowCollection.cs
- ContainsSearchOperator.cs
- EventWaitHandleSecurity.cs
- RecordBuilder.cs
- SqlLiftWhereClauses.cs
- SimpleType.cs
- WebPartDescription.cs
- ToolboxItemAttribute.cs
- EventHandlersStore.cs
- XmlElementAttributes.cs
- ValuePatternIdentifiers.cs
- TemplateDefinition.cs
- XPathSelectionIterator.cs
- DesignOnlyAttribute.cs
- filewebrequest.cs
- ObjectDataSourceDisposingEventArgs.cs
- TextParagraph.cs
- BindingList.cs
- FontDriver.cs
- ComplexBindingPropertiesAttribute.cs
- PageCanvasSize.cs
- WebCategoryAttribute.cs
- InputScopeManager.cs
- SolidColorBrush.cs
- GlyphTypeface.cs
- LinkLabelLinkClickedEvent.cs
- BufferAllocator.cs
- ClassData.cs
- DataGridViewRow.cs
- MbpInfo.cs
- PropertyBuilder.cs
- ResourceKey.cs
- RowUpdatingEventArgs.cs
- InputScopeConverter.cs
- XmlObjectSerializerReadContextComplex.cs
- Inflater.cs
- DataServiceHostWrapper.cs
- UnsafePeerToPeerMethods.cs
- XmlElement.cs
- XamlPointCollectionSerializer.cs
- CodeSnippetTypeMember.cs
- RectangleHotSpot.cs
- XmlQueryContext.cs
- _CookieModule.cs
- StylusPointPropertyUnit.cs
- TogglePatternIdentifiers.cs
- Panel.cs
- GraphicsPath.cs