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
- SqlParameterCollection.cs
- XmlWriterSettings.cs
- DataBindingExpressionBuilder.cs
- Point.cs
- LayoutSettings.cs
- Point3D.cs
- Operators.cs
- BinaryCommonClasses.cs
- login.cs
- SoapFault.cs
- ListViewCancelEventArgs.cs
- SessionPageStatePersister.cs
- BasePattern.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- SqlServer2KCompatibilityCheck.cs
- ConfigurationElementProperty.cs
- Win32.cs
- BitmapCodecInfo.cs
- DbQueryCommandTree.cs
- Matrix3DValueSerializer.cs
- UnhandledExceptionEventArgs.cs
- FocusWithinProperty.cs
- CalendarDay.cs
- Panel.cs
- Sentence.cs
- ComplexBindingPropertiesAttribute.cs
- ServicesUtilities.cs
- RichTextBoxConstants.cs
- ConnectionOrientedTransportChannelListener.cs
- XmlSchemaSet.cs
- ObjectStateEntry.cs
- XmlQueryOutput.cs
- XmlDownloadManager.cs
- RegisteredExpandoAttribute.cs
- RemotingAttributes.cs
- DrawTreeNodeEventArgs.cs
- RowVisual.cs
- TransformValueSerializer.cs
- JavaScriptSerializer.cs
- ValidationErrorCollection.cs
- DbParameterCollection.cs
- SqlDataSourceCustomCommandPanel.cs
- WebServiceEnumData.cs
- Int32Rect.cs
- ClientTargetSection.cs
- JsonQueryStringConverter.cs
- DataGridPageChangedEventArgs.cs
- AnnotationResourceCollection.cs
- SamlAudienceRestrictionCondition.cs
- TextCharacters.cs
- CodeTryCatchFinallyStatement.cs
- XpsFilter.cs
- SchemaElementLookUpTableEnumerator.cs
- SortedList.cs
- OracleParameterBinding.cs
- RIPEMD160.cs
- IERequestCache.cs
- BaseTemplateCodeDomTreeGenerator.cs
- PolicyImporterElementCollection.cs
- ShapeTypeface.cs
- Image.cs
- PaintEvent.cs
- JournalEntry.cs
- WmlFormAdapter.cs
- WebControl.cs
- PathGeometry.cs
- Underline.cs
- ContentPlaceHolderDesigner.cs
- SoapElementAttribute.cs
- UnmanagedMemoryStreamWrapper.cs
- ImageListDesigner.cs
- DataKey.cs
- SubqueryRules.cs
- ApplicationManager.cs
- ConfigDefinitionUpdates.cs
- TreeNodeBindingDepthConverter.cs
- DelayedRegex.cs
- InputLangChangeEvent.cs
- NativeMethods.cs
- IPEndPointCollection.cs
- PageThemeBuildProvider.cs
- MouseGesture.cs
- DebugView.cs
- LinearGradientBrush.cs
- UniqueEventHelper.cs
- DoubleLinkListEnumerator.cs
- WindowsGraphics.cs
- FindSimilarActivitiesVerb.cs
- ApplicationContext.cs
- SerializationSectionGroup.cs
- DockPanel.cs
- DropTarget.cs
- DetailsViewRowCollection.cs
- StringReader.cs
- DPCustomTypeDescriptor.cs
- LinkLabelLinkClickedEvent.cs
- WindowsGraphics.cs
- categoryentry.cs
- ProgressBarHighlightConverter.cs
- StreamGeometry.cs