Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / DesignOnlyAttribute.cs / 1305376 / 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(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ // // 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(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AssemblySettingAttributes.cs
- FontWeights.cs
- LayoutEditorPart.cs
- __Error.cs
- DelegatedStream.cs
- GeneralTransform.cs
- DataView.cs
- SearchForVirtualItemEventArgs.cs
- IInstanceTable.cs
- MembershipAdapter.cs
- VideoDrawing.cs
- RuntimeHandles.cs
- SendActivityDesignerTheme.cs
- DeviceContext.cs
- ColorAnimationBase.cs
- DesignerDataTable.cs
- ContentTextAutomationPeer.cs
- DataServiceQuery.cs
- PageBreakRecord.cs
- FlowDocument.cs
- PasswordTextNavigator.cs
- DeferredSelectedIndexReference.cs
- Helper.cs
- LogicalCallContext.cs
- CopyEncoder.cs
- Query.cs
- SQLByte.cs
- DescendantBaseQuery.cs
- ResourceReader.cs
- NestedContainer.cs
- DependencyObjectType.cs
- ScalarRestriction.cs
- TextElementEditingBehaviorAttribute.cs
- TemplatingOptionsDialog.cs
- DataStorage.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- SiteMapNode.cs
- CaseExpr.cs
- UpdateRecord.cs
- SqlDataSourceCommandEventArgs.cs
- SdlChannelSink.cs
- ConfigXmlWhitespace.cs
- WmpBitmapDecoder.cs
- Control.cs
- SqlCommandSet.cs
- ExpressionList.cs
- ObjectConverter.cs
- VisualTreeUtils.cs
- ResourceWriter.cs
- SocketCache.cs
- AuthenticationModuleElement.cs
- ProcessThreadDesigner.cs
- ValueTable.cs
- StringDictionary.cs
- ProjectionCamera.cs
- TextCollapsingProperties.cs
- XamlSerializerUtil.cs
- RowBinding.cs
- RegisteredHiddenField.cs
- QilTernary.cs
- WebResourceUtil.cs
- ImageList.cs
- RequestCacheValidator.cs
- WebPartMenuStyle.cs
- XmlConvert.cs
- SizeKeyFrameCollection.cs
- AdornerDecorator.cs
- EntitySqlQueryState.cs
- PictureBox.cs
- LocalizabilityAttribute.cs
- UrlAuthFailureHandler.cs
- BaseParagraph.cs
- FormsAuthenticationCredentials.cs
- IISMapPath.cs
- Enlistment.cs
- EventLogConfiguration.cs
- ToolStripOverflow.cs
- ToolboxBitmapAttribute.cs
- DataSetMappper.cs
- nulltextcontainer.cs
- Int64AnimationBase.cs
- FileNotFoundException.cs
- UIElementParagraph.cs
- GridEntry.cs
- ReadWriteControlDesigner.cs
- ConnectionManagementElement.cs
- EmissiveMaterial.cs
- FileSystemWatcher.cs
- EncodingNLS.cs
- MsmqProcessProtocolHandler.cs
- WebPartConnectionsConfigureVerb.cs
- StatusBarItemAutomationPeer.cs
- Decorator.cs
- AdCreatedEventArgs.cs
- Container.cs
- WebEventCodes.cs
- FileAccessException.cs
- bindurihelper.cs
- Debug.cs
- TableTextElementCollectionInternal.cs