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
- BooleanAnimationUsingKeyFrames.cs
- FlatButtonAppearance.cs
- MatrixCamera.cs
- IdentityNotMappedException.cs
- CFGGrammar.cs
- PropertyChangingEventArgs.cs
- TextEndOfSegment.cs
- MembershipAdapter.cs
- HeaderCollection.cs
- ListBase.cs
- RegisteredHiddenField.cs
- PlaceHolder.cs
- RulePatternOps.cs
- Scene3D.cs
- DesignerAdRotatorAdapter.cs
- FixUp.cs
- TypefaceCollection.cs
- PropertyBuilder.cs
- ContractMapping.cs
- DbConnectionPoolCounters.cs
- ExpressionEditorAttribute.cs
- FormParameter.cs
- SafeCertificateContext.cs
- Assert.cs
- ProxyWebPart.cs
- SimpleFieldTemplateFactory.cs
- PeerCollaborationPermission.cs
- User.cs
- EmptyQuery.cs
- SignatureResourceHelper.cs
- XmlBoundElement.cs
- GenericRootAutomationPeer.cs
- Geometry.cs
- StronglyTypedResourceBuilder.cs
- OneOfScalarConst.cs
- UserNameSecurityTokenProvider.cs
- ByeMessage11.cs
- BindValidator.cs
- FileDialogCustomPlace.cs
- MediaTimeline.cs
- MultiPageTextView.cs
- ValueOfAction.cs
- ConfigXmlElement.cs
- SchemaTableOptionalColumn.cs
- ToolboxItemCollection.cs
- ReadWriteSpinLock.cs
- LinearKeyFrames.cs
- Catch.cs
- EntityDataSourceSelectingEventArgs.cs
- SecurityUtils.cs
- ActiveXMessageFormatter.cs
- ValueTypeFixupInfo.cs
- UdpConstants.cs
- DependencyObjectCodeDomSerializer.cs
- CachedCompositeFamily.cs
- StrokeCollectionDefaultValueFactory.cs
- Typography.cs
- documentsequencetextcontainer.cs
- CalendarAutoFormat.cs
- CheckBox.cs
- XmlUtil.cs
- SharedConnectionListener.cs
- RunClient.cs
- WindowsGraphics2.cs
- RelatedView.cs
- RawStylusActions.cs
- HostingEnvironmentException.cs
- Descriptor.cs
- ActionItem.cs
- AddInDeploymentState.cs
- UIElementParaClient.cs
- _AutoWebProxyScriptWrapper.cs
- ObjectRef.cs
- SpecularMaterial.cs
- ImageCreator.cs
- BindingMemberInfo.cs
- HttpProfileGroupBase.cs
- CqlLexerHelpers.cs
- CacheSection.cs
- BitmapEffectDrawingContent.cs
- XsltFunctions.cs
- ProjectionCamera.cs
- BinaryMethodMessage.cs
- MsmqIntegrationBindingCollectionElement.cs
- KeyNotFoundException.cs
- StrokeNodeOperations.cs
- Int64Storage.cs
- SecurityDescriptor.cs
- XmlCDATASection.cs
- httpserverutility.cs
- ScrollContentPresenter.cs
- TranslateTransform3D.cs
- HttpResponse.cs
- Empty.cs
- RightNameExpirationInfoPair.cs
- PackWebResponse.cs
- ColumnHeader.cs
- BoundingRectTracker.cs
- FragmentQueryProcessor.cs
- TextStore.cs