Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / CompMod / System / ComponentModel / DesignOnlyAttribute.cs / 1 / DesignOnlyAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.ComponentModel { using System; using System.Diagnostics; using System.Security.Permissions; ////// [AttributeUsage(AttributeTargets.All)] public sealed class DesignOnlyAttribute : Attribute { private bool isDesignOnly = false; ///Specifies whether a property can only be set at /// design time. ////// public DesignOnlyAttribute(bool isDesignOnly) { this.isDesignOnly = isDesignOnly; } ////// Initializes a new instance of the ///class. /// /// public bool IsDesignOnly { get { return isDesignOnly; } } ////// Gets a value indicating whether a property /// can be set only at design time. /// ////// public static readonly DesignOnlyAttribute Yes = new DesignOnlyAttribute(true); ////// Specifies that a property can be set only at design time. This /// ///field is read-only. /// /// public static readonly DesignOnlyAttribute No = new DesignOnlyAttribute(false); ////// Specifies /// that a /// property can be set at design time or at run /// time. This ///field is read-only. /// /// public static readonly DesignOnlyAttribute Default = No; ////// Specifies the default value for the ///, which is . This field is /// read-only. /// /// ///public override bool IsDefaultAttribute() { return IsDesignOnly == Default.IsDesignOnly; } public override bool Equals(object obj) { if (obj == this) { return true; } DesignOnlyAttribute other = obj as DesignOnlyAttribute; return (other != null) && other.isDesignOnly == isDesignOnly; } public override int GetHashCode() { return isDesignOnly.GetHashCode(); } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RectangleGeometry.cs
- StructuredTypeEmitter.cs
- HuffmanTree.cs
- WebServiceBindingAttribute.cs
- SystemTcpStatistics.cs
- MemoryPressure.cs
- SiteMapNodeCollection.cs
- BitmapEffectDrawingContextWalker.cs
- HttpHandlersSection.cs
- KeyConverter.cs
- ResourceSet.cs
- WebUtil.cs
- Metafile.cs
- Point4DConverter.cs
- _LazyAsyncResult.cs
- EventRouteFactory.cs
- WebPartHelpVerb.cs
- AttributeProviderAttribute.cs
- BaseDataList.cs
- ProcessModuleCollection.cs
- ObservableCollectionDefaultValueFactory.cs
- CacheChildrenQuery.cs
- XmlUtilWriter.cs
- ClientBuildManager.cs
- CuspData.cs
- OledbConnectionStringbuilder.cs
- Effect.cs
- Mutex.cs
- EFTableProvider.cs
- DiagnosticsConfiguration.cs
- OleDbWrapper.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- ProviderMetadata.cs
- PerformanceCounterLib.cs
- DataGridPageChangedEventArgs.cs
- TextEditorSpelling.cs
- AlternationConverter.cs
- RelationshipEndCollection.cs
- HttpRequestCacheValidator.cs
- SocketElement.cs
- PageRanges.cs
- GridViewDeleteEventArgs.cs
- SEHException.cs
- AdCreatedEventArgs.cs
- Operators.cs
- DefaultValueAttribute.cs
- QueryException.cs
- DataProtection.cs
- CommandField.cs
- AVElementHelper.cs
- ContentPropertyAttribute.cs
- InvalidCastException.cs
- MemberAccessException.cs
- RTTrackingProfile.cs
- SecurityTokenProviderContainer.cs
- ButtonChrome.cs
- StructureChangedEventArgs.cs
- EventSinkHelperWriter.cs
- Inflater.cs
- Codec.cs
- MethodAccessException.cs
- PeerCollaborationPermission.cs
- LinqDataSourceStatusEventArgs.cs
- DatePicker.cs
- RecognizeCompletedEventArgs.cs
- AuthenticationServiceManager.cs
- MessageHeaderDescription.cs
- CodeDelegateInvokeExpression.cs
- HttpCookie.cs
- OrderedEnumerableRowCollection.cs
- DesignerObjectListAdapter.cs
- SettingsContext.cs
- FloaterParagraph.cs
- DbProviderFactories.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- DataGridViewColumnConverter.cs
- InstanceValue.cs
- Help.cs
- DatasetMethodGenerator.cs
- CqlLexer.cs
- x509utils.cs
- LinkedResource.cs
- QuaternionConverter.cs
- ConfigurationPermission.cs
- NumberFunctions.cs
- Metadata.cs
- CodeFieldReferenceExpression.cs
- SecurityHeaderTokenResolver.cs
- SqlDependencyListener.cs
- GenericPrincipal.cs
- DateTimeOffset.cs
- CompiledIdentityConstraint.cs
- Rect3DConverter.cs
- PrincipalPermission.cs
- BaseServiceProvider.cs
- DataGridViewRowsAddedEventArgs.cs
- DelegateBodyWriter.cs
- ImageCodecInfo.cs
- ContentFileHelper.cs
- HttpCacheVaryByContentEncodings.cs