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
- Variable.cs
- AutomationEvent.cs
- InternalControlCollection.cs
- ItemCheckedEvent.cs
- CodeAttributeArgument.cs
- Bidi.cs
- NonVisualControlAttribute.cs
- CustomAttribute.cs
- SortQuery.cs
- SecurityTokenProvider.cs
- SamlAssertion.cs
- ValidationSummary.cs
- DesignerForm.cs
- ElementMarkupObject.cs
- DictionaryGlobals.cs
- RuleAttributes.cs
- ValidationResult.cs
- SystemDiagnosticsSection.cs
- BasicHttpMessageCredentialType.cs
- Part.cs
- ClientBuildManagerCallback.cs
- WebPartUtil.cs
- SspiSafeHandles.cs
- OracleDataReader.cs
- DataReceivedEventArgs.cs
- TranslateTransform.cs
- EmissiveMaterial.cs
- WebPartManagerInternals.cs
- Preprocessor.cs
- WmfPlaceableFileHeader.cs
- ActivityDefaults.cs
- TextParaLineResult.cs
- TableProviderWrapper.cs
- ComponentResourceManager.cs
- CipherData.cs
- PropertyDescriptorGridEntry.cs
- DataGridColumnHeaderCollection.cs
- PrimitiveSchema.cs
- ExpressionTextBox.xaml.cs
- DiagnosticsElement.cs
- AlgoModule.cs
- SoapEnumAttribute.cs
- SqlBulkCopy.cs
- WebPartDescription.cs
- TypeSystem.cs
- StorageEntityTypeMapping.cs
- PolicyManager.cs
- MethodAccessException.cs
- TraceContextEventArgs.cs
- PenThread.cs
- TextContainerChangedEventArgs.cs
- UnmanagedMemoryStreamWrapper.cs
- DecoderFallback.cs
- CollectionViewGroup.cs
- BoundField.cs
- JavaScriptSerializer.cs
- ProviderConnectionPoint.cs
- DataKeyCollection.cs
- BitmapVisualManager.cs
- FileSystemWatcher.cs
- FileAuthorizationModule.cs
- EncoderFallback.cs
- ChtmlTextWriter.cs
- RuntimeComponentFilter.cs
- CheckBoxRenderer.cs
- OutputCacheSettings.cs
- XPathAncestorQuery.cs
- GuidTagList.cs
- XmlIlGenerator.cs
- XPathNavigator.cs
- KnownTypes.cs
- DetailsViewActionList.cs
- ItemsControlAutomationPeer.cs
- SizeValueSerializer.cs
- SafeHandles.cs
- Iis7Helper.cs
- CompiledQueryCacheEntry.cs
- QualifierSet.cs
- PrintDocument.cs
- xmlglyphRunInfo.cs
- Input.cs
- UIntPtr.cs
- COM2ExtendedUITypeEditor.cs
- recordstatefactory.cs
- QueryUtil.cs
- AffineTransform3D.cs
- SystemTcpConnection.cs
- KeyValueInternalCollection.cs
- PartitionerQueryOperator.cs
- Oid.cs
- DataSetMappper.cs
- xml.cs
- RuleInfoComparer.cs
- ReadWriteSpinLock.cs
- RecognizeCompletedEventArgs.cs
- RawStylusInputReport.cs
- ListViewTableCell.cs
- Soap12ServerProtocol.cs
- ConfigurationManager.cs
- ListViewGroupItemCollection.cs