Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- MailAddressCollection.cs
- DesignerCategoryAttribute.cs
- SqlNotificationEventArgs.cs
- SelectionHighlightInfo.cs
- ConcurrencyBehavior.cs
- SurrogateEncoder.cs
- LowerCaseStringConverter.cs
- TraceSwitch.cs
- UniqueEventHelper.cs
- SocketCache.cs
- ServiceSettingsResponseInfo.cs
- DataRow.cs
- JsonClassDataContract.cs
- DictionarySurrogate.cs
- TableColumn.cs
- WeakEventTable.cs
- DesignerEventService.cs
- RangeValueProviderWrapper.cs
- SqlNode.cs
- CopyOfAction.cs
- AutomationElement.cs
- ExtensionElementCollection.cs
- Triplet.cs
- ModuleBuilder.cs
- SoapServerMethod.cs
- SynchronousChannelMergeEnumerator.cs
- XmlTextReaderImplHelpers.cs
- UnmanagedBitmapWrapper.cs
- Switch.cs
- OlePropertyStructs.cs
- Localizer.cs
- ComplexTypeEmitter.cs
- SqlTopReducer.cs
- TableLayoutSettingsTypeConverter.cs
- DPTypeDescriptorContext.cs
- COAUTHIDENTITY.cs
- ContextMenuAutomationPeer.cs
- AlternateView.cs
- SignatureDescription.cs
- HighlightVisual.cs
- DispatcherHookEventArgs.cs
- ResourceAssociationSet.cs
- DataGridViewBand.cs
- AutoCompleteStringCollection.cs
- PropertyStore.cs
- BitmapEffectCollection.cs
- WebControlAdapter.cs
- WindowHideOrCloseTracker.cs
- EngineSiteSapi.cs
- SpinLock.cs
- PageAsyncTask.cs
- DispatcherObject.cs
- InkCanvasInnerCanvas.cs
- Attribute.cs
- TextCharacters.cs
- SignedInfo.cs
- IconBitmapDecoder.cs
- DataControlHelper.cs
- WindowInteropHelper.cs
- Tokenizer.cs
- InternalConfigEventArgs.cs
- DbParameterHelper.cs
- AnnotationComponentManager.cs
- BitmapEffectInputData.cs
- PreProcessInputEventArgs.cs
- Dictionary.cs
- UIElement3D.cs
- ELinqQueryState.cs
- Assert.cs
- ObjectItemAttributeAssemblyLoader.cs
- ResourceAssociationSet.cs
- TaskExceptionHolder.cs
- FileController.cs
- ApplicationServiceManager.cs
- SendKeys.cs
- SmiContextFactory.cs
- InstanceKey.cs
- ReferenceTypeElement.cs
- HttpListenerContext.cs
- LabelEditEvent.cs
- DefaultDiscoveryService.cs
- BitConverter.cs
- ImportContext.cs
- EncodingStreamWrapper.cs
- KeyboardEventArgs.cs
- Funcletizer.cs
- MDIWindowDialog.cs
- CompModHelpers.cs
- ScrollProviderWrapper.cs
- Canvas.cs
- DnsEndPoint.cs
- DeclaredTypeValidatorAttribute.cs
- WizardSideBarListControlItem.cs
- FormView.cs
- EventLogTraceListener.cs
- PngBitmapEncoder.cs
- UIElementCollection.cs
- SQLCharsStorage.cs
- ACE.cs
- EndpointIdentityConverter.cs