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
- Floater.cs
- FullTextBreakpoint.cs
- HttpListenerRequest.cs
- WebEventTraceProvider.cs
- ClusterRegistryConfigurationProvider.cs
- SQLBinaryStorage.cs
- SecuritySessionServerSettings.cs
- HttpUnhandledOperationInvoker.cs
- OpenTypeMethods.cs
- OperationContractAttribute.cs
- SerializationInfoEnumerator.cs
- UserControl.cs
- ContainerCodeDomSerializer.cs
- TimeoutException.cs
- RequestCacheEntry.cs
- IndexedString.cs
- RoleServiceManager.cs
- SortableBindingList.cs
- XmlSchemaExporter.cs
- TableHeaderCell.cs
- ExtenderControl.cs
- CompositeDataBoundControl.cs
- GrammarBuilder.cs
- Translator.cs
- ElementNotEnabledException.cs
- ToolboxItemAttribute.cs
- CommandField.cs
- KnownTypesHelper.cs
- FormViewUpdatedEventArgs.cs
- CombinedGeometry.cs
- ViewGenerator.cs
- WindowsRegion.cs
- StandardCommands.cs
- Rules.cs
- HttpCookiesSection.cs
- PrintController.cs
- XPathScanner.cs
- SplineKeyFrames.cs
- PersistenceTypeAttribute.cs
- DateTimePicker.cs
- ReadWriteObjectLock.cs
- DataGridViewCellEventArgs.cs
- COM2AboutBoxPropertyDescriptor.cs
- CodeArrayIndexerExpression.cs
- _LoggingObject.cs
- ImageAutomationPeer.cs
- ZipPackagePart.cs
- VirtualDirectoryMappingCollection.cs
- BinaryKeyIdentifierClause.cs
- ControlParameter.cs
- PointCollectionConverter.cs
- CodeExpressionStatement.cs
- DataView.cs
- VectorCollectionConverter.cs
- ResourceDisplayNameAttribute.cs
- XmlCharType.cs
- DataSourceView.cs
- TextTreeUndo.cs
- XmlText.cs
- ListControlConvertEventArgs.cs
- MaterialGroup.cs
- PathFigure.cs
- BindingExpressionBase.cs
- NullableBoolConverter.cs
- WindowsToolbar.cs
- InkSerializer.cs
- HtmlHistory.cs
- WebDescriptionAttribute.cs
- ViewStateException.cs
- MenuItemBinding.cs
- TraceRecords.cs
- DefaultProxySection.cs
- FixedPageProcessor.cs
- XmlAttributeCollection.cs
- SizeAnimationUsingKeyFrames.cs
- _ConnectionGroup.cs
- DiscoveryClientDuplexChannel.cs
- ColorMap.cs
- ReturnType.cs
- TextOnlyOutput.cs
- UnionExpr.cs
- ConnectionManagementElement.cs
- LoginView.cs
- EntityViewGenerationAttribute.cs
- MultipleCopiesCollection.cs
- mactripleDES.cs
- IsolatedStorageException.cs
- CodeMemberEvent.cs
- FontUnitConverter.cs
- ArraySegment.cs
- EnumerableRowCollectionExtensions.cs
- ComponentSerializationService.cs
- FtpRequestCacheValidator.cs
- QuaternionRotation3D.cs
- EmptyEnumerable.cs
- BooleanFacetDescriptionElement.cs
- RuleSetBrowserDialog.cs
- HtmlHead.cs
- newinstructionaction.cs
- StrongNamePublicKeyBlob.cs