Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- RadioButtonStandardAdapter.cs
- XmlSchemaDatatype.cs
- NameValueCollection.cs
- ContextMarshalException.cs
- OpacityConverter.cs
- Vector.cs
- PointCollectionConverter.cs
- DemultiplexingClientMessageFormatter.cs
- IgnoreFileBuildProvider.cs
- StatusBar.cs
- MexTcpBindingCollectionElement.cs
- PrivilegeNotHeldException.cs
- X509CertificateCollection.cs
- SecurityKeyIdentifierClause.cs
- ToolboxItem.cs
- _CookieModule.cs
- ParameterToken.cs
- Verify.cs
- NativeMethodsCLR.cs
- FtpWebRequest.cs
- URLMembershipCondition.cs
- remotingproxy.cs
- DtrList.cs
- BoolExpressionVisitors.cs
- _Rfc2616CacheValidators.cs
- AutomationPeer.cs
- AssociationType.cs
- AspNetHostingPermission.cs
- SafePEFileHandle.cs
- EditorAttribute.cs
- RandomNumberGenerator.cs
- returneventsaver.cs
- FullTextBreakpoint.cs
- ToolStrip.cs
- Int32CollectionValueSerializer.cs
- OdbcEnvironmentHandle.cs
- SqlParameterCollection.cs
- BinaryObjectWriter.cs
- GridViewAutoFormat.cs
- ValueProviderWrapper.cs
- TokenizerHelper.cs
- XmlSchemaChoice.cs
- RegistryPermission.cs
- XmlUnspecifiedAttribute.cs
- Interlocked.cs
- DrawingVisual.cs
- filewebrequest.cs
- StreamUpdate.cs
- ListViewInsertionMark.cs
- Storyboard.cs
- WebContentFormatHelper.cs
- TypeConverter.cs
- RowSpanVector.cs
- CryptoApi.cs
- ArraySet.cs
- WebPartCatalogAddVerb.cs
- ListBoxItemWrapperAutomationPeer.cs
- PropertyPathWorker.cs
- NativeMethods.cs
- LocalizabilityAttribute.cs
- HtmlWindow.cs
- TableItemProviderWrapper.cs
- PageRouteHandler.cs
- TypeConverterHelper.cs
- PerformanceCounterPermissionAttribute.cs
- FormViewModeEventArgs.cs
- ZipPackagePart.cs
- SecurityPermission.cs
- RootBuilder.cs
- AspNetSynchronizationContext.cs
- OperationContractAttribute.cs
- GlyphRunDrawing.cs
- ThicknessConverter.cs
- Variant.cs
- GreenMethods.cs
- PostBackOptions.cs
- TreeViewDesigner.cs
- FragmentNavigationEventArgs.cs
- ModifierKeysConverter.cs
- UriScheme.cs
- UpDownEvent.cs
- AjaxFrameworkAssemblyAttribute.cs
- XmlAutoDetectWriter.cs
- SafeNativeMethodsOther.cs
- DesignerTransaction.cs
- ValueOfAction.cs
- DataServiceQueryProvider.cs
- PreloadedPackages.cs
- CopyAttributesAction.cs
- InputBuffer.cs
- SqlServer2KCompatibilityCheck.cs
- LockedHandleGlyph.cs
- ShortcutKeysEditor.cs
- DataServiceHost.cs
- WindowAutomationPeer.cs
- PixelShader.cs
- DispatcherExceptionEventArgs.cs
- RewritingProcessor.cs
- ServiceHostFactory.cs
- XPathExpr.cs