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
- LineGeometry.cs
- ProgressBarHighlightConverter.cs
- DefaultClaimSet.cs
- AuthorizationSection.cs
- RegexCompilationInfo.cs
- StorageTypeMapping.cs
- SystemKeyConverter.cs
- dbenumerator.cs
- PageSetupDialog.cs
- AesManaged.cs
- StrokeCollectionConverter.cs
- ToolboxDataAttribute.cs
- EastAsianLunisolarCalendar.cs
- TabControl.cs
- ExtensionWindow.cs
- RawStylusActions.cs
- BindToObject.cs
- RightsManagementPermission.cs
- ClientBuildManager.cs
- MenuItemCollection.cs
- TextTreeTextElementNode.cs
- JoinCqlBlock.cs
- ForceCopyBuildProvider.cs
- NegotiateStream.cs
- HashMembershipCondition.cs
- WebHeaderCollection.cs
- LineServicesRun.cs
- ProtocolsConfigurationEntry.cs
- InvalidPrinterException.cs
- DataGridViewColumnConverter.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- cookiecontainer.cs
- OdbcException.cs
- Library.cs
- DataServiceException.cs
- listitem.cs
- IItemProperties.cs
- DockAndAnchorLayout.cs
- CompressedStack.cs
- _SpnDictionary.cs
- MissingMethodException.cs
- VectorKeyFrameCollection.cs
- MessageQueuePermissionEntryCollection.cs
- ColorConvertedBitmap.cs
- DetailsViewUpdateEventArgs.cs
- ImageConverter.cs
- CompilationSection.cs
- MachineKeyValidationConverter.cs
- ApplicationException.cs
- SpotLight.cs
- VersionPair.cs
- RuleRefElement.cs
- TypefaceMap.cs
- XmlSchemaValidationException.cs
- ConnectionPointCookie.cs
- ConstraintConverter.cs
- XPathNodeList.cs
- Util.cs
- InternalPermissions.cs
- EventSourceCreationData.cs
- ZoneLinkButton.cs
- CurrentTimeZone.cs
- WindowsListView.cs
- DecimalKeyFrameCollection.cs
- MetabaseServerConfig.cs
- Bits.cs
- XamlStyleSerializer.cs
- DrawingGroupDrawingContext.cs
- CryptoHelper.cs
- Bidi.cs
- OrderedDictionary.cs
- UnknownBitmapDecoder.cs
- ClassImporter.cs
- OpCellTreeNode.cs
- IMembershipProvider.cs
- Overlapped.cs
- XmlDocumentFragment.cs
- Stroke2.cs
- ContainerVisual.cs
- WebCodeGenerator.cs
- PropertyTabChangedEvent.cs
- CatalogPartChrome.cs
- ConcurrentQueue.cs
- OrderedDictionary.cs
- codemethodreferenceexpression.cs
- Token.cs
- GCHandleCookieTable.cs
- HttpResponse.cs
- TextTreeTextNode.cs
- CustomValidator.cs
- ClientFormsAuthenticationCredentials.cs
- OleDbErrorCollection.cs
- AdRotator.cs
- PropertyChangeTracker.cs
- BamlRecordWriter.cs
- UriTemplateTable.cs
- RowParagraph.cs
- SqlBuffer.cs
- AdCreatedEventArgs.cs
- MetadataArtifactLoaderCompositeFile.cs