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
- DBConcurrencyException.cs
- RijndaelManaged.cs
- XmlSchemaGroup.cs
- ApplicationSecurityManager.cs
- NativeMethods.cs
- AggregateNode.cs
- WebBrowserNavigatedEventHandler.cs
- AggregateNode.cs
- QuaternionAnimation.cs
- UseManagedPresentationBindingElementImporter.cs
- TypeDescriptionProviderAttribute.cs
- ToolTipService.cs
- StyleCollectionEditor.cs
- ExpressionVisitorHelpers.cs
- DataGridPageChangedEventArgs.cs
- ApplicationManager.cs
- ExpressionConverter.cs
- RedirectionProxy.cs
- WindowsListBox.cs
- SafeNativeMethods.cs
- XmlQueryRuntime.cs
- MetadataCacheItem.cs
- FileDialog_Vista_Interop.cs
- SoapServerMethod.cs
- MembershipValidatePasswordEventArgs.cs
- ResourceReader.cs
- BasicHttpMessageSecurityElement.cs
- CultureData.cs
- LicenseProviderAttribute.cs
- StaticSiteMapProvider.cs
- CommonGetThemePartSize.cs
- NamespaceDisplay.xaml.cs
- EventEntry.cs
- Evaluator.cs
- SQLInt32.cs
- DataServiceEntityAttribute.cs
- PrePrepareMethodAttribute.cs
- webproxy.cs
- GlyphRunDrawing.cs
- ButtonChrome.cs
- WebPageTraceListener.cs
- HttpApplicationFactory.cs
- ManifestResourceInfo.cs
- GlobalizationSection.cs
- ScrollChrome.cs
- SHA384.cs
- StringComparer.cs
- BrowserDefinitionCollection.cs
- Aes.cs
- BaseDataBoundControl.cs
- LeftCellWrapper.cs
- DbDataAdapter.cs
- SspiHelper.cs
- HtmlInputCheckBox.cs
- CaseInsensitiveOrdinalStringComparer.cs
- PropertiesTab.cs
- CollectionChange.cs
- DataBoundLiteralControl.cs
- ParenthesizePropertyNameAttribute.cs
- ParsedAttributeCollection.cs
- RemotingConfigParser.cs
- FlowDocumentReader.cs
- ViewCellRelation.cs
- ColorAnimation.cs
- ClientScriptManager.cs
- XamlFxTrace.cs
- Decoder.cs
- TypeUsageBuilder.cs
- ClientRuntimeConfig.cs
- OracleEncoding.cs
- OpenTypeMethods.cs
- SrgsToken.cs
- AttachedPropertyBrowsableAttribute.cs
- MediaTimeline.cs
- StreamWithDictionary.cs
- VirtualPathProvider.cs
- VisualStyleInformation.cs
- PreProcessor.cs
- DataSourceSelectArguments.cs
- Trigger.cs
- FormsAuthenticationUser.cs
- CertificateManager.cs
- HttpConfigurationSystem.cs
- IODescriptionAttribute.cs
- ToolStripItemTextRenderEventArgs.cs
- XmlLinkedNode.cs
- SupportingTokenListenerFactory.cs
- OdbcEnvironment.cs
- StringCollectionMarkupSerializer.cs
- Span.cs
- Latin1Encoding.cs
- TriggerCollection.cs
- DataSpaceManager.cs
- ScriptReference.cs
- EventSchemaTraceListener.cs
- EventLog.cs
- EventProxy.cs
- ToolBarOverflowPanel.cs
- IPAddressCollection.cs
- Parameter.cs