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
- Sorting.cs
- StringPropertyBuilder.cs
- FixedSchema.cs
- Transactions.cs
- NewItemsContextMenuStrip.cs
- XMLUtil.cs
- XmlSchemaGroup.cs
- PathData.cs
- ClientBuildManager.cs
- GetFileNameResult.cs
- XmlUtil.cs
- RSAOAEPKeyExchangeDeformatter.cs
- NameValuePermission.cs
- StrongTypingException.cs
- PerformanceCounter.cs
- _BaseOverlappedAsyncResult.cs
- DataServicePagingProviderWrapper.cs
- DbModificationCommandTree.cs
- MouseGestureValueSerializer.cs
- Relationship.cs
- XmlException.cs
- Clipboard.cs
- DataServiceExpressionVisitor.cs
- SpellerStatusTable.cs
- PersonalizationStateQuery.cs
- Error.cs
- MethodCallExpression.cs
- OutputCacheProfileCollection.cs
- SimpleTextLine.cs
- ExpressionConverter.cs
- HttpClientCertificate.cs
- WindowsTreeView.cs
- DataBoundControlDesigner.cs
- SafeHandle.cs
- WinFormsComponentEditor.cs
- PropertyRef.cs
- FacetValueContainer.cs
- CountAggregationOperator.cs
- HttpProfileBase.cs
- CheckedPointers.cs
- FileDataSourceCache.cs
- Point3DAnimation.cs
- ManagedWndProcTracker.cs
- HideDisabledControlAdapter.cs
- Int16Animation.cs
- DataPagerField.cs
- X509ImageLogo.cs
- PrefixQName.cs
- CriticalHandle.cs
- ObjectViewQueryResultData.cs
- XmlSchemaSimpleContent.cs
- Trace.cs
- AnnotationHelper.cs
- StrokeRenderer.cs
- ManagementObject.cs
- _SafeNetHandles.cs
- ProxyGenerator.cs
- SelectionEditor.cs
- FormView.cs
- FontInfo.cs
- DesignTimeTemplateParser.cs
- StylusPoint.cs
- SqlExpressionNullability.cs
- DtrList.cs
- FlowNode.cs
- WebBrowser.cs
- StringHelper.cs
- NavigationProgressEventArgs.cs
- NumberAction.cs
- AnnotationHelper.cs
- LocalServiceSecuritySettingsElement.cs
- ServiceContractGenerator.cs
- DiffuseMaterial.cs
- SecurityTokenValidationException.cs
- ResponseBodyWriter.cs
- MenuDesigner.cs
- CanonicalizationDriver.cs
- DataPagerFieldCollection.cs
- SequentialOutput.cs
- DatatypeImplementation.cs
- LookupTables.cs
- AssemblyBuilderData.cs
- IdnElement.cs
- MembershipPasswordException.cs
- ParagraphVisual.cs
- ObjectViewListener.cs
- KeyTime.cs
- SafeBitVector32.cs
- _SafeNetHandles.cs
- SettingsPropertyNotFoundException.cs
- Comparer.cs
- GeneralTransform3D.cs
- TemplateApplicationHelper.cs
- DesignerVerbCollection.cs
- SoapInteropTypes.cs
- XmlExpressionDumper.cs
- X509ChainPolicy.cs
- LocalServiceSecuritySettings.cs
- DocumentReferenceCollection.cs
- HttpCapabilitiesEvaluator.cs