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
- UIHelper.cs
- IndentedWriter.cs
- AdornerDecorator.cs
- XmlTypeMapping.cs
- TextSelectionProcessor.cs
- WebResponse.cs
- Drawing.cs
- WmlSelectionListAdapter.cs
- BinHexEncoder.cs
- JavaScriptSerializer.cs
- WebPartEditorOkVerb.cs
- OutputCacheSection.cs
- Assert.cs
- MailHeaderInfo.cs
- Color.cs
- DataTableExtensions.cs
- BamlTreeNode.cs
- PerspectiveCamera.cs
- TimeZone.cs
- AssemblyNameProxy.cs
- NamedPipeConnectionPoolSettingsElement.cs
- DataBindEngine.cs
- XmlSchemaSimpleContent.cs
- ThreadPool.cs
- JsonDataContract.cs
- RotateTransform.cs
- RoleManagerSection.cs
- SafeWaitHandle.cs
- DeferredElementTreeState.cs
- FileSystemInfo.cs
- VarRemapper.cs
- ObjectSet.cs
- ConfigXmlReader.cs
- SecurityTokenParameters.cs
- StreamedFramingRequestChannel.cs
- DetailsViewUpdatedEventArgs.cs
- NonSerializedAttribute.cs
- XmlSchemaImport.cs
- SystemResourceKey.cs
- Constant.cs
- BitConverter.cs
- EntityDataSourceReferenceGroup.cs
- OleDbPermission.cs
- TransformedBitmap.cs
- ModuleBuilderData.cs
- BaseTemplateParser.cs
- RedistVersionInfo.cs
- WebPartEditorApplyVerb.cs
- ExpressionWriter.cs
- EdgeProfileValidation.cs
- GlobalizationSection.cs
- ProvidersHelper.cs
- SafeHandles.cs
- CheckBoxAutomationPeer.cs
- SQLConvert.cs
- BindingOperations.cs
- HttpStreamMessage.cs
- EdmSchemaAttribute.cs
- XmlSerializationWriter.cs
- GetLastErrorDetailsRequest.cs
- TextSelectionProcessor.cs
- SingleSelectRootGridEntry.cs
- SchemaTableColumn.cs
- StrokeDescriptor.cs
- RequestFactory.cs
- ArglessEventHandlerProxy.cs
- TextServicesLoader.cs
- ToolStripSeparatorRenderEventArgs.cs
- CodeEntryPointMethod.cs
- Script.cs
- SourceInterpreter.cs
- SqlConnectionFactory.cs
- Common.cs
- DecoratedNameAttribute.cs
- EncryptedKeyIdentifierClause.cs
- DomainConstraint.cs
- ConstraintCollection.cs
- SiteMapDataSource.cs
- ProxyWebPartConnectionCollection.cs
- ClientData.cs
- TracedNativeMethods.cs
- CharacterMetricsDictionary.cs
- RichTextBoxContextMenu.cs
- ResourcesBuildProvider.cs
- QilName.cs
- DispatcherHookEventArgs.cs
- SqlClientWrapperSmiStream.cs
- DynamicValidatorEventArgs.cs
- DesignerVerbCollection.cs
- StorageMappingFragment.cs
- DataGrid.cs
- InvariantComparer.cs
- UIElementAutomationPeer.cs
- FixedPosition.cs
- DeploymentSection.cs
- BookmarkScopeInfo.cs
- SafePEFileHandle.cs
- RuntimeArgumentHandle.cs
- StagingAreaInputItem.cs
- CompilationRelaxations.cs