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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- OdbcConnectionFactory.cs
- DataGridViewTextBoxColumn.cs
- COM2ColorConverter.cs
- InheritedPropertyChangedEventArgs.cs
- GridViewRowCollection.cs
- RegexWriter.cs
- OdbcRowUpdatingEvent.cs
- ACL.cs
- Vector3D.cs
- ToolStripSplitButton.cs
- MonikerProxyAttribute.cs
- WindowsRegion.cs
- RectangleGeometry.cs
- HtmlLink.cs
- CompatibleComparer.cs
- AssemblyBuilderData.cs
- SegmentInfo.cs
- Propagator.ExtentPlaceholderCreator.cs
- DocumentSequence.cs
- ListViewDataItem.cs
- SecurityContext.cs
- DataGridViewCellEventArgs.cs
- CodeCatchClause.cs
- WebEvents.cs
- MsdtcClusterUtils.cs
- ContainerVisual.cs
- Label.cs
- XmlElementAttributes.cs
- AuthenticationException.cs
- ProfileModule.cs
- ViewManager.cs
- AsyncParams.cs
- ZipArchive.cs
- DateTimeConstantAttribute.cs
- SortedList.cs
- RequestCache.cs
- WorkflowControlEndpoint.cs
- DefaultEvaluationContext.cs
- VectorAnimationUsingKeyFrames.cs
- AuthenticationServiceManager.cs
- ExternalFile.cs
- PerspectiveCamera.cs
- ToolStripKeyboardHandlingService.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- GroupStyle.cs
- ConfigurationManager.cs
- sqlmetadatafactory.cs
- StringSorter.cs
- LongSumAggregationOperator.cs
- PartialCachingControl.cs
- DataGridViewCellParsingEventArgs.cs
- GeneralTransformGroup.cs
- IntSumAggregationOperator.cs
- SQLDateTime.cs
- Tracking.cs
- MenuAutoFormat.cs
- CharacterHit.cs
- PageClientProxyGenerator.cs
- EndEvent.cs
- ArraySegment.cs
- SettingsPropertyNotFoundException.cs
- HtmlTableRowCollection.cs
- FileLoadException.cs
- Control.cs
- IHttpResponseInternal.cs
- ChannelReliableSession.cs
- Select.cs
- ListBox.cs
- WaitingCursor.cs
- TextTreeTextElementNode.cs
- AmbiguousMatchException.cs
- BaseAsyncResult.cs
- DataServiceExpressionVisitor.cs
- BitmapEffectDrawingContextState.cs
- Asn1IntegerConverter.cs
- TypeHelpers.cs
- XamlDesignerSerializationManager.cs
- PublisherMembershipCondition.cs
- EntityDataSourceWrapper.cs
- DataGridViewImageCell.cs
- OpCopier.cs
- KeyValuePairs.cs
- SafeRegistryHandle.cs
- OuterGlowBitmapEffect.cs
- ScriptControl.cs
- RangeValuePatternIdentifiers.cs
- TextSchema.cs
- FormsIdentity.cs
- WebPartConnectionsConfigureVerb.cs
- httpserverutility.cs
- ExpressionVisitor.cs
- SvcMapFile.cs
- SQLMembershipProvider.cs
- ModuleBuilder.cs
- NetworkCredential.cs
- SpellerHighlightLayer.cs
- XsltLibrary.cs
- ConstructorExpr.cs
- EventlogProvider.cs
- ScaleTransform.cs