Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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(); } } } // 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
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AttachInfo.cs
- ResourceReferenceExpressionConverter.cs
- UserControlDesigner.cs
- Funcletizer.cs
- HandlerBase.cs
- XPathDocumentNavigator.cs
- UnsignedPublishLicense.cs
- ByteBufferPool.cs
- InvokeWebService.cs
- SiteMapSection.cs
- UnauthorizedWebPart.cs
- WindowsEditBox.cs
- ContentTextAutomationPeer.cs
- columnmapkeybuilder.cs
- TypeElement.cs
- LazyInitializer.cs
- MappingSource.cs
- WebResponse.cs
- MessagingActivityHelper.cs
- AccessedThroughPropertyAttribute.cs
- CloseCryptoHandleRequest.cs
- JsonReaderDelegator.cs
- RouteUrlExpressionBuilder.cs
- PointLightBase.cs
- FeatureAttribute.cs
- TranslateTransform.cs
- Page.cs
- ScrollBarRenderer.cs
- JobPageOrder.cs
- XmlObjectSerializer.cs
- Point3DAnimation.cs
- LocationFactory.cs
- TraceFilter.cs
- ToolBarButtonClickEvent.cs
- MeshGeometry3D.cs
- EntityDescriptor.cs
- PropertyInfoSet.cs
- _TLSstream.cs
- SamlSecurityTokenAuthenticator.cs
- EntityUtil.cs
- ItemType.cs
- LineVisual.cs
- SortDescriptionCollection.cs
- LambdaCompiler.Generated.cs
- ISSmlParser.cs
- WsdlBuildProvider.cs
- PointConverter.cs
- ConfigUtil.cs
- ExceptionUtil.cs
- UnsafeNativeMethods.cs
- StoreItemCollection.cs
- TemplateBamlTreeBuilder.cs
- ArglessEventHandlerProxy.cs
- ToolStripItemCollection.cs
- BitmapEffect.cs
- WebCategoryAttribute.cs
- PreviousTrackingServiceAttribute.cs
- _SingleItemRequestCache.cs
- ToolboxItem.cs
- CultureInfoConverter.cs
- EncoderBestFitFallback.cs
- MinMaxParagraphWidth.cs
- WebPart.cs
- XamlTypeWithExplicitNamespace.cs
- MethodBody.cs
- BooleanSwitch.cs
- AmbientProperties.cs
- DebugView.cs
- ExtendedProtectionPolicy.cs
- SqlDesignerDataSourceView.cs
- EnumerationRangeValidationUtil.cs
- PassportAuthenticationEventArgs.cs
- TextRangeBase.cs
- AxHost.cs
- Context.cs
- DayRenderEvent.cs
- HtmlValidationSummaryAdapter.cs
- WebUtil.cs
- CompilationSection.cs
- Scheduler.cs
- XPathCompileException.cs
- Guid.cs
- Schema.cs
- ViewEventArgs.cs
- AudioFormatConverter.cs
- AuthenticateEventArgs.cs
- CasesDictionary.cs
- ObjectDataSourceSelectingEventArgs.cs
- StylusPointPropertyUnit.cs
- WebPartConnectionCollection.cs
- WindowsToolbar.cs
- Point4DConverter.cs
- ServiceRouteHandler.cs
- Pair.cs
- CacheDependency.cs
- CheckBoxStandardAdapter.cs
- BooleanToVisibilityConverter.cs
- XmlAnyElementAttributes.cs
- Mutex.cs
- FixedSOMPageConstructor.cs