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
- GuidelineCollection.cs
- SurrogateSelector.cs
- TraceUtils.cs
- ArraySet.cs
- DataBoundControlHelper.cs
- StyleTypedPropertyAttribute.cs
- SmiMetaData.cs
- TableLayoutColumnStyleCollection.cs
- arc.cs
- RequestCachingSection.cs
- ProjectedSlot.cs
- BoundColumn.cs
- PagesChangedEventArgs.cs
- SrgsItemList.cs
- ActivationProxy.cs
- AutomationFocusChangedEventArgs.cs
- ChannelTraceRecord.cs
- NetSectionGroup.cs
- ManipulationDevice.cs
- Timer.cs
- FrameworkContentElementAutomationPeer.cs
- WebContext.cs
- PasswordTextNavigator.cs
- Transactions.cs
- BigInt.cs
- URLString.cs
- CompositeDataBoundControl.cs
- EventLogEntry.cs
- XmlWrappingReader.cs
- TrustManager.cs
- TransformerTypeCollection.cs
- Composition.cs
- FixedTextContainer.cs
- ConfigViewGenerator.cs
- MachineKeySection.cs
- RenderTargetBitmap.cs
- ArrayConverter.cs
- SHA512.cs
- NTAccount.cs
- SchemaImporter.cs
- EventPrivateKey.cs
- StateMachineHelpers.cs
- RegexBoyerMoore.cs
- ListBox.cs
- DesignerTransactionCloseEvent.cs
- SqlTransaction.cs
- DashStyles.cs
- ReflectTypeDescriptionProvider.cs
- FtpRequestCacheValidator.cs
- SqlMetaData.cs
- Timeline.cs
- DataColumnPropertyDescriptor.cs
- HtmlMeta.cs
- SystemIcmpV6Statistics.cs
- ExpressionUtilities.cs
- TagPrefixCollection.cs
- SymLanguageType.cs
- ColorAnimationBase.cs
- EdmProviderManifest.cs
- ObjectKeyFrameCollection.cs
- Executor.cs
- WebPartConnection.cs
- PositiveTimeSpanValidatorAttribute.cs
- XPathArrayIterator.cs
- UnsafeNativeMethods.cs
- Base64Encoder.cs
- SchemaNamespaceManager.cs
- PropertyMetadata.cs
- PathTooLongException.cs
- EventsTab.cs
- DataGridViewCheckBoxCell.cs
- XPathNodePointer.cs
- StoreItemCollection.Loader.cs
- ButtonField.cs
- NativeMethodsCLR.cs
- TypedElement.cs
- XmlExtensionFunction.cs
- IndexingContentUnit.cs
- ListManagerBindingsCollection.cs
- TextSpanModifier.cs
- BrowserTree.cs
- Choices.cs
- SafeWaitHandle.cs
- IdentityElement.cs
- NetworkStream.cs
- LogRecordSequence.cs
- CompilerErrorCollection.cs
- Switch.cs
- _NegoState.cs
- DataRowView.cs
- PieceDirectory.cs
- ObfuscateAssemblyAttribute.cs
- EditorZoneDesigner.cs
- FileLogRecordEnumerator.cs
- RequestedSignatureDialog.cs
- ToolStripButton.cs
- Dispatcher.cs
- SchemaImporterExtensionElementCollection.cs
- ArrayHelper.cs
- AnimationClock.cs