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
- CollectionChangedEventManager.cs
- PolyQuadraticBezierSegment.cs
- ErrorFormatterPage.cs
- SqlBulkCopy.cs
- ZipFileInfo.cs
- RegexTree.cs
- KeyConstraint.cs
- ClientTarget.cs
- AnimationStorage.cs
- AnnotationDocumentPaginator.cs
- CharacterHit.cs
- PersonalizablePropertyEntry.cs
- XPathArrayIterator.cs
- StringArrayEditor.cs
- TreeIterator.cs
- Util.cs
- SqlException.cs
- AssemblyNameUtility.cs
- Privilege.cs
- WindowsListViewScroll.cs
- UdpTransportSettingsElement.cs
- MdbDataFileEditor.cs
- LabelInfo.cs
- ProxyAttribute.cs
- CompressStream.cs
- Int32CollectionValueSerializer.cs
- EditorZone.cs
- InvalidOperationException.cs
- XmlSchemaExporter.cs
- SafeArchiveContext.cs
- MetadataPropertyAttribute.cs
- CustomCategoryAttribute.cs
- DataControlPagerLinkButton.cs
- ParallelTimeline.cs
- CellPartitioner.cs
- DynamicFilter.cs
- PersonalizationProvider.cs
- HttpConfigurationSystem.cs
- NoneExcludedImageIndexConverter.cs
- StaticExtensionConverter.cs
- TrustLevel.cs
- UniqueIdentifierService.cs
- ExpressionBuilderContext.cs
- TypeRestriction.cs
- DataGridViewCell.cs
- SqlConnectionHelper.cs
- Bidi.cs
- BuildProvider.cs
- TextEditorThreadLocalStore.cs
- DiscoveryVersionConverter.cs
- ComponentEvent.cs
- RuleConditionDialog.Designer.cs
- WebBrowserNavigatingEventHandler.cs
- XPathConvert.cs
- WebPartMenu.cs
- Attachment.cs
- objectquery_tresulttype.cs
- SocketAddress.cs
- glyphs.cs
- LinearQuaternionKeyFrame.cs
- DropSource.cs
- ImageCodecInfoPrivate.cs
- ToolStrip.cs
- ToolStripRenderer.cs
- HandleCollector.cs
- RectangleHotSpot.cs
- Cloud.cs
- CharacterHit.cs
- ParagraphResult.cs
- StandardToolWindows.cs
- ParamArrayAttribute.cs
- NameValueConfigurationElement.cs
- ContainerParaClient.cs
- Selection.cs
- ColorBlend.cs
- AutomationProperty.cs
- InputLanguage.cs
- SourceFileBuildProvider.cs
- SqlFileStream.cs
- SoapProtocolReflector.cs
- InfoCardX509Validator.cs
- XmlHierarchicalEnumerable.cs
- TextElementAutomationPeer.cs
- DictionaryContent.cs
- BinarySerializer.cs
- PreloadedPackages.cs
- RuntimeWrappedException.cs
- ControlCodeDomSerializer.cs
- TextDecorationUnitValidation.cs
- SignatureDescription.cs
- LogReserveAndAppendState.cs
- ListenerConnectionDemuxer.cs
- SqlCommand.cs
- TimeSpanSecondsConverter.cs
- ComponentDispatcherThread.cs
- CounterCreationDataConverter.cs
- CreateUserErrorEventArgs.cs
- GrammarBuilder.cs
- PtsPage.cs
- MergePropertyDescriptor.cs