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 using the specified name.
///
///
public CodeAttributeDeclaration(string name) {
Name = name;
}
///
///
/// Initializes a new instance of using the specified
/// arguments.
///
///
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 using the specified name.
///
///
public CodeAttributeDeclaration(string name) {
Name = name;
}
///
///
/// Initializes a new instance of using the specified
/// arguments.
///
///
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
- ExpandoObject.cs
- StickyNoteContentControl.cs
- RemotingSurrogateSelector.cs
- DescriptionAttribute.cs
- VisualStates.cs
- GridView.cs
- ColumnWidthChangingEvent.cs
- HtmlControlDesigner.cs
- StringOutput.cs
- PropertyChangedEventArgs.cs
- FormatSettings.cs
- DuplicateDetector.cs
- COM2PropertyDescriptor.cs
- StorageAssociationSetMapping.cs
- PointCollection.cs
- DataSetMappper.cs
- VisualStateManager.cs
- ModifierKeysConverter.cs
- OleDbTransaction.cs
- TagMapInfo.cs
- CLSCompliantAttribute.cs
- RoleService.cs
- Visual.cs
- TrackBarRenderer.cs
- ImageMapEventArgs.cs
- SchemaAttDef.cs
- FormsAuthenticationModule.cs
- BackgroundWorker.cs
- ViewGenerator.cs
- LoginCancelEventArgs.cs
- ProcessHostConfigUtils.cs
- ExecutedRoutedEventArgs.cs
- UnmanagedMarshal.cs
- ItemCheckedEvent.cs
- GenericIdentity.cs
- ToolboxItemCollection.cs
- TreeNodeConverter.cs
- ServiceActivationException.cs
- SamlAuthorityBinding.cs
- SmiEventSink_DeferedProcessing.cs
- UnsafeNativeMethodsTablet.cs
- OracleDateTime.cs
- Pkcs9Attribute.cs
- Error.cs
- WindowsFormsHelpers.cs
- uribuilder.cs
- SHA1CryptoServiceProvider.cs
- SR.cs
- PointConverter.cs
- ImportContext.cs
- InheritanceContextChangedEventManager.cs
- CopyEncoder.cs
- RemotingConfigParser.cs
- SinglePageViewer.cs
- ToolBarButton.cs
- AssemblyBuilder.cs
- UpdatePanel.cs
- XmlNullResolver.cs
- HttpProfileGroupBase.cs
- ExtractorMetadata.cs
- CodeRegionDirective.cs
- PolicyException.cs
- StorageScalarPropertyMapping.cs
- SmiContextFactory.cs
- DirectionalLight.cs
- InstalledFontCollection.cs
- WindowsToolbarAsMenu.cs
- Duration.cs
- ColumnPropertiesGroup.cs
- BamlRecords.cs
- AspNetSynchronizationContext.cs
- MouseActionValueSerializer.cs
- CounterSampleCalculator.cs
- CollectionConverter.cs
- HttpModuleAction.cs
- RefreshEventArgs.cs
- assertwrapper.cs
- XPathMessageFilterTable.cs
- XmlAttributeCollection.cs
- WpfKnownMember.cs
- SafeFileMapViewHandle.cs
- EntityViewGenerator.cs
- MarshalByValueComponent.cs
- Win32KeyboardDevice.cs
- TraceHelpers.cs
- ReadOnlyCollection.cs
- DoubleAnimation.cs
- QueryCorrelationInitializer.cs
- ConnectionConsumerAttribute.cs
- InternalCache.cs
- SoapAttributeAttribute.cs
- ElapsedEventArgs.cs
- FilteredReadOnlyMetadataCollection.cs
- UnsignedPublishLicense.cs
- NativeCppClassAttribute.cs
- AmbientValueAttribute.cs
- Property.cs
- ViewManager.cs
- XPathDocumentBuilder.cs
- NamespaceExpr.cs