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
- WebPartDescriptionCollection.cs
- SqlRemoveConstantOrderBy.cs
- _HeaderInfoTable.cs
- TypedReference.cs
- WebPartDeleteVerb.cs
- XPathNavigator.cs
- BitmapMetadataEnumerator.cs
- Random.cs
- IconHelper.cs
- Attributes.cs
- ReferentialConstraint.cs
- TimeoutException.cs
- TextPointerBase.cs
- SQLDouble.cs
- HtmlFormParameterReader.cs
- DataRecordInfo.cs
- HandlerBase.cs
- ProcessModuleCollection.cs
- Buffer.cs
- ClientRoleProvider.cs
- Journal.cs
- XmlSequenceWriter.cs
- NetCodeGroup.cs
- DeflateEmulationStream.cs
- DataControlCommands.cs
- MenuEventArgs.cs
- RelationshipManager.cs
- AppLevelCompilationSectionCache.cs
- CounterCreationData.cs
- DbProviderSpecificTypePropertyAttribute.cs
- WmlPanelAdapter.cs
- ColorConverter.cs
- BufferedStream.cs
- AvTraceDetails.cs
- SqlBulkCopyColumnMappingCollection.cs
- TracedNativeMethods.cs
- ViewStateException.cs
- StringExpressionSet.cs
- TextDecoration.cs
- RegexWriter.cs
- SessionParameter.cs
- DiagnosticTraceSource.cs
- DropShadowBitmapEffect.cs
- PriorityChain.cs
- StringUtil.cs
- AQNBuilder.cs
- Utils.cs
- CodeVariableReferenceExpression.cs
- WindowsGraphics.cs
- ListItemParagraph.cs
- NumberAction.cs
- InterleavedZipPartStream.cs
- sortedlist.cs
- DbDataSourceEnumerator.cs
- NavigateUrlConverter.cs
- QueryStatement.cs
- mediaeventargs.cs
- ControlCollection.cs
- TextElementCollectionHelper.cs
- AnimationClockResource.cs
- MarkupCompiler.cs
- SimpleTextLine.cs
- RestHandler.cs
- WindowsTokenRoleProvider.cs
- SafeWaitHandle.cs
- TreeViewImageIndexConverter.cs
- BindingListCollectionView.cs
- PnrpPermission.cs
- WindowsHyperlink.cs
- DiscreteKeyFrames.cs
- WebCodeGenerator.cs
- SByteStorage.cs
- TaskFormBase.cs
- BindingContext.cs
- AutomationPatternInfo.cs
- RedistVersionInfo.cs
- WindowsListViewItem.cs
- DataColumnChangeEvent.cs
- MetadataException.cs
- HMACSHA1.cs
- RequiredFieldValidator.cs
- InvalidMessageContractException.cs
- SchemaDeclBase.cs
- XsltOutput.cs
- AnonymousIdentificationSection.cs
- NotifyIcon.cs
- CommandExpr.cs
- Lease.cs
- XmlNodeList.cs
- SharedDp.cs
- PrimitiveCodeDomSerializer.cs
- FormViewPageEventArgs.cs
- FacetEnabledSchemaElement.cs
- WebEventTraceProvider.cs
- ThicknessKeyFrameCollection.cs
- MachineKeyConverter.cs
- ConstraintEnumerator.cs
- WindowsListBox.cs
- VariableAction.cs
- IndentedWriter.cs