Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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; } } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ProxyHwnd.cs
- HitTestWithPointDrawingContextWalker.cs
- ObjectDataSourceStatusEventArgs.cs
- ZipIOLocalFileDataDescriptor.cs
- TextEditorSelection.cs
- ServiceChannelProxy.cs
- isolationinterop.cs
- XPathNavigator.cs
- StringFormat.cs
- XmlSchemaComplexType.cs
- StatusBarAutomationPeer.cs
- Message.cs
- DataBindingCollectionEditor.cs
- PartialArray.cs
- StreamWriter.cs
- ManipulationStartingEventArgs.cs
- HtmlTextArea.cs
- LabelAutomationPeer.cs
- BinaryNegotiation.cs
- SerializationIncompleteException.cs
- BasicCommandTreeVisitor.cs
- ClassHandlersStore.cs
- WindowsNonControl.cs
- ETagAttribute.cs
- WinCategoryAttribute.cs
- PartialCachingControl.cs
- Hashtable.cs
- TranslateTransform.cs
- CompilerResults.cs
- OletxEnlistment.cs
- XmlSchemaValidator.cs
- WaveHeader.cs
- TableCellCollection.cs
- SByte.cs
- RecordBuilder.cs
- DataViewManagerListItemTypeDescriptor.cs
- RuntimeConfig.cs
- IList.cs
- SourceExpressionException.cs
- GridViewItemAutomationPeer.cs
- BamlWriter.cs
- XhtmlStyleClass.cs
- SafeProcessHandle.cs
- DataGridParentRows.cs
- XmlAttributeOverrides.cs
- AnimationStorage.cs
- _TLSstream.cs
- WindowsListBox.cs
- SpellerHighlightLayer.cs
- SchemaElement.cs
- LogicalExpressionTypeConverter.cs
- VideoDrawing.cs
- PageAsyncTask.cs
- BitmapMetadataEnumerator.cs
- ProcessModuleDesigner.cs
- Effect.cs
- ImageClickEventArgs.cs
- SqlHelper.cs
- UInt32Storage.cs
- XmlName.cs
- MultilineStringEditor.cs
- HostSecurityManager.cs
- DecoderExceptionFallback.cs
- Translator.cs
- DBConcurrencyException.cs
- AdRotator.cs
- COM2ICategorizePropertiesHandler.cs
- DiscreteKeyFrames.cs
- CompilationRelaxations.cs
- Mouse.cs
- PerformanceCountersBase.cs
- GAC.cs
- xml.cs
- WbmpConverter.cs
- WebPartsPersonalization.cs
- HtmlElementErrorEventArgs.cs
- DictionaryItemsCollection.cs
- StackSpiller.cs
- RelationshipEndCollection.cs
- KnownTypesProvider.cs
- NegotiationTokenAuthenticator.cs
- TextElementCollectionHelper.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- XmlSchemaProviderAttribute.cs
- RootDesignerSerializerAttribute.cs
- ProvidePropertyAttribute.cs
- EdmItemCollection.cs
- DockProviderWrapper.cs
- ZipIOExtraFieldZip64Element.cs
- GuidelineCollection.cs
- IntSecurity.cs
- TimeStampChecker.cs
- MatrixIndependentAnimationStorage.cs
- CodeBinaryOperatorExpression.cs
- HtmlProps.cs
- DeploymentSection.cs
- DateTimeOffsetAdapter.cs
- XMLSchema.cs
- FileDialog.cs
- DefaultValueTypeConverter.cs