Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / CompMod / System / ComponentModel / MultilineStringConverter.cs / 1 / MultilineStringConverter.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.ComponentModel {
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Diagnostics;
using System.Globalization;
using System.Security.Permissions;
///
/// Provides a type converter to convert multiline strings to a simple string.
///
[HostProtection(SharedState = true)]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
public class MultilineStringConverter : TypeConverter {
///
/// Converts the given value object to the specified destination type.
///
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) {
if (destinationType == null) {
throw new ArgumentNullException("destinationType");
}
if (destinationType == typeof(string)) {
if (value is string) {
return SR.GetString(SR.MultilineStringConverterText);
}
}
return base.ConvertTo(context, culture, value, destinationType);
}
///
/// Gets a collection of properties for the type of array specified by the value
/// parameter using the specified context and attributes.
///
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes) {
return null;
}
///
/// Gets a value indicating whether this object supports properties.
///
public override bool GetPropertiesSupported(ITypeDescriptorContext context) {
return false;
}
}
}
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- NumberFormatInfo.cs
- CanExecuteRoutedEventArgs.cs
- BooleanAnimationUsingKeyFrames.cs
- SizeAnimationUsingKeyFrames.cs
- OdbcFactory.cs
- ResourceManager.cs
- TypeConstant.cs
- XamlTreeBuilderBamlRecordWriter.cs
- XmlAttributeOverrides.cs
- Pen.cs
- XmlCharCheckingWriter.cs
- ExpressionSelection.cs
- TargetParameterCountException.cs
- SafeFileMappingHandle.cs
- DynamicValidator.cs
- HotCommands.cs
- Debugger.cs
- WCFServiceClientProxyGenerator.cs
- DbConnectionPoolOptions.cs
- MgmtResManager.cs
- CopyAction.cs
- CustomCredentialPolicy.cs
- MimeBasePart.cs
- TryLoadRunnableWorkflowCommand.cs
- Pool.cs
- ContentPropertyAttribute.cs
- ScriptingProfileServiceSection.cs
- ColorTransform.cs
- CodeArgumentReferenceExpression.cs
- TextFragmentEngine.cs
- AspNetSynchronizationContext.cs
- X509RecipientCertificateServiceElement.cs
- UpdateTracker.cs
- SimpleBitVector32.cs
- Clock.cs
- DataObjectPastingEventArgs.cs
- ValidationPropertyAttribute.cs
- CapabilitiesAssignment.cs
- VolatileEnlistmentState.cs
- SecUtil.cs
- SystemIPAddressInformation.cs
- HttpNamespaceReservationInstallComponent.cs
- InfoCardCryptoHelper.cs
- Thread.cs
- OleDbWrapper.cs
- ProtocolReflector.cs
- XmlExtensionFunction.cs
- EmissiveMaterial.cs
- SrgsRulesCollection.cs
- UrlAuthFailedErrorFormatter.cs
- UnsafeNativeMethods.cs
- HMAC.cs
- Mutex.cs
- Rectangle.cs
- XmlKeywords.cs
- ReflectPropertyDescriptor.cs
- VariantWrapper.cs
- _IPv6Address.cs
- EntitySetRetriever.cs
- PkcsUtils.cs
- ObjectDataSourceStatusEventArgs.cs
- WebPartTracker.cs
- Tool.cs
- SqlExpressionNullability.cs
- MsdtcWrapper.cs
- DataTableClearEvent.cs
- WebPartManager.cs
- SubpageParagraph.cs
- DefaultPropertyAttribute.cs
- UTF7Encoding.cs
- ContextQuery.cs
- CallbackValidator.cs
- Exceptions.cs
- MostlySingletonList.cs
- MappingSource.cs
- WeakHashtable.cs
- HeaderCollection.cs
- TypeLibConverter.cs
- IdentityHolder.cs
- mediaeventargs.cs
- COAUTHINFO.cs
- Utils.cs
- RankException.cs
- MenuItemStyleCollection.cs
- TextRunCacheImp.cs
- AppearanceEditorPart.cs
- MultipartIdentifier.cs
- SqlClientMetaDataCollectionNames.cs
- Bezier.cs
- Image.cs
- DataReaderContainer.cs
- SendSecurityHeader.cs
- followingquery.cs
- LinearGradientBrush.cs
- SymmetricKey.cs
- DbDataAdapter.cs
- XmlWriter.cs
- MethodBody.cs
- Point3DConverter.cs
- XPathDocumentNavigator.cs