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
- Image.cs
- X509RawDataKeyIdentifierClause.cs
- Timeline.cs
- DictionaryTraceRecord.cs
- UnionCodeGroup.cs
- EntityTypeBase.cs
- ScopelessEnumAttribute.cs
- TypeUtil.cs
- KeyGestureConverter.cs
- TraceContext.cs
- ActiveDocumentEvent.cs
- SystemResourceKey.cs
- BooleanToVisibilityConverter.cs
- BaseCodePageEncoding.cs
- SamlSerializer.cs
- ViewCellSlot.cs
- CryptographicAttribute.cs
- CookielessHelper.cs
- SafeNativeMethods.cs
- HttpStreamMessage.cs
- PipelineModuleStepContainer.cs
- DataGridItemEventArgs.cs
- RbTree.cs
- SoapAttributeAttribute.cs
- loginstatus.cs
- MimeBasePart.cs
- WebConfigurationManager.cs
- pingexception.cs
- TagMapCollection.cs
- BufferedStream.cs
- ProfilePropertyNameValidator.cs
- ToolbarAUtomationPeer.cs
- ServiceModelConfiguration.cs
- XmlSchemaSimpleTypeList.cs
- HwndSourceParameters.cs
- Style.cs
- PauseStoryboard.cs
- DetailsViewRowCollection.cs
- FileLevelControlBuilderAttribute.cs
- ApplicationContext.cs
- CalendarDateRange.cs
- PostBackTrigger.cs
- PageClientProxyGenerator.cs
- XmlDataSourceNodeDescriptor.cs
- TextBreakpoint.cs
- RegexRunner.cs
- CrossAppDomainChannel.cs
- TrackingProvider.cs
- HwndHostAutomationPeer.cs
- MultiDataTrigger.cs
- FontInfo.cs
- RelationshipConverter.cs
- SystemUdpStatistics.cs
- Timer.cs
- ClaimTypes.cs
- DBDataPermission.cs
- RewritingSimplifier.cs
- InvalidContentTypeException.cs
- TextContainer.cs
- ConfigurationElementProperty.cs
- TextEditorSpelling.cs
- ResourceDisplayNameAttribute.cs
- XmlChoiceIdentifierAttribute.cs
- TreeNode.cs
- PagerSettings.cs
- XmlArrayItemAttributes.cs
- EventPropertyMap.cs
- AssemblyNameProxy.cs
- KerberosReceiverSecurityToken.cs
- XmlDocument.cs
- CurrencyManager.cs
- ResourceDictionary.cs
- EventLogPermissionAttribute.cs
- IDReferencePropertyAttribute.cs
- CellCreator.cs
- DBNull.cs
- HtmlInputImage.cs
- TextLine.cs
- SecurityException.cs
- ConfigXmlComment.cs
- PolygonHotSpot.cs
- FastEncoder.cs
- RectangleHotSpot.cs
- PreviewKeyDownEventArgs.cs
- Pair.cs
- CorrelationToken.cs
- UnsafeNativeMethods.cs
- ASCIIEncoding.cs
- NonSerializedAttribute.cs
- CodeTypeReference.cs
- ObjRef.cs
- SecurityCriticalDataForSet.cs
- XAMLParseException.cs
- StickyNoteHelper.cs
- Type.cs
- ListViewGroupConverter.cs
- TranslateTransform3D.cs
- Light.cs
- Metafile.cs
- XmlName.cs