Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / DescriptionAttribute.cs / 1305376 / DescriptionAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.ComponentModel { using System; using System.Diagnostics; using System.Security.Permissions; ////// [AttributeUsage(AttributeTargets.All)] public class DescriptionAttribute : Attribute { ///Specifies a description for a property /// or event. ////// public static readonly DescriptionAttribute Default = new DescriptionAttribute(); private string description; ///Specifies the default value for the ///, which is an /// empty string (""). This field is read-only. /// public DescriptionAttribute() : this (string.Empty) { } ///[To be supplied.] ////// public DescriptionAttribute(string description) { this.description = description; } ///Initializes a new instance of the ///class. /// public virtual string Description { get { return DescriptionValue; } } ///Gets the description stored in this attribute. ////// Read/Write property that directly modifies the string stored /// in the description attribute. The default implementation /// of the Description property simply returns this value. /// protected string DescriptionValue { get { return description; } set { description = value; } } public override bool Equals(object obj) { if (obj == this) { return true; } DescriptionAttribute other = obj as DescriptionAttribute; return (other != null) && other.Description == Description; } public override int GetHashCode() { return Description.GetHashCode(); } #if !SILVERLIGHT ////// /// public override bool IsDefaultAttribute() { return (this.Equals(Default)); } #endif } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.ComponentModel { using System; using System.Diagnostics; using System.Security.Permissions; ////// [AttributeUsage(AttributeTargets.All)] public class DescriptionAttribute : Attribute { ///Specifies a description for a property /// or event. ////// public static readonly DescriptionAttribute Default = new DescriptionAttribute(); private string description; ///Specifies the default value for the ///, which is an /// empty string (""). This field is read-only. /// public DescriptionAttribute() : this (string.Empty) { } ///[To be supplied.] ////// public DescriptionAttribute(string description) { this.description = description; } ///Initializes a new instance of the ///class. /// public virtual string Description { get { return DescriptionValue; } } ///Gets the description stored in this attribute. ////// Read/Write property that directly modifies the string stored /// in the description attribute. The default implementation /// of the Description property simply returns this value. /// protected string DescriptionValue { get { return description; } set { description = value; } } public override bool Equals(object obj) { if (obj == this) { return true; } DescriptionAttribute other = obj as DescriptionAttribute; return (other != null) && other.Description == Description; } public override int GetHashCode() { return Description.GetHashCode(); } #if !SILVERLIGHT ////// /// public override bool IsDefaultAttribute() { return (this.Equals(Default)); } #endif } } // 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
- ToolStripContainerActionList.cs
- DistinctQueryOperator.cs
- ListInitExpression.cs
- Function.cs
- Context.cs
- StrokeRenderer.cs
- HScrollBar.cs
- ImpersonateTokenRef.cs
- ReadingWritingEntityEventArgs.cs
- TemplateComponentConnector.cs
- BaseAutoFormat.cs
- TableLayoutPanelBehavior.cs
- PieceDirectory.cs
- FlowDocumentPaginator.cs
- Pair.cs
- NativeMethods.cs
- Set.cs
- TextEditorTyping.cs
- SafeLibraryHandle.cs
- SqlDataReader.cs
- SafeIUnknown.cs
- Pen.cs
- InheritanceRules.cs
- LayoutEngine.cs
- SafeLibraryHandle.cs
- OdbcPermission.cs
- BindingListCollectionView.cs
- SByteStorage.cs
- FormatConvertedBitmap.cs
- MessageEncodingBindingElement.cs
- ASCIIEncoding.cs
- DataGridItemEventArgs.cs
- SafeLibraryHandle.cs
- Model3DCollection.cs
- ParameterCollection.cs
- XhtmlConformanceSection.cs
- WrappedKeySecurityToken.cs
- Point3DAnimationBase.cs
- TextElementEnumerator.cs
- XsltException.cs
- SafeCryptHandles.cs
- BindingObserver.cs
- CustomTypeDescriptor.cs
- BitmapMetadataEnumerator.cs
- ToolStripSeparatorRenderEventArgs.cs
- ObjectSet.cs
- TextRangeEditTables.cs
- NegationPusher.cs
- DataGridRowHeader.cs
- Math.cs
- ImageDrawing.cs
- AppSettingsExpressionBuilder.cs
- SwitchLevelAttribute.cs
- IsolatedStorageException.cs
- RuntimeWrappedException.cs
- HuffmanTree.cs
- XmlSchemaProviderAttribute.cs
- AutomationElementCollection.cs
- ToolStripItemTextRenderEventArgs.cs
- ToolStripDropDownItemDesigner.cs
- TextRangeEdit.cs
- OperationCanceledException.cs
- QuaternionAnimation.cs
- SqlDependency.cs
- AttributeSetAction.cs
- Roles.cs
- WebPartDeleteVerb.cs
- ResolvedKeyFrameEntry.cs
- PermissionSet.cs
- CodeDirectionExpression.cs
- Image.cs
- XmlSerializationReader.cs
- PeerNameResolver.cs
- SystemNetworkInterface.cs
- DataSysAttribute.cs
- ProfessionalColors.cs
- TableStyle.cs
- EpmCustomContentWriterNodeData.cs
- InlineUIContainer.cs
- InplaceBitmapMetadataWriter.cs
- Encoding.cs
- NullToBooleanConverter.cs
- ThreadAbortException.cs
- GetWinFXPath.cs
- MeasureData.cs
- dbdatarecord.cs
- TextPatternIdentifiers.cs
- EpmSourcePathSegment.cs
- AnnotationAuthorChangedEventArgs.cs
- LinkButton.cs
- SoapHeader.cs
- TimeoutException.cs
- AssemblyCacheEntry.cs
- SqlReferenceCollection.cs
- TableItemPattern.cs
- Unit.cs
- BamlRecordHelper.cs
- ToolStripContentPanelRenderEventArgs.cs
- StaticTextPointer.cs
- VirtualDirectoryMappingCollection.cs