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
- GenericIdentity.cs
- TagNameToTypeMapper.cs
- DbConnectionPool.cs
- XsdBuildProvider.cs
- FormattedText.cs
- CookieParameter.cs
- ReflectionHelper.cs
- XmlCharacterData.cs
- InvalidateEvent.cs
- TransformCollection.cs
- EndpointAddress.cs
- CodeMethodReturnStatement.cs
- ToolStripButton.cs
- SystemPens.cs
- Latin1Encoding.cs
- TableLayoutPanelBehavior.cs
- ListBoxItem.cs
- SafeHandles.cs
- EUCJPEncoding.cs
- SqlXmlStorage.cs
- Evaluator.cs
- WebPartChrome.cs
- BackStopAuthenticationModule.cs
- RoleServiceManager.cs
- HyperLink.cs
- DetailsViewDeletedEventArgs.cs
- TablePatternIdentifiers.cs
- CorrelationManager.cs
- AsyncPostBackTrigger.cs
- TimelineGroup.cs
- SystemInformation.cs
- ProgressPage.cs
- XPathNavigatorReader.cs
- SpellCheck.cs
- UnauthorizedAccessException.cs
- AsymmetricKeyExchangeFormatter.cs
- NumberFormatter.cs
- PipelineComponent.cs
- SendKeys.cs
- DataServiceContext.cs
- ToolStripItemEventArgs.cs
- ErrorWrapper.cs
- Condition.cs
- ExpressionBuilder.cs
- MsmqDecodeHelper.cs
- InitializerFacet.cs
- Decorator.cs
- RectangleF.cs
- TypeConverterAttribute.cs
- RegexCaptureCollection.cs
- XamlTreeBuilderBamlRecordWriter.cs
- PackageStore.cs
- TypeConstant.cs
- PrivilegeNotHeldException.cs
- HttpContextBase.cs
- UnauthorizedAccessException.cs
- XmlKeywords.cs
- ListViewGroup.cs
- CompilerLocalReference.cs
- WindowsEditBox.cs
- NegationPusher.cs
- CodeBlockBuilder.cs
- EntityDesignPluralizationHandler.cs
- CodeExporter.cs
- RouteItem.cs
- CaseInsensitiveHashCodeProvider.cs
- CodeSubDirectory.cs
- SqlServer2KCompatibilityAnnotation.cs
- QuadraticBezierSegment.cs
- UserNamePasswordValidator.cs
- LinkDescriptor.cs
- ListViewItemCollectionEditor.cs
- ReadOnlyActivityGlyph.cs
- TemplatedEditableDesignerRegion.cs
- EditorZone.cs
- AuthenticationModulesSection.cs
- XmlAttributeAttribute.cs
- CodeLabeledStatement.cs
- ToolStripDropDown.cs
- COAUTHIDENTITY.cs
- WhitespaceRuleReader.cs
- DictionaryContent.cs
- JsonObjectDataContract.cs
- MouseGestureConverter.cs
- AsyncWaitHandle.cs
- WindowsFormsHostAutomationPeer.cs
- RadialGradientBrush.cs
- ActivitiesCollection.cs
- CoTaskMemHandle.cs
- CqlGenerator.cs
- TextEffect.cs
- HttpsHostedTransportConfiguration.cs
- ListParagraph.cs
- FontCacheLogic.cs
- DbConnectionStringBuilder.cs
- ProfileGroupSettingsCollection.cs
- HMAC.cs
- SHA256Managed.cs
- DataGridViewRowStateChangedEventArgs.cs
- XmlLanguage.cs