Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- basecomparevalidator.cs
- ConnectorRouter.cs
- AttributeQuery.cs
- CompleteWizardStep.cs
- IdlingCommunicationPool.cs
- XomlCompilerError.cs
- Animatable.cs
- ParseHttpDate.cs
- ToolStripMenuItemCodeDomSerializer.cs
- ReflectPropertyDescriptor.cs
- ImageClickEventArgs.cs
- DayRenderEvent.cs
- LastQueryOperator.cs
- DeploymentExceptionMapper.cs
- CmsUtils.cs
- ResourceReferenceExpression.cs
- PeerApplication.cs
- DbDataRecord.cs
- AccessControlEntry.cs
- DefaultIfEmptyQueryOperator.cs
- LeafCellTreeNode.cs
- mda.cs
- RectangleConverter.cs
- InvalidateEvent.cs
- ExpressionConverter.cs
- RandomDelaySendsAsyncResult.cs
- XsdDuration.cs
- DateTime.cs
- TableAdapterManagerHelper.cs
- NativeMethods.cs
- PrintPreviewControl.cs
- BitmapEffect.cs
- EmptyQuery.cs
- InheritablePropertyChangeInfo.cs
- ApplyTemplatesAction.cs
- BindingBase.cs
- DynamicRouteExpression.cs
- AppSettingsSection.cs
- ScopelessEnumAttribute.cs
- TreeNodeStyle.cs
- DispatcherExceptionEventArgs.cs
- Logging.cs
- BookmarkScopeHandle.cs
- ASCIIEncoding.cs
- DataGridViewSelectedColumnCollection.cs
- PasswordBoxAutomationPeer.cs
- XmlSchemaFacet.cs
- SQLConvert.cs
- TableLayoutPanel.cs
- SqlDataSourceTableQuery.cs
- Tracer.cs
- WindowsAltTab.cs
- ListItem.cs
- WorkflowMarkupSerializer.cs
- SqlBooleanizer.cs
- NamespaceEmitter.cs
- SqlDelegatedTransaction.cs
- Compiler.cs
- DataKey.cs
- DataGridViewRowCollection.cs
- XmlILStorageConverter.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- CultureInfo.cs
- odbcmetadatacollectionnames.cs
- TdsParserStaticMethods.cs
- ClientSponsor.cs
- ServiceHttpModule.cs
- StylusButton.cs
- PersonalizationStateInfo.cs
- SortKey.cs
- Operand.cs
- CompilerScope.Storage.cs
- ReaderWriterLockWrapper.cs
- SolidColorBrush.cs
- DbgCompiler.cs
- StateWorkerRequest.cs
- ConstraintStruct.cs
- ColumnMap.cs
- FontSizeConverter.cs
- TextTreeExtractElementUndoUnit.cs
- UIElement3DAutomationPeer.cs
- FontDifferentiator.cs
- SafeHandles.cs
- RoleGroup.cs
- PageThemeParser.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- XPathConvert.cs
- NameTable.cs
- ExpressionValueEditor.cs
- CategoryGridEntry.cs
- StrongTypingException.cs
- StatusBarAutomationPeer.cs
- ViewBox.cs
- Rule.cs
- QueryReaderSettings.cs
- CommandValueSerializer.cs
- CurrencyManager.cs
- CursorConverter.cs
- X509ChainElement.cs
- DataViewManagerListItemTypeDescriptor.cs