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
- SearchForVirtualItemEventArgs.cs
- SmiConnection.cs
- AutomationProperties.cs
- MDIWindowDialog.cs
- Pair.cs
- UInt16Converter.cs
- MiniCustomAttributeInfo.cs
- CacheForPrimitiveTypes.cs
- SynchronizationValidator.cs
- ConsoleCancelEventArgs.cs
- WebEventTraceProvider.cs
- Single.cs
- UnsafeNativeMethods.cs
- TraceEventCache.cs
- PrePrepareMethodAttribute.cs
- ImageButton.cs
- SizeAnimationClockResource.cs
- BlockCollection.cs
- WindowsHyperlink.cs
- PathTooLongException.cs
- MD5CryptoServiceProvider.cs
- TemplateManager.cs
- IdentityHolder.cs
- Attributes.cs
- CompilerHelpers.cs
- CacheMemory.cs
- BaseConfigurationRecord.cs
- ColumnBinding.cs
- WinFormsSpinner.cs
- ExpressionPrefixAttribute.cs
- PlatformNotSupportedException.cs
- NativeMethods.cs
- InvalidMessageContractException.cs
- SafeViewOfFileHandle.cs
- CryptoKeySecurity.cs
- GradientStop.cs
- AuthenticateEventArgs.cs
- DataServiceConfiguration.cs
- SupportsPreviewControlAttribute.cs
- CompilerGeneratedAttribute.cs
- Stopwatch.cs
- EventDescriptor.cs
- PointHitTestResult.cs
- EventLevel.cs
- DropShadowEffect.cs
- PnrpPermission.cs
- PrePostDescendentsWalker.cs
- ExpiredSecurityTokenException.cs
- SecurityDescriptor.cs
- MailBnfHelper.cs
- PrintEvent.cs
- NotImplementedException.cs
- ComboBoxItem.cs
- MailAddressCollection.cs
- CompiledELinqQueryState.cs
- HttpContextWrapper.cs
- IconConverter.cs
- Geometry3D.cs
- StrongNameMembershipCondition.cs
- GenericsInstances.cs
- TextTreeObjectNode.cs
- HttpListenerTimeoutManager.cs
- MetadataItem.cs
- BamlBinaryWriter.cs
- EditorPart.cs
- ObjectListSelectEventArgs.cs
- ComboBoxAutomationPeer.cs
- TransformerInfo.cs
- Triangle.cs
- BaseValidatorDesigner.cs
- PageParser.cs
- HttpListener.cs
- SystemNetworkInterface.cs
- ListViewEditEventArgs.cs
- HttpListenerRequest.cs
- MarkupObject.cs
- DateTimeUtil.cs
- DataGridViewEditingControlShowingEventArgs.cs
- KeyedQueue.cs
- UnicastIPAddressInformationCollection.cs
- TextBoxBase.cs
- FrameworkContextData.cs
- UidPropertyAttribute.cs
- GetPageCompletedEventArgs.cs
- DataGridViewCellValueEventArgs.cs
- WsdlBuildProvider.cs
- ComponentCodeDomSerializer.cs
- WorkflowDebuggerSteppingAttribute.cs
- ZoomPercentageConverter.cs
- BufferedGraphicsManager.cs
- CommandEventArgs.cs
- DBDataPermissionAttribute.cs
- CodeArrayIndexerExpression.cs
- XmlSortKey.cs
- __ConsoleStream.cs
- ParentQuery.cs
- StrongNameUtility.cs
- HtmlEmptyTagControlBuilder.cs
- PLINQETWProvider.cs
- LockRecursionException.cs