Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- StaticTextPointer.cs
- ServiceContractViewControl.Designer.cs
- ObjectListItem.cs
- WebPartManagerDesigner.cs
- bidPrivateBase.cs
- ManifestBasedResourceGroveler.cs
- InputLanguageProfileNotifySink.cs
- WebPartTransformerCollection.cs
- RestHandler.cs
- HttpCookieCollection.cs
- NativeMethods.cs
- StandardCommands.cs
- EdmRelationshipRoleAttribute.cs
- ErrorView.xaml.cs
- SettingsProviderCollection.cs
- EventMappingSettings.cs
- FilteredXmlReader.cs
- ProtectedUri.cs
- NativeMethodsCLR.cs
- InputLanguageProfileNotifySink.cs
- DesignTimeParseData.cs
- ExeContext.cs
- SQLResource.cs
- RegisteredDisposeScript.cs
- AnnotationElement.cs
- HybridObjectCache.cs
- ListItemConverter.cs
- PartialCachingAttribute.cs
- ContentWrapperAttribute.cs
- DataGridViewColumnEventArgs.cs
- XmlNodeList.cs
- SqlClientFactory.cs
- HtmlTernaryTree.cs
- TextServicesDisplayAttribute.cs
- FaultReasonText.cs
- CodeNamespaceCollection.cs
- NameValueCollection.cs
- ByteConverter.cs
- XmlArrayItemAttributes.cs
- RegexWorker.cs
- Context.cs
- ProtocolInformationReader.cs
- ScrollProperties.cs
- UnionCodeGroup.cs
- RightsController.cs
- BitSet.cs
- DataObjectAttribute.cs
- COM2ColorConverter.cs
- serverconfig.cs
- ObjectTokenCategory.cs
- ImageListStreamer.cs
- Baml2006ReaderSettings.cs
- ReadWriteObjectLock.cs
- DetailsViewPagerRow.cs
- BitmapFrameDecode.cs
- CustomMenuItemCollection.cs
- SerializableAttribute.cs
- AxImporter.cs
- DelegateOutArgument.cs
- UIElement3D.cs
- ConfigurationValues.cs
- XPathParser.cs
- WebControlAdapter.cs
- ValidationError.cs
- SmuggledIUnknown.cs
- ListView.cs
- TextBoxBase.cs
- ControlCommandSet.cs
- SpellerInterop.cs
- UInt64Converter.cs
- PointValueSerializer.cs
- UnSafeCharBuffer.cs
- StylusLogic.cs
- SID.cs
- LayoutTable.cs
- BaseDataBoundControlDesigner.cs
- TableStyle.cs
- ObjectListDesigner.cs
- FormViewModeEventArgs.cs
- EventTask.cs
- StorageAssociationSetMapping.cs
- IQueryable.cs
- PointLight.cs
- SqlBulkCopyColumnMapping.cs
- EUCJPEncoding.cs
- DeriveBytes.cs
- DesignTimeTemplateParser.cs
- LoginCancelEventArgs.cs
- TransportChannelListener.cs
- XmlSchemaProviderAttribute.cs
- DesignerOptionService.cs
- StyleCollectionEditor.cs
- HtmlTitle.cs
- InternalConfigConfigurationFactory.cs
- SchemaNames.cs
- _FixedSizeReader.cs
- WindowsSecurityToken.cs
- EventDescriptorCollection.cs
- CaseInsensitiveHashCodeProvider.cs
- SqlProcedureAttribute.cs