Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / clr / src / BCL / System / AttributeUsageAttribute.cs / 1 / AttributeUsageAttribute.cs
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
/*============================================================
**
** Class: AttributeUsageAttribute
**
**
** Purpose: The class denotes how to specify the usage of an attribute
**
**
===========================================================*/
namespace System {
using System.Reflection;
/* By default, attributes are inherited and multiple attributes are not allowed */
[AttributeUsage(AttributeTargets.Class, Inherited = true),Serializable()]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class AttributeUsageAttribute : Attribute
{
internal AttributeTargets m_attributeTarget = AttributeTargets.All; // Defaults to all
internal bool m_allowMultiple = false; // Defaults to false
internal bool m_inherited = true; // Defaults to true
internal static AttributeUsageAttribute Default = new AttributeUsageAttribute(AttributeTargets.All);
//Constructors
public AttributeUsageAttribute(AttributeTargets validOn) {
m_attributeTarget = validOn;
}
internal AttributeUsageAttribute(AttributeTargets validOn, bool allowMultiple, bool inherited) {
m_attributeTarget = validOn;
m_allowMultiple = allowMultiple;
m_inherited = inherited;
}
//Properties
public AttributeTargets ValidOn
{
get{ return m_attributeTarget; }
}
public bool AllowMultiple
{
get { return m_allowMultiple; }
set { m_allowMultiple = value; }
}
public bool Inherited
{
get { return m_inherited; }
set { m_inherited = value; }
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
/*============================================================
**
** Class: AttributeUsageAttribute
**
**
** Purpose: The class denotes how to specify the usage of an attribute
**
**
===========================================================*/
namespace System {
using System.Reflection;
/* By default, attributes are inherited and multiple attributes are not allowed */
[AttributeUsage(AttributeTargets.Class, Inherited = true),Serializable()]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class AttributeUsageAttribute : Attribute
{
internal AttributeTargets m_attributeTarget = AttributeTargets.All; // Defaults to all
internal bool m_allowMultiple = false; // Defaults to false
internal bool m_inherited = true; // Defaults to true
internal static AttributeUsageAttribute Default = new AttributeUsageAttribute(AttributeTargets.All);
//Constructors
public AttributeUsageAttribute(AttributeTargets validOn) {
m_attributeTarget = validOn;
}
internal AttributeUsageAttribute(AttributeTargets validOn, bool allowMultiple, bool inherited) {
m_attributeTarget = validOn;
m_allowMultiple = allowMultiple;
m_inherited = inherited;
}
//Properties
public AttributeTargets ValidOn
{
get{ return m_attributeTarget; }
}
public bool AllowMultiple
{
get { return m_allowMultiple; }
set { m_allowMultiple = value; }
}
public bool Inherited
{
get { return m_inherited; }
set { m_inherited = value; }
}
}
}
// 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
- DataGrid.cs
- GridViewDeletedEventArgs.cs
- CallContext.cs
- _ProxyChain.cs
- Span.cs
- CmsInterop.cs
- FormsAuthenticationUserCollection.cs
- TextContainer.cs
- XappLauncher.cs
- DrawingAttributesDefaultValueFactory.cs
- UniqueID.cs
- SchemaSetCompiler.cs
- TabControl.cs
- ResourceDisplayNameAttribute.cs
- OdbcHandle.cs
- XmlCharCheckingWriter.cs
- WebSysDefaultValueAttribute.cs
- SmtpMail.cs
- AggregateNode.cs
- SQLInt16.cs
- SafeNativeMethods.cs
- TcpSocketManager.cs
- ColumnClickEvent.cs
- Pkcs7Signer.cs
- webbrowsersite.cs
- GridView.cs
- Array.cs
- BindableTemplateBuilder.cs
- Thickness.cs
- ProxySimple.cs
- DataTableNewRowEvent.cs
- CompilerLocalReference.cs
- ListArgumentProvider.cs
- Parser.cs
- CardSpacePolicyElement.cs
- ImageMap.cs
- BuildProvidersCompiler.cs
- ApplicationException.cs
- Registry.cs
- FrameworkReadOnlyPropertyMetadata.cs
- SamlSerializer.cs
- TypeBuilderInstantiation.cs
- Nodes.cs
- BasicCellRelation.cs
- StringValidator.cs
- FormClosedEvent.cs
- DataGridViewRowsAddedEventArgs.cs
- SharedPersonalizationStateInfo.cs
- HwndSource.cs
- CodeArrayCreateExpression.cs
- URLIdentityPermission.cs
- Application.cs
- TreeBuilderXamlTranslator.cs
- RegionInfo.cs
- ImpersonateTokenRef.cs
- ComboBoxRenderer.cs
- TraceUtility.cs
- FileDialogPermission.cs
- ToolStripComboBox.cs
- MouseDevice.cs
- SoapHeaderAttribute.cs
- HyperLinkColumn.cs
- MenuItemBinding.cs
- InvokeGenerator.cs
- OdbcConnectionStringbuilder.cs
- HMACSHA384.cs
- GetPageNumberCompletedEventArgs.cs
- TrustManagerPromptUI.cs
- StructuredTypeEmitter.cs
- Attributes.cs
- FormParameter.cs
- DefinitionBase.cs
- BuildManagerHost.cs
- Enum.cs
- DataColumnPropertyDescriptor.cs
- _AuthenticationState.cs
- PreservationFileReader.cs
- SizeConverter.cs
- SafeNativeMethods.cs
- ReversePositionQuery.cs
- DBCommandBuilder.cs
- SHA384.cs
- SQLChars.cs
- ColorDialog.cs
- DataListItem.cs
- Viewport3DVisual.cs
- LoginName.cs
- ContactManager.cs
- SqlConnectionPoolProviderInfo.cs
- EpmCustomContentSerializer.cs
- DataBindingCollectionConverter.cs
- RangeValidator.cs
- Command.cs
- MessageSecurityTokenVersion.cs
- Expression.cs
- remotingproxy.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- DataKey.cs
- MenuScrollingVisibilityConverter.cs
- UiaCoreApi.cs