Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / AttributeUsageAttribute.cs / 1305376 / 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 */
[Serializable]
[AttributeUsage(AttributeTargets.Class, Inherited = true)]
[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 */
[Serializable]
[AttributeUsage(AttributeTargets.Class, Inherited = true)]
[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
- SqlDataSourceEnumerator.cs
- PropertyPushdownHelper.cs
- PaperSize.cs
- XsltException.cs
- Socket.cs
- TrustLevelCollection.cs
- TcpClientSocketManager.cs
- HMAC.cs
- WebConfigurationHostFileChange.cs
- ReservationCollection.cs
- BufferModesCollection.cs
- TogglePattern.cs
- SerializationEventsCache.cs
- Roles.cs
- TextPattern.cs
- ColumnResizeUndoUnit.cs
- MailHeaderInfo.cs
- FeatureSupport.cs
- LoginCancelEventArgs.cs
- RangeValidator.cs
- XmlAttributeAttribute.cs
- OdbcConnection.cs
- StatusBarItemAutomationPeer.cs
- XmlSchemaAttribute.cs
- CallbackTimeoutsBehavior.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- MasterPage.cs
- CodeVariableReferenceExpression.cs
- precedingsibling.cs
- BitmapMetadataBlob.cs
- TextPattern.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- SecurityUniqueId.cs
- CodeFieldReferenceExpression.cs
- WebPartConnectionCollection.cs
- PageMediaSize.cs
- IgnorePropertiesAttribute.cs
- DSACryptoServiceProvider.cs
- EntityProviderFactory.cs
- ContentType.cs
- TraceInternal.cs
- OdbcException.cs
- SessionStateUtil.cs
- DrawTreeNodeEventArgs.cs
- Deflater.cs
- BehaviorEditorPart.cs
- ModulesEntry.cs
- _ProxyRegBlob.cs
- DateRangeEvent.cs
- DataGridViewHeaderCell.cs
- DynamicQueryableWrapper.cs
- HttpResponseMessageProperty.cs
- ItemCheckedEvent.cs
- DesignerActionGlyph.cs
- OverlappedAsyncResult.cs
- ScrollableControl.cs
- RenamedEventArgs.cs
- XmlIgnoreAttribute.cs
- WindowsFormsDesignerOptionService.cs
- ThousandthOfEmRealDoubles.cs
- DeferredSelectedIndexReference.cs
- SoapHeaders.cs
- WorkflowServiceBuildProvider.cs
- DelimitedListTraceListener.cs
- FixedTextSelectionProcessor.cs
- WebServiceTypeData.cs
- TrackingMemoryStreamFactory.cs
- MenuAdapter.cs
- _NestedSingleAsyncResult.cs
- OpacityConverter.cs
- BamlBinaryReader.cs
- OpenTypeLayoutCache.cs
- FontWeightConverter.cs
- RenderDataDrawingContext.cs
- AnyReturnReader.cs
- BezierSegment.cs
- WebPartEventArgs.cs
- CompilerErrorCollection.cs
- SafeNativeMemoryHandle.cs
- TextAnchor.cs
- RelatedPropertyManager.cs
- FixedSOMPage.cs
- HostingEnvironment.cs
- TypeForwardedToAttribute.cs
- ParserStreamGeometryContext.cs
- FixedPageAutomationPeer.cs
- InputBinding.cs
- Literal.cs
- MessageSmuggler.cs
- BlobPersonalizationState.cs
- UnsafeNativeMethods.cs
- StandardToolWindows.cs
- XmlSchemaObjectCollection.cs
- VScrollProperties.cs
- EntityConnection.cs
- DelimitedListTraceListener.cs
- columnmapfactory.cs
- DesignerVerb.cs
- AQNBuilder.cs
- ObjectReferenceStack.cs