Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / DefaultPropertyAttribute.cs / 1305376 / DefaultPropertyAttribute.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
*/
namespace System.ComponentModel {
using System;
using System.Diagnostics;
using System.Security.Permissions;
///
/// Specifies the default property for a component.
///
[AttributeUsage(AttributeTargets.Class)]
public sealed class DefaultPropertyAttribute : Attribute {
///
/// This is the default event name.
///
private readonly string name;
///
///
/// Initializes a new instance of
/// the class.
///
///
public DefaultPropertyAttribute(string name) {
this.name = name;
}
///
///
/// Gets the name of the default property for the component this attribute is
/// bound to.
///
///
public string Name {
get {
return name;
}
}
///
///
/// Specifies the default value for the , which is . This
/// field is read-only.
///
///
public static readonly DefaultPropertyAttribute Default = new DefaultPropertyAttribute(null);
public override bool Equals(object obj) {
DefaultPropertyAttribute other = obj as DefaultPropertyAttribute;
return (other != null) && other.Name == name;
}
public override int GetHashCode() {
return base.GetHashCode();
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
*/
namespace System.ComponentModel {
using System;
using System.Diagnostics;
using System.Security.Permissions;
///
/// Specifies the default property for a component.
///
[AttributeUsage(AttributeTargets.Class)]
public sealed class DefaultPropertyAttribute : Attribute {
///
/// This is the default event name.
///
private readonly string name;
///
///
/// Initializes a new instance of
/// the class.
///
///
public DefaultPropertyAttribute(string name) {
this.name = name;
}
///
///
/// Gets the name of the default property for the component this attribute is
/// bound to.
///
///
public string Name {
get {
return name;
}
}
///
///
/// Specifies the default value for the , which is . This
/// field is read-only.
///
///
public static readonly DefaultPropertyAttribute Default = new DefaultPropertyAttribute(null);
public override bool Equals(object obj) {
DefaultPropertyAttribute other = obj as DefaultPropertyAttribute;
return (other != null) && other.Name == name;
}
public override int GetHashCode() {
return base.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
- SystemIPInterfaceProperties.cs
- MonthCalendarDesigner.cs
- XmlSchemaSimpleContentExtension.cs
- PerfCounterSection.cs
- WinEventWrap.cs
- Misc.cs
- XmlSchemaObjectTable.cs
- EncodingTable.cs
- DesignerRegion.cs
- WebPartZone.cs
- SerialStream.cs
- CharConverter.cs
- SignatureGenerator.cs
- DbConnectionPoolGroupProviderInfo.cs
- QualifiedCellIdBoolean.cs
- FilterUserControlBase.cs
- OleDbInfoMessageEvent.cs
- ConditionCollection.cs
- Window.cs
- PointAnimationUsingKeyFrames.cs
- ContractMapping.cs
- HttpHostedTransportConfiguration.cs
- FixedSOMContainer.cs
- FixedDocumentPaginator.cs
- AncillaryOps.cs
- ComponentResourceManager.cs
- SqlCachedBuffer.cs
- StringPropertyBuilder.cs
- HostingEnvironmentWrapper.cs
- Decoder.cs
- ListItemCollection.cs
- Span.cs
- BinarySerializer.cs
- ProtocolsConfigurationHandler.cs
- EventLogEntry.cs
- MarkupObject.cs
- TextSelectionProcessor.cs
- XmlSchemaCollection.cs
- NavigationWindow.cs
- HwndTarget.cs
- XmlHelper.cs
- ThrowHelper.cs
- ResXResourceReader.cs
- StatusBarItem.cs
- DataGridViewBand.cs
- XmlArrayItemAttributes.cs
- ConfigXmlCDataSection.cs
- PageAsyncTask.cs
- SchemaImporterExtensionsSection.cs
- WSDualHttpSecurityMode.cs
- SrgsSemanticInterpretationTag.cs
- MultiByteCodec.cs
- TagNameToTypeMapper.cs
- ListViewGroup.cs
- DataGridViewColumnStateChangedEventArgs.cs
- PipelineComponent.cs
- NativeMethods.cs
- EventHandlerList.cs
- LineBreak.cs
- JoinElimination.cs
- UrlMapping.cs
- SystemIcmpV6Statistics.cs
- NonVisualControlAttribute.cs
- SqlPersonalizationProvider.cs
- GradientStopCollection.cs
- DefaultTextStore.cs
- RIPEMD160.cs
- ZipIOLocalFileDataDescriptor.cs
- WizardStepBase.cs
- ApplyImportsAction.cs
- ServiceDeploymentInfo.cs
- SafeSecurityHandles.cs
- XPathDescendantIterator.cs
- Version.cs
- EditorZone.cs
- IApplicationTrustManager.cs
- TextContainerChangeEventArgs.cs
- UriTemplateMatchException.cs
- Header.cs
- RoleManagerEventArgs.cs
- StatementContext.cs
- ConfigurationValidatorAttribute.cs
- Crypto.cs
- KnownTypesHelper.cs
- DataGridLength.cs
- LineServicesRun.cs
- SafeRightsManagementHandle.cs
- InternalUserCancelledException.cs
- ObjectDataProvider.cs
- StreamAsIStream.cs
- X509Certificate2Collection.cs
- NetworkInformationException.cs
- AsymmetricAlgorithm.cs
- DiagnosticTrace.cs
- Main.cs
- ActivationArguments.cs
- EventlogProvider.cs
- DataServiceEntityAttribute.cs
- DbProviderConfigurationHandler.cs
- InputGestureCollection.cs