Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / CompMod / System / CodeDOM / CodeAttributeDeclaration.cs / 1 / CodeAttributeDeclaration.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.CodeDom { using System.Diagnostics; using System; using Microsoft.Win32; using System.Collections; using System.Runtime.InteropServices; using System.Runtime.Serialization; ////// [ ClassInterface(ClassInterfaceType.AutoDispatch), ComVisible(true), Serializable, ] public class CodeAttributeDeclaration { private string name; private CodeAttributeArgumentCollection arguments = new CodeAttributeArgumentCollection(); [OptionalField] private CodeTypeReference attributeType; ////// Represents a single custom attribute. /// ////// public CodeAttributeDeclaration() { } ////// Initializes a new instance of ///. /// /// public CodeAttributeDeclaration(string name) { Name = name; } ////// Initializes a new instance of ///using the specified name. /// /// public CodeAttributeDeclaration(string name, params CodeAttributeArgument[] arguments) { Name = name; Arguments.AddRange(arguments); } public CodeAttributeDeclaration(CodeTypeReference attributeType) : this ( attributeType, null) { } public CodeAttributeDeclaration(CodeTypeReference attributeType, params CodeAttributeArgument[] arguments) { this.attributeType = attributeType; if( attributeType != null) { this.name = attributeType.BaseType; } if(arguments != null) { Arguments.AddRange(arguments); } } ////// Initializes a new instance of ///using the specified /// arguments. /// /// public string Name { get { return (name == null) ? string.Empty : name; } set { name = value; attributeType = new CodeTypeReference(name); } } ////// The name of the attribute being declared. /// ////// public CodeAttributeArgumentCollection Arguments { get { return arguments; } } public CodeTypeReference AttributeType { get { return attributeType; } } } }/// The arguments for the attribute. /// ///
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CodeSnippetCompileUnit.cs
- CreateUserWizardStep.cs
- XmlMembersMapping.cs
- RegexParser.cs
- PageRouteHandler.cs
- DataPointer.cs
- DecimalStorage.cs
- XPathExpr.cs
- SiteOfOriginContainer.cs
- StringUtil.cs
- AssemblyCache.cs
- ActivityDesignerLayoutSerializers.cs
- KeyPullup.cs
- MemoryMappedFile.cs
- GridProviderWrapper.cs
- EntityClassGenerator.cs
- BitmapEffectvisualstate.cs
- TrackingProfileManager.cs
- FileNotFoundException.cs
- Registry.cs
- ContentFilePart.cs
- HtmlInputButton.cs
- Visual.cs
- DataControlImageButton.cs
- UnsignedPublishLicense.cs
- ManifestSignedXml.cs
- SettingsAttributeDictionary.cs
- basecomparevalidator.cs
- PrintDocument.cs
- Funcletizer.cs
- XmlElementCollection.cs
- ProcessHostFactoryHelper.cs
- DocumentPageViewAutomationPeer.cs
- NumberSubstitution.cs
- SqlProfileProvider.cs
- Html32TextWriter.cs
- IdleTimeoutMonitor.cs
- AccessorTable.cs
- MethodAccessException.cs
- Span.cs
- XmlCharacterData.cs
- Label.cs
- XmlObjectSerializerReadContext.cs
- ProfilePropertyMetadata.cs
- BlockCollection.cs
- TimeSpanStorage.cs
- WaitHandle.cs
- CSharpCodeProvider.cs
- TableLayoutColumnStyleCollection.cs
- DocumentViewerBaseAutomationPeer.cs
- Label.cs
- CalendarDesigner.cs
- DesignerHost.cs
- TypeGenericEnumerableViewSchema.cs
- ResolvedKeyFrameEntry.cs
- HtmlInputFile.cs
- BindingCollection.cs
- AbstractDataSvcMapFileLoader.cs
- Lookup.cs
- EncryptedReference.cs
- InvalidOleVariantTypeException.cs
- DataTableNameHandler.cs
- EnumDataContract.cs
- Camera.cs
- FillErrorEventArgs.cs
- RootProfilePropertySettingsCollection.cs
- TemplatePropertyEntry.cs
- MetadataItemEmitter.cs
- FreezableDefaultValueFactory.cs
- BevelBitmapEffect.cs
- TraversalRequest.cs
- XmlSchema.cs
- PopOutPanel.cs
- ChannelFactoryBase.cs
- BinaryFormatterWriter.cs
- EmptyStringExpandableObjectConverter.cs
- CodeArrayCreateExpression.cs
- ComponentDispatcher.cs
- Avt.cs
- TreeNodeBindingCollection.cs
- XslTransform.cs
- UIElement3D.cs
- TogglePatternIdentifiers.cs
- RSAPKCS1SignatureDeformatter.cs
- XmlValueConverter.cs
- ListControlConvertEventArgs.cs
- InheritanceAttribute.cs
- CodeObjectCreateExpression.cs
- DecoderFallback.cs
- DateTimeValueSerializer.cs
- XmlUtil.cs
- SerializationException.cs
- PropertyDescriptor.cs
- SEHException.cs
- ProfileBuildProvider.cs
- Int64KeyFrameCollection.cs
- FunctionImportElement.cs
- PassportAuthenticationEventArgs.cs
- MultipleViewPattern.cs
- InternalCache.cs