Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// 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;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- EventLogTraceListener.cs
- PropertyRecord.cs
- InvokePattern.cs
- AsyncResult.cs
- FrameworkContentElement.cs
- FileLogRecord.cs
- BinaryObjectInfo.cs
- TextServicesCompartmentEventSink.cs
- TextContainerChangedEventArgs.cs
- Pair.cs
- MonthCalendar.cs
- CookieProtection.cs
- ObjectDataSourceChooseMethodsPanel.cs
- MatrixAnimationUsingPath.cs
- IUnknownConstantAttribute.cs
- TextSelectionProcessor.cs
- AppDomainUnloadedException.cs
- HttpResponse.cs
- DbProviderConfigurationHandler.cs
- LineSegment.cs
- OleDbEnumerator.cs
- ToolStripItemCollection.cs
- panel.cs
- TextCollapsingProperties.cs
- UriScheme.cs
- QueryConverter.cs
- DbConnectionClosed.cs
- MessageDescriptionCollection.cs
- Win32Native.cs
- HtmlShimManager.cs
- DesignerLoader.cs
- UInt16Converter.cs
- DrawingGroupDrawingContext.cs
- Section.cs
- Vector3dCollection.cs
- RecommendedAsConfigurableAttribute.cs
- prefixendpointaddressmessagefilter.cs
- PrivilegeNotHeldException.cs
- MsmqMessageSerializationFormat.cs
- WebPartVerb.cs
- DesignerTextBoxAdapter.cs
- DtdParser.cs
- InputScope.cs
- DefaultConfirmation.cs
- FlowchartDesigner.xaml.cs
- URI.cs
- WindowsRichEdit.cs
- Hash.cs
- UpdatePanelControlTrigger.cs
- IImplicitResourceProvider.cs
- SrgsText.cs
- CodeTypeParameter.cs
- X509ServiceCertificateAuthenticationElement.cs
- GatewayDefinition.cs
- EdmComplexPropertyAttribute.cs
- HTMLTagNameToTypeMapper.cs
- SystemNetHelpers.cs
- GroupQuery.cs
- ListBindingHelper.cs
- Handle.cs
- PrimarySelectionGlyph.cs
- BrowserDefinitionCollection.cs
- WebControlToolBoxItem.cs
- DbParameterCollectionHelper.cs
- ErrorTableItemStyle.cs
- UnsignedPublishLicense.cs
- HtmlHead.cs
- FileSystemWatcher.cs
- Misc.cs
- CompilerState.cs
- ValidatingPropertiesEventArgs.cs
- HideDisabledControlAdapter.cs
- WindowsFormsDesignerOptionService.cs
- Empty.cs
- SafeLibraryHandle.cs
- BitmapCacheBrush.cs
- DefaultValueAttribute.cs
- querybuilder.cs
- SelectQueryOperator.cs
- JsonByteArrayDataContract.cs
- StringAnimationUsingKeyFrames.cs
- TypeExtension.cs
- FontCollection.cs
- FrameDimension.cs
- LogSwitch.cs
- HtmlHistory.cs
- SelectionItemPattern.cs
- Grid.cs
- ModelProperty.cs
- Separator.cs
- MarkupProperty.cs
- ImportOptions.cs
- PerformanceCounterLib.cs
- ObjectTag.cs
- OutputWindow.cs
- EntityModelBuildProvider.cs
- DocumentXmlWriter.cs
- Graph.cs
- VirtualizingStackPanel.cs
- KeyedHashAlgorithm.cs