Code:
                         / Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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; 
    ///  
    ///     
    ///       Represents a single custom attribute.
    ///      
    ///  
    [
        ClassInterface(ClassInterfaceType.AutoDispatch),
        ComVisible(true), 
        Serializable,
    ] 
    public class CodeAttributeDeclaration { 
        private string name;
        private CodeAttributeArgumentCollection arguments = new CodeAttributeArgumentCollection(); 
        [OptionalField]
        private CodeTypeReference attributeType;
        ///  
        ///    
        ///       Initializes a new instance of   
        ///  
        public CodeAttributeDeclaration() { 
        }
        /// 
        ///     
        ///       Initializes a new instance of   
        ///   
        public CodeAttributeDeclaration(string name) {
            Name = name; 
        }
        /// 
        ///     
        ///       Initializes a new instance of   
        ///  
        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); 
            } 
        }
 
        /// 
        ///    
        ///       The name of the attribute being declared.
        ///      
        ///  
        public string Name { 
            get { 
                return (name == null) ? string.Empty : name;
            } 
            set {
                name = value;
                attributeType = new CodeTypeReference(name);
            } 
        }
 
        ///  
        ///    
        ///       The arguments for the attribute. 
        ///     
        ///  
        public CodeAttributeArgumentCollection Arguments {
            get { 
                return arguments;
            } 
        } 
        public CodeTypeReference AttributeType { 
            get {
                return attributeType;
            }
        } 
    }
} 
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------ 
// 
//     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; 
    ///  
    ///     
    ///       Represents a single custom attribute.
    ///      
    ///  
    [
        ClassInterface(ClassInterfaceType.AutoDispatch),
        ComVisible(true), 
        Serializable,
    ] 
    public class CodeAttributeDeclaration { 
        private string name;
        private CodeAttributeArgumentCollection arguments = new CodeAttributeArgumentCollection(); 
        [OptionalField]
        private CodeTypeReference attributeType;
        ///  
        ///    
        ///       Initializes a new instance of   
        ///  
        public CodeAttributeDeclaration() { 
        }
        /// 
        ///     
        ///       Initializes a new instance of   
        ///   
        public CodeAttributeDeclaration(string name) {
            Name = name; 
        }
        /// 
        ///     
        ///       Initializes a new instance of   
        ///  
        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); 
            } 
        }
 
        /// 
        ///    
        ///       The name of the attribute being declared.
        ///      
        ///  
        public string Name { 
            get { 
                return (name == null) ? string.Empty : name;
            } 
            set {
                name = value;
                attributeType = new CodeTypeReference(name);
            } 
        }
 
        ///  
        ///    
        ///       The arguments for the attribute. 
        ///     
        ///  
        public CodeAttributeArgumentCollection Arguments {
            get { 
                return arguments;
            } 
        } 
        public CodeTypeReference AttributeType { 
            get {
                return attributeType;
            }
        } 
    }
} 
// 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
- BreakRecordTable.cs
- _KerberosClient.cs
- safelink.cs
- DoubleCollection.cs
- SiteMapDataSource.cs
- ValidationSummary.cs
- SHA1CryptoServiceProvider.cs
- OleDbParameterCollection.cs
- ThrowHelper.cs
- DataColumnMapping.cs
- TransformDescriptor.cs
- MetabaseSettingsIis7.cs
- DataControlFieldHeaderCell.cs
- TreeViewItemAutomationPeer.cs
- ArcSegment.cs
- BitmapEffectCollection.cs
- ClosureBinding.cs
- MetadataCache.cs
- CodeSubDirectoriesCollection.cs
- ModuleElement.cs
- ImportCatalogPart.cs
- VirtualPath.cs
- PanelDesigner.cs
- _LazyAsyncResult.cs
- FigureParaClient.cs
- PixelShader.cs
- DecimalAnimation.cs
- RSAPKCS1SignatureFormatter.cs
- MessageSmuggler.cs
- SupportingTokenSecurityTokenResolver.cs
- HtmlPageAdapter.cs
- Events.cs
- MessageVersionConverter.cs
- ObfuscationAttribute.cs
- IntranetCredentialPolicy.cs
- EncoderBestFitFallback.cs
- IgnoreFlushAndCloseStream.cs
- CacheDependency.cs
- AuthenticationModuleElementCollection.cs
- ContextMarshalException.cs
- ItemChangedEventArgs.cs
- VoiceSynthesis.cs
- SessionParameter.cs
- StaticResourceExtension.cs
- ColumnWidthChangedEvent.cs
- XmlTypeAttribute.cs
- OutputWindow.cs
- SamlAuthorizationDecisionClaimResource.cs
- SafeNativeMethods.cs
- DBDataPermission.cs
- externdll.cs
- AsyncPostBackErrorEventArgs.cs
- InputMethodStateTypeInfo.cs
- ProgressBarHighlightConverter.cs
- Identity.cs
- CodeMemberProperty.cs
- CollectionDataContract.cs
- FlowDocumentPaginator.cs
- SessionStateItemCollection.cs
- ServerIdentity.cs
- StatusBarItem.cs
- UpdateCompiler.cs
- CaseInsensitiveHashCodeProvider.cs
- ProcessingInstructionAction.cs
- UnauthorizedWebPart.cs
- TripleDES.cs
- SecurityAppliedMessage.cs
- LiteralLink.cs
- IntegerValidator.cs
- SafeMILHandle.cs
- AssemblyBuilderData.cs
- ContentFileHelper.cs
- AuthenticationSection.cs
- InvalidTimeZoneException.cs
- CookieProtection.cs
- TabPanel.cs
- LayoutManager.cs
- Axis.cs
- DataObjectAttribute.cs
- EdmType.cs
- ACL.cs
- ShaderRenderModeValidation.cs
- WSSecurityOneDotZeroSendSecurityHeader.cs
- MultiAsyncResult.cs
- PackWebRequest.cs
- _ShellExpression.cs
- MbpInfo.cs
- ArgumentValidation.cs
- MiniModule.cs
- RegexCaptureCollection.cs
- LogSwitch.cs
- SimpleHandlerBuildProvider.cs
- DataKey.cs
- _ConnectStream.cs
- TextMarkerSource.cs
- WebPartEditorCancelVerb.cs
- GeometryValueSerializer.cs
- XmlCharType.cs
- CodeMemberField.cs
- SecureConversationServiceCredential.cs