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
- LineGeometry.cs
- Selector.cs
- TableItemPattern.cs
- formatter.cs
- DataTableReader.cs
- TextParagraphCache.cs
- XmlName.cs
- KeyGesture.cs
- RichTextBoxDesigner.cs
- WebBrowserContainer.cs
- IndentTextWriter.cs
- BaseParser.cs
- FacetDescriptionElement.cs
- StorageComplexPropertyMapping.cs
- DragCompletedEventArgs.cs
- URI.cs
- DataServiceRequest.cs
- ViewStateModeByIdAttribute.cs
- MimeReturn.cs
- EncodingInfo.cs
- OleAutBinder.cs
- X509SecurityToken.cs
- FixedDocument.cs
- ConfigXmlWhitespace.cs
- StructuralType.cs
- XPathDocument.cs
- BitmapDownload.cs
- WindowsListViewScroll.cs
- panel.cs
- MediaContextNotificationWindow.cs
- GenericAuthenticationEventArgs.cs
- MessageQueuePermissionEntry.cs
- Binding.cs
- SplashScreenNativeMethods.cs
- OdbcRowUpdatingEvent.cs
- LogSwitch.cs
- Cursor.cs
- TableAdapterManagerGenerator.cs
- GraphicsContext.cs
- FullTextLine.cs
- TableLayoutPanelDesigner.cs
- WmlPhoneCallAdapter.cs
- WpfKnownTypeInvoker.cs
- EntityTypeEmitter.cs
- DuplicateWaitObjectException.cs
- OdbcConnectionOpen.cs
- LayoutEditorPart.cs
- SqlAliaser.cs
- OneOf.cs
- JumpTask.cs
- GenericXmlSecurityTokenAuthenticator.cs
- MaskedTextProvider.cs
- GatewayIPAddressInformationCollection.cs
- WebPartsPersonalizationAuthorization.cs
- ExtensionQuery.cs
- SizeChangedEventArgs.cs
- Page.cs
- IPPacketInformation.cs
- ImageField.cs
- WizardPanel.cs
- StatusBarPanel.cs
- WindowInteractionStateTracker.cs
- StateDesigner.LayoutSelectionGlyph.cs
- WaitHandle.cs
- Material.cs
- ClickablePoint.cs
- HttpHandlerAction.cs
- BitmapEffectCollection.cs
- RelOps.cs
- COSERVERINFO.cs
- ReadOnlyNameValueCollection.cs
- ByteKeyFrameCollection.cs
- DefaultTextStoreTextComposition.cs
- ListBindableAttribute.cs
- QilList.cs
- ReflectPropertyDescriptor.cs
- OperatingSystem.cs
- CapabilitiesState.cs
- ValidationEventArgs.cs
- XmlWriterDelegator.cs
- RegisteredDisposeScript.cs
- PackagePartCollection.cs
- VarInfo.cs
- PointCollection.cs
- ControlPropertyNameConverter.cs
- RootDesignerSerializerAttribute.cs
- RequiredFieldValidator.cs
- OverflowException.cs
- SecureConversationDriver.cs
- SqlFileStream.cs
- ValidatingPropertiesEventArgs.cs
- WorkflowServiceAttributes.cs
- KeyValueConfigurationElement.cs
- TypedRowHandler.cs
- WorkflowNamespace.cs
- CompilationLock.cs
- IChannel.cs
- CodeIndexerExpression.cs
- LogEntryHeaderSerializer.cs
- DbMetaDataColumnNames.cs