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
- ServiceOperation.cs
- Sequence.cs
- ListSortDescriptionCollection.cs
- ToolStripTextBox.cs
- BitVec.cs
- XmlSchemaAttribute.cs
- UserControlBuildProvider.cs
- followingquery.cs
- ProfileSettingsCollection.cs
- StyleXamlTreeBuilder.cs
- DynamicRouteExpression.cs
- DocumentApplicationJournalEntry.cs
- NativeRightsManagementAPIsStructures.cs
- DependencyProperty.cs
- BuilderInfo.cs
- HealthMonitoringSection.cs
- MetadataStore.cs
- Trigger.cs
- WebPartCloseVerb.cs
- CompositeFontInfo.cs
- Tokenizer.cs
- SurrogateDataContract.cs
- XsltSettings.cs
- SyndicationPerson.cs
- Rectangle.cs
- SpellerHighlightLayer.cs
- DataListItem.cs
- Win32Native.cs
- RootBrowserWindowProxy.cs
- QuaternionAnimation.cs
- elementinformation.cs
- CodeCommentStatement.cs
- RemotingAttributes.cs
- DefaultMergeHelper.cs
- StylusPointProperty.cs
- ListViewGroup.cs
- ThreadTrace.cs
- QueryableFilterRepeater.cs
- CompiledXpathExpr.cs
- Menu.cs
- DecoderNLS.cs
- BitmapFrameEncode.cs
- EditCommandColumn.cs
- ConcurrentDictionary.cs
- CapabilitiesSection.cs
- XmlNodeList.cs
- DataServiceConfiguration.cs
- Models.cs
- ConfigurationManagerHelper.cs
- XsdBuildProvider.cs
- IndependentAnimationStorage.cs
- WindowsButton.cs
- UInt64Converter.cs
- RectConverter.cs
- ArraySortHelper.cs
- DeviceFilterEditorDialog.cs
- ReadOnlyHierarchicalDataSourceView.cs
- ByteConverter.cs
- HttpModuleCollection.cs
- PropertyBuilder.cs
- ThreadInterruptedException.cs
- ButtonStandardAdapter.cs
- HtmlControlPersistable.cs
- RijndaelManaged.cs
- UnknownWrapper.cs
- Page.cs
- SecurityUtils.cs
- Automation.cs
- Tuple.cs
- StrongNameIdentityPermission.cs
- DataColumnPropertyDescriptor.cs
- Int32Rect.cs
- CodePropertyReferenceExpression.cs
- MeshGeometry3D.cs
- DependencyObjectProvider.cs
- EntityDataSourceConfigureObjectContextPanel.cs
- DependencyObjectValidator.cs
- CornerRadius.cs
- CodeIdentifiers.cs
- CustomAttribute.cs
- SchemaComplexType.cs
- XsltFunctions.cs
- NavigationExpr.cs
- XamlToRtfWriter.cs
- TreeView.cs
- coordinatorfactory.cs
- ValidationResult.cs
- _SslState.cs
- File.cs
- GCHandleCookieTable.cs
- InputLanguageEventArgs.cs
- QueryExecutionOption.cs
- HeaderUtility.cs
- PhoneCall.cs
- AutoScrollExpandMessageFilter.cs
- SynchronizedDispatch.cs
- UniqueID.cs
- WebPartMovingEventArgs.cs
- KeyedCollection.cs
- ConstraintConverter.cs