Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / CompMod / System / ComponentModel / ProvidePropertyAttribute.cs / 1 / ProvidePropertyAttribute.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
*/
namespace System.ComponentModel {
using System;
using System.Diagnostics;
using System.Security.Permissions;
///
/// Specifies which methods are extender
/// properties.
///
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public sealed class ProvidePropertyAttribute : Attribute {
private readonly string propertyName;
private readonly string receiverTypeName;
///
/// Initializes a new instance of the class.
///
public ProvidePropertyAttribute(string propertyName, Type receiverType) {
this.propertyName = propertyName;
this.receiverTypeName = receiverType.AssemblyQualifiedName;
}
///
/// Initializes a new instance of the class.
///
public ProvidePropertyAttribute(string propertyName, string receiverTypeName) {
this.propertyName = propertyName;
this.receiverTypeName = receiverTypeName;
}
///
///
/// Gets the name of a property that this class provides.
///
///
public string PropertyName {
get {
return propertyName;
}
}
///
///
/// Gets the name of the data type this property can extend
///
///
public string ReceiverTypeName {
get {
return receiverTypeName;
}
}
///
/// ProvidePropertyAttribute overrides this to include the type name and the property name
///
public override object TypeId {
get {
return GetType().FullName + propertyName;
}
}
public override bool Equals(object obj) {
if (obj == this) {
return true;
}
ProvidePropertyAttribute other = obj as ProvidePropertyAttribute;
return (other != null) && other.propertyName == propertyName && other.receiverTypeName == receiverTypeName;
}
public override int GetHashCode() {
return propertyName.GetHashCode() ^ receiverTypeName.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 which methods are extender
/// properties.
///
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public sealed class ProvidePropertyAttribute : Attribute {
private readonly string propertyName;
private readonly string receiverTypeName;
///
/// Initializes a new instance of the class.
///
public ProvidePropertyAttribute(string propertyName, Type receiverType) {
this.propertyName = propertyName;
this.receiverTypeName = receiverType.AssemblyQualifiedName;
}
///
/// Initializes a new instance of the class.
///
public ProvidePropertyAttribute(string propertyName, string receiverTypeName) {
this.propertyName = propertyName;
this.receiverTypeName = receiverTypeName;
}
///
///
/// Gets the name of a property that this class provides.
///
///
public string PropertyName {
get {
return propertyName;
}
}
///
///
/// Gets the name of the data type this property can extend
///
///
public string ReceiverTypeName {
get {
return receiverTypeName;
}
}
///
/// ProvidePropertyAttribute overrides this to include the type name and the property name
///
public override object TypeId {
get {
return GetType().FullName + propertyName;
}
}
public override bool Equals(object obj) {
if (obj == this) {
return true;
}
ProvidePropertyAttribute other = obj as ProvidePropertyAttribute;
return (other != null) && other.propertyName == propertyName && other.receiverTypeName == receiverTypeName;
}
public override int GetHashCode() {
return propertyName.GetHashCode() ^ receiverTypeName.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
- ListenerElementsCollection.cs
- ConstraintEnumerator.cs
- ComboBoxItem.cs
- Flattener.cs
- iisPickupDirectory.cs
- PasswordDeriveBytes.cs
- DataObject.cs
- EditorZoneBase.cs
- ReflectionPermission.cs
- TextHidden.cs
- _AutoWebProxyScriptHelper.cs
- AudioSignalProblemOccurredEventArgs.cs
- Package.cs
- ErrorBehavior.cs
- NameValuePair.cs
- ItemCheckEvent.cs
- AngleUtil.cs
- PermissionAttributes.cs
- MergeFailedEvent.cs
- ListItemCollection.cs
- PipelineModuleStepContainer.cs
- Column.cs
- PermissionSetEnumerator.cs
- DelimitedListTraceListener.cs
- UserMapPath.cs
- BaseDataBoundControl.cs
- DoubleStorage.cs
- FormViewUpdateEventArgs.cs
- ScrollChrome.cs
- Resources.Designer.cs
- _ShellExpression.cs
- WorkflowApplicationCompletedEventArgs.cs
- TextEditorTyping.cs
- DataBinder.cs
- RTTrackingProfile.cs
- Menu.cs
- SystemException.cs
- Activator.cs
- ChangePassword.cs
- EntityDataSource.cs
- XamlStackWriter.cs
- StringCollection.cs
- Transform.cs
- MappingSource.cs
- StreamWithDictionary.cs
- DBSqlParser.cs
- NoResizeHandleGlyph.cs
- IISMapPath.cs
- CharUnicodeInfo.cs
- WindowInteropHelper.cs
- FileEnumerator.cs
- ConnectorRouter.cs
- XmlBoundElement.cs
- XamlTypeMapper.cs
- MemoryStream.cs
- PixelFormat.cs
- DictionaryCustomTypeDescriptor.cs
- OleDbPropertySetGuid.cs
- Decimal.cs
- XmlSerializerAssemblyAttribute.cs
- Animatable.cs
- PersonalizationProviderCollection.cs
- HierarchicalDataSourceDesigner.cs
- PopOutPanel.cs
- FontConverter.cs
- SrgsText.cs
- XPathDescendantIterator.cs
- Int32AnimationUsingKeyFrames.cs
- ComponentEditorPage.cs
- baseshape.cs
- SerialErrors.cs
- XmlIlGenerator.cs
- ComponentConverter.cs
- DockAndAnchorLayout.cs
- DataBoundControlDesigner.cs
- CodeAccessSecurityEngine.cs
- DbMetaDataColumnNames.cs
- dataprotectionpermission.cs
- ReaderWriterLock.cs
- SelectionService.cs
- XsltFunctions.cs
- DefaultProxySection.cs
- ItemCheckedEvent.cs
- Model3DGroup.cs
- TextComposition.cs
- CatalogPartCollection.cs
- Brushes.cs
- GacUtil.cs
- DateTimeParse.cs
- SqlFormatter.cs
- HttpModuleActionCollection.cs
- PropertyCollection.cs
- ToolStripDropDownButton.cs
- XslCompiledTransform.cs
- DbInsertCommandTree.cs
- MobileTextWriter.cs
- RootProfilePropertySettingsCollection.cs
- ComponentCollection.cs
- CodePageEncoding.cs
- SmiTypedGetterSetter.cs