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
- ReflectPropertyDescriptor.cs
- ParserHooks.cs
- ScrollPattern.cs
- Atom10FormatterFactory.cs
- GridViewSortEventArgs.cs
- WorkflowInstanceSuspendedRecord.cs
- HMAC.cs
- DetailsViewCommandEventArgs.cs
- WindowInteropHelper.cs
- ModelTreeEnumerator.cs
- TimeoutValidationAttribute.cs
- PropertyMapper.cs
- FileEnumerator.cs
- CharacterMetrics.cs
- XmlDomTextWriter.cs
- PointAnimation.cs
- FileDialogCustomPlacesCollection.cs
- StateFinalizationDesigner.cs
- QueryPageSettingsEventArgs.cs
- SqlCommandBuilder.cs
- InputLanguageSource.cs
- DataGridAutoFormat.cs
- DeobfuscatingStream.cs
- AnonymousIdentificationModule.cs
- DataBoundControlHelper.cs
- IgnoreDataMemberAttribute.cs
- _SingleItemRequestCache.cs
- ScrollItemProviderWrapper.cs
- ConfigXmlAttribute.cs
- WhitespaceRule.cs
- WindowsAltTab.cs
- IDQuery.cs
- UriTemplateVariableQueryValue.cs
- FormsAuthenticationEventArgs.cs
- MenuItemBinding.cs
- ICollection.cs
- WebPartAuthorizationEventArgs.cs
- EmptyElement.cs
- ZipIOLocalFileDataDescriptor.cs
- RuntimeEnvironment.cs
- MemberExpression.cs
- ExpressionDumper.cs
- MissingMethodException.cs
- TableCell.cs
- FixedSOMElement.cs
- PropertyItemInternal.cs
- XmlSchemaValidationException.cs
- TableColumnCollectionInternal.cs
- SvcMapFile.cs
- MinMaxParagraphWidth.cs
- handlecollector.cs
- TextSelectionHelper.cs
- IndentedWriter.cs
- TokenBasedSetEnumerator.cs
- FormViewModeEventArgs.cs
- Int16AnimationUsingKeyFrames.cs
- TypeDescriptorFilterService.cs
- EntityStoreSchemaFilterEntry.cs
- ListControlBuilder.cs
- _SpnDictionary.cs
- DataGridViewCellStyleBuilderDialog.cs
- FileResponseElement.cs
- ContentType.cs
- HMACMD5.cs
- ComboBoxRenderer.cs
- ProcessHostConfigUtils.cs
- SiteMapNodeCollection.cs
- XmlObjectSerializerReadContext.cs
- RenderOptions.cs
- formatter.cs
- XmlDataProvider.cs
- Menu.cs
- ValueUtilsSmi.cs
- LeaseManager.cs
- errorpatternmatcher.cs
- CodeDomSerializerBase.cs
- UserNamePasswordValidator.cs
- CallbackValidatorAttribute.cs
- QuadraticBezierSegment.cs
- _ChunkParse.cs
- XPathNodeInfoAtom.cs
- DynamicMethod.cs
- ExternalFile.cs
- PermissionListSet.cs
- RowCache.cs
- OutgoingWebRequestContext.cs
- TextSyndicationContentKindHelper.cs
- FileInfo.cs
- OraclePermission.cs
- SourceFileInfo.cs
- Propagator.Evaluator.cs
- CrossAppDomainChannel.cs
- DbMetaDataColumnNames.cs
- ToolStripDropDownClosingEventArgs.cs
- PrintPreviewControl.cs
- CfgArc.cs
- BoundsDrawingContextWalker.cs
- MouseActionValueSerializer.cs
- MsmqIntegrationMessagePool.cs
- TabRenderer.cs