Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / CompMod / System / ComponentModel / TypeConverterAttribute.cs / 1 / TypeConverterAttribute.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
*/
namespace System.ComponentModel {
using System.Diagnostics;
using System.Globalization;
using System.Runtime.Serialization.Formatters;
using System.Security.Permissions;
///
/// Specifies what type to use as
/// a converter for the object
/// this
/// attribute is bound to. This class cannot
/// be inherited.
///
[AttributeUsage(AttributeTargets.All)]
public sealed class TypeConverterAttribute : Attribute {
private string typeName;
///
/// Specifies the type to use as
/// a converter for the object this attribute is bound to. This
/// field is read-only.
///
public static readonly TypeConverterAttribute Default = new TypeConverterAttribute();
///
///
/// Initializes a new instance of the class with the
/// default type converter, which
/// is an
/// empty string ("").
///
///
public TypeConverterAttribute() {
this.typeName = string.Empty;
}
///
/// Initializes a new instance of the class, using
/// the specified type as the data converter for the object this attribute
/// is bound
/// to.
///
public TypeConverterAttribute(Type type) {
this.typeName = type.AssemblyQualifiedName;
}
///
/// Initializes a new instance of the class, using
/// the specified type name as the data converter for the object this attribute is bound to.
///
public TypeConverterAttribute(string typeName) {
string temp = typeName.ToUpper(CultureInfo.InvariantCulture);
Debug.Assert(temp.IndexOf(".DLL") == -1, "Came across: " + typeName + " . Please remove the .dll extension");
this.typeName = typeName;
}
///
/// Gets the fully qualified type name of the
/// to use as a converter for the object this attribute
/// is bound to.
///
public string ConverterTypeName {
get {
return typeName;
}
}
public override bool Equals(object obj) {
TypeConverterAttribute other = obj as TypeConverterAttribute;
return (other != null) && other.ConverterTypeName == typeName;
}
public override int GetHashCode() {
return typeName.GetHashCode();
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
*/
namespace System.ComponentModel {
using System.Diagnostics;
using System.Globalization;
using System.Runtime.Serialization.Formatters;
using System.Security.Permissions;
///
/// Specifies what type to use as
/// a converter for the object
/// this
/// attribute is bound to. This class cannot
/// be inherited.
///
[AttributeUsage(AttributeTargets.All)]
public sealed class TypeConverterAttribute : Attribute {
private string typeName;
///
/// Specifies the type to use as
/// a converter for the object this attribute is bound to. This
/// field is read-only.
///
public static readonly TypeConverterAttribute Default = new TypeConverterAttribute();
///
///
/// Initializes a new instance of the class with the
/// default type converter, which
/// is an
/// empty string ("").
///
///
public TypeConverterAttribute() {
this.typeName = string.Empty;
}
///
/// Initializes a new instance of the class, using
/// the specified type as the data converter for the object this attribute
/// is bound
/// to.
///
public TypeConverterAttribute(Type type) {
this.typeName = type.AssemblyQualifiedName;
}
///
/// Initializes a new instance of the class, using
/// the specified type name as the data converter for the object this attribute is bound to.
///
public TypeConverterAttribute(string typeName) {
string temp = typeName.ToUpper(CultureInfo.InvariantCulture);
Debug.Assert(temp.IndexOf(".DLL") == -1, "Came across: " + typeName + " . Please remove the .dll extension");
this.typeName = typeName;
}
///
/// Gets the fully qualified type name of the
/// to use as a converter for the object this attribute
/// is bound to.
///
public string ConverterTypeName {
get {
return typeName;
}
}
public override bool Equals(object obj) {
TypeConverterAttribute other = obj as TypeConverterAttribute;
return (other != null) && other.ConverterTypeName == typeName;
}
public override int GetHashCode() {
return typeName.GetHashCode();
}
}
}
// 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
- XmlAttributeCache.cs
- JoinSymbol.cs
- AnnouncementClient.cs
- VectorCollectionValueSerializer.cs
- TextServicesCompartmentEventSink.cs
- Quaternion.cs
- StringValueSerializer.cs
- ContentPlaceHolder.cs
- SqlTransaction.cs
- FloaterBaseParaClient.cs
- ZipFileInfoCollection.cs
- XmlDataProvider.cs
- StorageInfo.cs
- DefaultTextStore.cs
- HtmlInputImage.cs
- CompressEmulationStream.cs
- ErrorReporting.cs
- Hash.cs
- InkCanvasSelection.cs
- IntersectQueryOperator.cs
- SapiRecoContext.cs
- CreateDataSourceDialog.cs
- DataColumnCollection.cs
- safesecurityhelperavalon.cs
- wgx_commands.cs
- PartialCachingControl.cs
- Cursors.cs
- ReceiveActivityDesignerTheme.cs
- WebPartAddingEventArgs.cs
- Accessors.cs
- SchemaTableOptionalColumn.cs
- HtmlLiteralTextAdapter.cs
- WorkflowPageSetupDialog.cs
- Rule.cs
- TextPointer.cs
- CreateUserErrorEventArgs.cs
- TriState.cs
- DependencyPropertyValueSerializer.cs
- WebPartConnectionsConnectVerb.cs
- AudioException.cs
- Boolean.cs
- SqlNotificationEventArgs.cs
- UInt32Storage.cs
- HtmlListAdapter.cs
- Style.cs
- ReferencedCollectionType.cs
- ListMarkerSourceInfo.cs
- CodeMethodReturnStatement.cs
- TranslateTransform3D.cs
- MenuCommand.cs
- ResourcesGenerator.cs
- OperatorExpressions.cs
- ObjectStateEntryDbDataRecord.cs
- RootDesignerSerializerAttribute.cs
- _NegoStream.cs
- Int32AnimationUsingKeyFrames.cs
- BitmapFrameEncode.cs
- ISessionStateStore.cs
- UpDownEvent.cs
- TextSpan.cs
- MethodToken.cs
- ExtensionQuery.cs
- ConfigurationPropertyCollection.cs
- QilGenerator.cs
- PropertyChangedEventArgs.cs
- DateTimeFormatInfoScanner.cs
- PageWrapper.cs
- Point4D.cs
- XmlSchemaAll.cs
- PersonalizationStateQuery.cs
- SinglePhaseEnlistment.cs
- ScriptingProfileServiceSection.cs
- LoginUtil.cs
- LogReservationCollection.cs
- RSAPKCS1SignatureDeformatter.cs
- PackageFilter.cs
- WindowsEditBox.cs
- NameValueSectionHandler.cs
- HostedElements.cs
- DefaultHttpHandler.cs
- RegisteredDisposeScript.cs
- ThreadStaticAttribute.cs
- MessageHeaderException.cs
- PropertyMapper.cs
- Page.cs
- GlyphTypeface.cs
- SinglePageViewer.cs
- PriorityItem.cs
- TypeReference.cs
- _LocalDataStoreMgr.cs
- XMLDiffLoader.cs
- MD5.cs
- GridViewColumnCollectionChangedEventArgs.cs
- streamingZipPartStream.cs
- MethodBody.cs
- DataGridTemplateColumn.cs
- SatelliteContractVersionAttribute.cs
- OutputCacheSettingsSection.cs
- PropertyTabAttribute.cs
- TextControlDesigner.cs