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
- AssertSection.cs
- JoinTreeNode.cs
- XPathAncestorQuery.cs
- ListBindableAttribute.cs
- CodeObjectCreateExpression.cs
- SqlDataReader.cs
- VisualStyleElement.cs
- DetailsViewAutoFormat.cs
- ElementProxy.cs
- DetailsViewDeletedEventArgs.cs
- PowerEase.cs
- Pair.cs
- SoapParser.cs
- LocalBuilder.cs
- TokenBasedSetEnumerator.cs
- ClientTargetCollection.cs
- CatalogPartCollection.cs
- securestring.cs
- dtdvalidator.cs
- EdmItemError.cs
- DispatchChannelSink.cs
- RectangleF.cs
- BypassElementCollection.cs
- SemanticBasicElement.cs
- FunctionQuery.cs
- MultipartIdentifier.cs
- ProofTokenCryptoHandle.cs
- TraceSource.cs
- SamlConstants.cs
- EdmScalarPropertyAttribute.cs
- GraphicsContext.cs
- SplitterEvent.cs
- ButtonDesigner.cs
- SoapSchemaExporter.cs
- BaseDataBoundControl.cs
- UidPropertyAttribute.cs
- WinEventWrap.cs
- RTLAwareMessageBox.cs
- SimpleMailWebEventProvider.cs
- SQLDateTimeStorage.cs
- AccessText.cs
- CultureInfo.cs
- OverflowException.cs
- EntityProviderFactory.cs
- ErrorsHelper.cs
- ToolStripPanelRow.cs
- ImageFormat.cs
- ActiveXMessageFormatter.cs
- EntityCommandExecutionException.cs
- Geometry3D.cs
- MiniParameterInfo.cs
- ImageMapEventArgs.cs
- StatusCommandUI.cs
- EntityWrapperFactory.cs
- BufferAllocator.cs
- Expression.cs
- XmlSiteMapProvider.cs
- RIPEMD160Managed.cs
- FileIOPermission.cs
- Application.cs
- RangeBaseAutomationPeer.cs
- ServiceMemoryGates.cs
- TextTreeExtractElementUndoUnit.cs
- OleDbErrorCollection.cs
- CheckBox.cs
- ProfileModule.cs
- AssemblyResourceLoader.cs
- XmlDocumentType.cs
- XmlCharCheckingReader.cs
- IdentityHolder.cs
- IConvertible.cs
- Comparer.cs
- Control.cs
- RootNamespaceAttribute.cs
- TableLayoutCellPaintEventArgs.cs
- WaitHandleCannotBeOpenedException.cs
- TextEditorDragDrop.cs
- SystemInfo.cs
- TransformGroup.cs
- ParameterSubsegment.cs
- MetadataCacheItem.cs
- AppliedDeviceFiltersEditor.cs
- DrawItemEvent.cs
- xamlnodes.cs
- ProfileSettings.cs
- XmlUtilWriter.cs
- SqlConnectionManager.cs
- XPathScanner.cs
- PersonalizationProviderHelper.cs
- FileLogRecord.cs
- BitStream.cs
- DateTime.cs
- _AutoWebProxyScriptHelper.cs
- OleDbReferenceCollection.cs
- PriorityItem.cs
- DataSourceHelper.cs
- LocalServiceSecuritySettings.cs
- OuterGlowBitmapEffect.cs
- PrimitiveType.cs
- XMLDiffLoader.cs