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
- Serializer.cs
- ListBox.cs
- KeyValueInternalCollection.cs
- XmlReflectionMember.cs
- DataControlPagerLinkButton.cs
- IgnoreSection.cs
- ColumnProvider.cs
- LineUtil.cs
- BaseConfigurationRecord.cs
- WindowPatternIdentifiers.cs
- MetricEntry.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- TextPattern.cs
- InternalCache.cs
- Faults.cs
- PropertyGroupDescription.cs
- UnconditionalPolicy.cs
- Polyline.cs
- DataTableReader.cs
- DocumentViewerBaseAutomationPeer.cs
- documentsequencetextcontainer.cs
- AmbientValueAttribute.cs
- CodePropertyReferenceExpression.cs
- DescendantOverDescendantQuery.cs
- LocatorGroup.cs
- WebPartCancelEventArgs.cs
- OleDbException.cs
- BindingObserver.cs
- NegotiateStream.cs
- ZipFileInfoCollection.cs
- EventPrivateKey.cs
- TableDetailsCollection.cs
- NullableDecimalMinMaxAggregationOperator.cs
- _AutoWebProxyScriptEngine.cs
- ConstructorNeedsTagAttribute.cs
- DataGridViewRowsAddedEventArgs.cs
- ContextCorrelationInitializer.cs
- GeometryDrawing.cs
- XmlSubtreeReader.cs
- RegistrationServices.cs
- ProfileSection.cs
- ProxyGenerator.cs
- Transform.cs
- WpfSharedXamlSchemaContext.cs
- ZipIOCentralDirectoryFileHeader.cs
- DataObjectAttribute.cs
- altserialization.cs
- ItemsControlAutomationPeer.cs
- XpsS0ValidatingLoader.cs
- UserPreferenceChangingEventArgs.cs
- NameSpaceExtractor.cs
- UnsafeNativeMethods.cs
- XmlSchemaImport.cs
- DeviceFilterDictionary.cs
- DbCommandDefinition.cs
- PlainXmlWriter.cs
- ServerIdentity.cs
- CapiSymmetricAlgorithm.cs
- TextBoxAutoCompleteSourceConverter.cs
- BitmapImage.cs
- ValidatingReaderNodeData.cs
- CryptoHelper.cs
- RowToFieldTransformer.cs
- SourceFileBuildProvider.cs
- ExceptionUtility.cs
- InternalTypeHelper.cs
- UnsafeNativeMethods.cs
- ProviderConnectionPoint.cs
- ToolboxItemCollection.cs
- PathSegmentCollection.cs
- ProviderIncompatibleException.cs
- CmsUtils.cs
- OleDbConnection.cs
- Dynamic.cs
- FlowNode.cs
- BitmapEffectInput.cs
- ConnectionPoint.cs
- Transactions.cs
- DetailsViewDeleteEventArgs.cs
- QuaternionAnimationUsingKeyFrames.cs
- ByteConverter.cs
- ClassHandlersStore.cs
- SchemaNotation.cs
- CodeGeneratorOptions.cs
- HtmlSelect.cs
- CharConverter.cs
- SecurityStateEncoder.cs
- RouteParameter.cs
- SqlDependencyListener.cs
- AdapterUtil.cs
- NominalTypeEliminator.cs
- CodeIterationStatement.cs
- EdmToObjectNamespaceMap.cs
- FileDialogPermission.cs
- GrammarBuilderDictation.cs
- DBParameter.cs
- TemplateFactory.cs
- ReadContentAsBinaryHelper.cs
- TaskHelper.cs
- GraphicsState.cs