Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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; ////// [ ClassInterface(ClassInterfaceType.AutoDispatch), ComVisible(true), Serializable, ] public class CodeAttributeDeclaration { private string name; private CodeAttributeArgumentCollection arguments = new CodeAttributeArgumentCollection(); [OptionalField] private CodeTypeReference attributeType; ////// Represents a single custom attribute. /// ////// public CodeAttributeDeclaration() { } ////// Initializes a new instance of ///. /// /// public CodeAttributeDeclaration(string name) { Name = name; } ////// Initializes a new instance of ///using the specified name. /// /// 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); } } ////// Initializes a new instance of ///using the specified /// arguments. /// /// public string Name { get { return (name == null) ? string.Empty : name; } set { name = value; attributeType = new CodeTypeReference(name); } } ////// The name of the attribute being declared. /// ////// public CodeAttributeArgumentCollection Arguments { get { return arguments; } } public CodeTypeReference AttributeType { get { return attributeType; } } } }/// The arguments for the attribute. /// ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- _LoggingObject.cs
- TypeForwardedToAttribute.cs
- FuncTypeConverter.cs
- WebServiceErrorEvent.cs
- HwndSource.cs
- Vector.cs
- RegexCaptureCollection.cs
- Transaction.cs
- ReadOnlyDictionary.cs
- Catch.cs
- DataGridViewImageCell.cs
- DataGridColumn.cs
- CompilationSection.cs
- TableRow.cs
- PageCodeDomTreeGenerator.cs
- DbRetry.cs
- Thickness.cs
- ParameterCollection.cs
- ToolStripDropDownClosedEventArgs.cs
- PathFigure.cs
- ToolboxDataAttribute.cs
- SpellerInterop.cs
- TableLayoutSettingsTypeConverter.cs
- WorkflowApplicationUnloadedException.cs
- InvalidateEvent.cs
- AnnotationResourceChangedEventArgs.cs
- HttpChannelBindingToken.cs
- ParallelEnumerableWrapper.cs
- newinstructionaction.cs
- cookie.cs
- DisplayInformation.cs
- Int16Storage.cs
- CodeBinaryOperatorExpression.cs
- LZCodec.cs
- TextServicesHost.cs
- ExceptionTranslationTable.cs
- Timer.cs
- DataServiceQueryOfT.cs
- FixedTextPointer.cs
- ClientSideProviderDescription.cs
- DataFormats.cs
- ConfigurationElementProperty.cs
- CreateUserWizard.cs
- DivideByZeroException.cs
- Adorner.cs
- OrderedDictionaryStateHelper.cs
- HTMLTagNameToTypeMapper.cs
- DataContract.cs
- ThreadStaticAttribute.cs
- InputProviderSite.cs
- ApplicationServiceManager.cs
- SiteMapNodeItem.cs
- ObjectStorage.cs
- XmlSubtreeReader.cs
- GZipDecoder.cs
- DiagnosticTrace.cs
- SendMailErrorEventArgs.cs
- JsonFormatGeneratorStatics.cs
- UserControlAutomationPeer.cs
- ActivityMarkupSerializationProvider.cs
- XmlResolver.cs
- ConnectionManagementSection.cs
- FileSecurity.cs
- RegularExpressionValidator.cs
- DriveNotFoundException.cs
- X509SecurityTokenProvider.cs
- ConstraintConverter.cs
- ThicknessKeyFrameCollection.cs
- LinearGradientBrush.cs
- XmlRootAttribute.cs
- XmlDocumentSerializer.cs
- OptimalBreakSession.cs
- IFlowDocumentViewer.cs
- IriParsingElement.cs
- PasswordDeriveBytes.cs
- CompositeDataBoundControl.cs
- UserNameSecurityTokenProvider.cs
- AudienceUriMode.cs
- MimeWriter.cs
- XmlNamespaceDeclarationsAttribute.cs
- TrackingParameters.cs
- SimpleFieldTemplateUserControl.cs
- ProxyManager.cs
- NullableDecimalSumAggregationOperator.cs
- IODescriptionAttribute.cs
- ThousandthOfEmRealPoints.cs
- ToolStripArrowRenderEventArgs.cs
- TypeSemantics.cs
- PlatformNotSupportedException.cs
- RefreshPropertiesAttribute.cs
- UnsafeNativeMethodsPenimc.cs
- Process.cs
- TextAction.cs
- QilScopedVisitor.cs
- CalendarAutomationPeer.cs
- EventDescriptorCollection.cs
- CompositeDuplexBindingElement.cs
- FreezableDefaultValueFactory.cs
- HtmlInputPassword.cs
- JournalEntryListConverter.cs