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
- WhitespaceRuleLookup.cs
- ElementProxy.cs
- MethodAccessException.cs
- ContextMarshalException.cs
- DataGridViewLinkCell.cs
- CompoundFileDeflateTransform.cs
- XmlRawWriter.cs
- TCEAdapterGenerator.cs
- TextAction.cs
- SynchronizingStream.cs
- DrawingState.cs
- MenuItemStyleCollection.cs
- InfoCard.cs
- FacetValues.cs
- XmlSerializerVersionAttribute.cs
- FlowLayout.cs
- FrameworkContentElement.cs
- FilterQuery.cs
- RepeaterCommandEventArgs.cs
- CellTreeNodeVisitors.cs
- SspiSecurityTokenProvider.cs
- RedistVersionInfo.cs
- MessageDesigner.cs
- WorkflowInlining.cs
- _HeaderInfoTable.cs
- EventMappingSettings.cs
- Soap11ServerProtocol.cs
- HeaderCollection.cs
- PageClientProxyGenerator.cs
- Accessible.cs
- SqlException.cs
- XPathAncestorIterator.cs
- MediaElement.cs
- Bezier.cs
- BuilderInfo.cs
- Pkcs7Recipient.cs
- VisualTarget.cs
- DesignerActionPropertyItem.cs
- MenuCommandsChangedEventArgs.cs
- XPathDocumentBuilder.cs
- InstanceCreationEditor.cs
- VirtualDirectoryMappingCollection.cs
- ProcessProtocolHandler.cs
- ContextMenu.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- WebContext.cs
- Decoder.cs
- OleDbParameter.cs
- DesignerActionItem.cs
- ServiceHttpModule.cs
- ScrollChangedEventArgs.cs
- CancellationScope.cs
- WorkflowMarkupSerializerMapping.cs
- TargetControlTypeAttribute.cs
- ScrollContentPresenter.cs
- AffineTransform3D.cs
- GridViewCommandEventArgs.cs
- ContentControl.cs
- CompoundFileStreamReference.cs
- ProcessingInstructionAction.cs
- PieceDirectory.cs
- MasterPageBuildProvider.cs
- InstanceNotFoundException.cs
- TypeHelpers.cs
- DictionaryEditChange.cs
- XmlIlVisitor.cs
- WindowsRebar.cs
- OpenFileDialog.cs
- UInt32Converter.cs
- ConfigurationStrings.cs
- QilGeneratorEnv.cs
- BaseDataListComponentEditor.cs
- IImplicitResourceProvider.cs
- ThreadStateException.cs
- ListViewTableRow.cs
- DataColumn.cs
- ValueUtilsSmi.cs
- EventMemberCodeDomSerializer.cs
- CollectionViewSource.cs
- ItemChangedEventArgs.cs
- SemanticBasicElement.cs
- RootNamespaceAttribute.cs
- AttributeCollection.cs
- ListViewItemMouseHoverEvent.cs
- Light.cs
- ValueExpressions.cs
- TTSEngineProxy.cs
- ButtonBaseAutomationPeer.cs
- CookieParameter.cs
- WebPartRestoreVerb.cs
- SharedDp.cs
- VisualBrush.cs
- XsltConvert.cs
- ProcessThread.cs
- AuthenticationServiceManager.cs
- WebPartCatalogCloseVerb.cs
- ServerIdentity.cs
- SqlDataReaderSmi.cs
- IndexedString.cs
- HtmlHistory.cs