Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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(); } } } // 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
- ResourcePool.cs
- Sentence.cs
- PriorityRange.cs
- BindingContext.cs
- Vector3DCollection.cs
- xmlglyphRunInfo.cs
- WebPartDisplayModeCollection.cs
- cache.cs
- TextDpi.cs
- ControlUtil.cs
- TransformGroup.cs
- XappLauncher.cs
- RowParagraph.cs
- IsolatedStoragePermission.cs
- CheckedPointers.cs
- DocumentPageView.cs
- LineGeometry.cs
- Parallel.cs
- WebPartDisplayMode.cs
- GeometryDrawing.cs
- TemplateControlBuildProvider.cs
- SoapObjectInfo.cs
- MetaDataInfo.cs
- HttpResponseHeader.cs
- StreamWriter.cs
- sqlpipe.cs
- WaitForChangedResult.cs
- DefaultValidator.cs
- MSAAWinEventWrap.cs
- RegularExpressionValidator.cs
- TickBar.cs
- Utils.cs
- SemanticAnalyzer.cs
- TemplateNameScope.cs
- CreatingCookieEventArgs.cs
- COM2ColorConverter.cs
- ImageButton.cs
- TemplatedAdorner.cs
- SQLResource.cs
- AstTree.cs
- Double.cs
- Int64AnimationUsingKeyFrames.cs
- MemoryPressure.cs
- _BaseOverlappedAsyncResult.cs
- Panel.cs
- ListControlBoundActionList.cs
- ExceptionWrapper.cs
- BaseTemplateBuildProvider.cs
- StylesEditorDialog.cs
- Vector3D.cs
- Context.cs
- SamlConstants.cs
- GridProviderWrapper.cs
- AsnEncodedData.cs
- TextShapeableCharacters.cs
- BStrWrapper.cs
- WindowsGraphics.cs
- FilteredDataSetHelper.cs
- MSHTMLHost.cs
- SoapIncludeAttribute.cs
- ConfigurationManagerHelper.cs
- SettingsPropertyNotFoundException.cs
- AnnouncementDispatcherAsyncResult.cs
- SoapEnumAttribute.cs
- StateManagedCollection.cs
- DBConcurrencyException.cs
- ImageIndexConverter.cs
- ToolStripPanelRow.cs
- BroadcastEventHelper.cs
- FixedDocumentPaginator.cs
- FirstMatchCodeGroup.cs
- ReferentialConstraint.cs
- PeerToPeerException.cs
- XmlDocument.cs
- DispatcherProcessingDisabled.cs
- CellQuery.cs
- StylusTip.cs
- EntityDataSourceContextCreatingEventArgs.cs
- TransportManager.cs
- sqlnorm.cs
- DSASignatureDeformatter.cs
- CommandCollectionEditor.cs
- DrawListViewSubItemEventArgs.cs
- URLString.cs
- PropertyDescriptor.cs
- TableParaClient.cs
- Model3DGroup.cs
- ErrorFormatterPage.cs
- ControlAdapter.cs
- CalendarTable.cs
- HiddenField.cs
- StrokeIntersection.cs
- ProxyFragment.cs
- dbenumerator.cs
- HostedHttpContext.cs
- Root.cs
- DataSvcMapFileSerializer.cs
- Exceptions.cs
- _SslState.cs
- ExpandableObjectConverter.cs