Code:
/ FX-1434 / FX-1434 / 1.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
- ComplexPropertyEntry.cs
- ControlDesigner.cs
- FormViewInsertEventArgs.cs
- SyntaxCheck.cs
- DataGridViewAccessibleObject.cs
- ToggleButtonAutomationPeer.cs
- Nullable.cs
- RedistVersionInfo.cs
- ToReply.cs
- HMACMD5.cs
- StringFormat.cs
- WebSysDisplayNameAttribute.cs
- Int32AnimationUsingKeyFrames.cs
- Hashtable.cs
- DataGridTextBoxColumn.cs
- brushes.cs
- ConfigurationSettings.cs
- AvTrace.cs
- GradientSpreadMethodValidation.cs
- SpecialTypeDataContract.cs
- InfoCardArgumentException.cs
- DataControlFieldCell.cs
- ITreeGenerator.cs
- ModifierKeysConverter.cs
- Parser.cs
- ObjectDataSourceView.cs
- PrintEvent.cs
- InputQueue.cs
- Stacktrace.cs
- MediaTimeline.cs
- ItemCheckedEvent.cs
- EventDescriptor.cs
- BitArray.cs
- RulePatternOps.cs
- MetabaseServerConfig.cs
- DataGridrowEditEndingEventArgs.cs
- VoiceChangeEventArgs.cs
- TypeUnloadedException.cs
- CfgArc.cs
- complextypematerializer.cs
- MapPathBasedVirtualPathProvider.cs
- HttpSessionStateWrapper.cs
- CasesDictionary.cs
- XPathDescendantIterator.cs
- GridViewColumnHeader.cs
- Process.cs
- LocationFactory.cs
- EventListenerClientSide.cs
- EdmToObjectNamespaceMap.cs
- SmtpNtlmAuthenticationModule.cs
- AsyncStreamReader.cs
- TextServicesCompartmentEventSink.cs
- ClientRuntimeConfig.cs
- ListMarkerLine.cs
- TableLayoutSettings.cs
- SerialPort.cs
- coordinatorscratchpad.cs
- StringAnimationBase.cs
- NamespaceList.cs
- IIS7UserPrincipal.cs
- RichTextBox.cs
- MarkupExtensionParser.cs
- TemplatePartAttribute.cs
- TextTreeUndoUnit.cs
- Literal.cs
- Point3DCollectionValueSerializer.cs
- SerializationSectionGroup.cs
- DataBoundControlHelper.cs
- RtfToXamlLexer.cs
- GregorianCalendar.cs
- HtmlDocument.cs
- InstalledFontCollection.cs
- SQLConvert.cs
- HttpCookieCollection.cs
- BreakRecordTable.cs
- SystemMulticastIPAddressInformation.cs
- CapabilitiesState.cs
- StylusLogic.cs
- Run.cs
- FontWeights.cs
- BrowsableAttribute.cs
- CircleHotSpot.cs
- WebBrowserEvent.cs
- PersonalizableTypeEntry.cs
- AllMembershipCondition.cs
- IntSumAggregationOperator.cs
- EndpointReference.cs
- TextTreeFixupNode.cs
- CapabilitiesState.cs
- UTF8Encoding.cs
- Sql8ConformanceChecker.cs
- WebPartsPersonalizationAuthorization.cs
- SQLConvert.cs
- Typeface.cs
- TextParagraphCache.cs
- BindingExpressionUncommonField.cs
- GridEntryCollection.cs
- MatrixKeyFrameCollection.cs
- HwndKeyboardInputProvider.cs
- DeclaredTypeElementCollection.cs