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
- xml.cs
- CultureInfo.cs
- DataGridViewCellValueEventArgs.cs
- BCLDebug.cs
- HtmlMeta.cs
- ComPlusDiagnosticTraceRecords.cs
- QueueSurrogate.cs
- GlobalizationAssembly.cs
- ContractUtils.cs
- TraceSection.cs
- CodeStatement.cs
- CodeTypeDeclarationCollection.cs
- XmlWrappingReader.cs
- RuntimeConfigurationRecord.cs
- Color.cs
- NGCPageContentCollectionSerializerAsync.cs
- mda.cs
- ToolStripGrip.cs
- PartManifestEntry.cs
- StringToken.cs
- DodSequenceMerge.cs
- UnsafeNativeMethods.cs
- AsyncSerializedWorker.cs
- ByteKeyFrameCollection.cs
- UdpDiscoveryMessageFilter.cs
- MimePart.cs
- NoResizeHandleGlyph.cs
- ParameterBuilder.cs
- DataRowChangeEvent.cs
- WinEventHandler.cs
- BinHexDecoder.cs
- Bezier.cs
- SignatureToken.cs
- InputMethod.cs
- HwndHostAutomationPeer.cs
- TextOutput.cs
- TextViewSelectionProcessor.cs
- SecurityTokenAuthenticator.cs
- LinkLabel.cs
- DataAdapter.cs
- StyleBamlRecordReader.cs
- XmlNodeChangedEventManager.cs
- DataSetMappper.cs
- RepeaterCommandEventArgs.cs
- ToolStripItemRenderEventArgs.cs
- GeneralTransformGroup.cs
- ThreadAttributes.cs
- CopyNodeSetAction.cs
- NavigationFailedEventArgs.cs
- BroadcastEventHelper.cs
- SQLConvert.cs
- FixedPage.cs
- TaskHelper.cs
- TextTreeRootTextBlock.cs
- ObjectQueryExecutionPlan.cs
- ObjectDataSourceStatusEventArgs.cs
- PropertyManager.cs
- SchemaCollectionCompiler.cs
- MultipleViewProviderWrapper.cs
- PasswordBox.cs
- ActivityExecutionContextCollection.cs
- WebSysDisplayNameAttribute.cs
- UriScheme.cs
- DataTable.cs
- EndpointAddress.cs
- ContainerControlDesigner.cs
- XmlEncoding.cs
- CodeParameterDeclarationExpressionCollection.cs
- OleDbPropertySetGuid.cs
- EncoderParameters.cs
- DbConnectionClosed.cs
- ArgumentOutOfRangeException.cs
- DefaultEvaluationContext.cs
- SafeArrayTypeMismatchException.cs
- SchemaAttDef.cs
- CursorConverter.cs
- ScrollChrome.cs
- X509IssuerSerialKeyIdentifierClause.cs
- EventRouteFactory.cs
- OutputCacheSettingsSection.cs
- StrokeNodeOperations2.cs
- LinearGradientBrush.cs
- MatrixConverter.cs
- SemaphoreSecurity.cs
- DataGridViewCellValueEventArgs.cs
- NameTable.cs
- CommandField.cs
- DoneReceivingAsyncResult.cs
- Stroke2.cs
- DBDataPermissionAttribute.cs
- HostingEnvironment.cs
- PropertyValueChangedEvent.cs
- Int64AnimationUsingKeyFrames.cs
- MethodRental.cs
- RectangleGeometry.cs
- Int32Storage.cs
- UIElementCollection.cs
- RectangleConverter.cs
- HtmlElementErrorEventArgs.cs
- DWriteFactory.cs