Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- HttpCacheVaryByContentEncodings.cs
- AliasedExpr.cs
- CheckBoxDesigner.cs
- XmlNavigatorFilter.cs
- TypeInitializationException.cs
- RouteItem.cs
- DynamicDocumentPaginator.cs
- Convert.cs
- CapabilitiesPattern.cs
- IteratorFilter.cs
- DesignerAttribute.cs
- XmlRootAttribute.cs
- JapaneseCalendar.cs
- ICollection.cs
- CapabilitiesSection.cs
- TargetControlTypeCache.cs
- ConnectionManagementSection.cs
- KeyedCollection.cs
- ObjectIDGenerator.cs
- LambdaCompiler.Expressions.cs
- XhtmlConformanceSection.cs
- PreProcessInputEventArgs.cs
- HtmlTextArea.cs
- BinHexEncoder.cs
- SchemaImporterExtensionElement.cs
- XmlStreamNodeWriter.cs
- DataGridViewColumnHeaderCell.cs
- CodeRemoveEventStatement.cs
- PointConverter.cs
- ErrorInfoXmlDocument.cs
- IsolatedStorageFilePermission.cs
- Root.cs
- ToolStripLocationCancelEventArgs.cs
- ProfilePropertySettingsCollection.cs
- RoleGroupCollection.cs
- ParseElement.cs
- Base64Encoder.cs
- ProfileService.cs
- PrinterSettings.cs
- ConvertBinder.cs
- SequenceQuery.cs
- DoubleAnimation.cs
- And.cs
- PartitionerQueryOperator.cs
- TrackingStringDictionary.cs
- ScrollProperties.cs
- BamlTreeMap.cs
- Point3D.cs
- XhtmlBasicPanelAdapter.cs
- If.cs
- DbConnectionOptions.cs
- TagPrefixInfo.cs
- RuleProcessor.cs
- DataGridSortingEventArgs.cs
- HtmlSelect.cs
- PropertyEntry.cs
- GridViewSelectEventArgs.cs
- InvalidOperationException.cs
- ManagementDateTime.cs
- Int32Rect.cs
- PrintDialog.cs
- InternalSafeNativeMethods.cs
- ObjectContext.cs
- ContainerAction.cs
- RijndaelCryptoServiceProvider.cs
- DataGridViewColumnHeaderCell.cs
- TextParaClient.cs
- BindingSource.cs
- TextRenderer.cs
- BuildDependencySet.cs
- PostBackTrigger.cs
- CommentEmitter.cs
- RegexMatchCollection.cs
- TextSearch.cs
- TableCell.cs
- MatrixTransform.cs
- StaticFileHandler.cs
- BufferAllocator.cs
- ApplicationServiceManager.cs
- CreateCardRequest.cs
- TrustManagerPromptUI.cs
- RowCache.cs
- PackWebRequest.cs
- StyleSelector.cs
- MultiTrigger.cs
- MimeWriter.cs
- LinkArea.cs
- HMACSHA512.cs
- SkipStoryboardToFill.cs
- XhtmlStyleClass.cs
- BasicBrowserDialog.cs
- dsa.cs
- RelativeSource.cs
- BitmapEffectGroup.cs
- IProvider.cs
- DeferredSelectedIndexReference.cs
- DelimitedListTraceListener.cs
- TextServicesCompartment.cs
- Error.cs
- AdRotator.cs