Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / DesignOnlyAttribute.cs / 1305376 / 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
- initElementDictionary.cs
- SettingsPropertyValueCollection.cs
- HostedNamedPipeTransportManager.cs
- NeutralResourcesLanguageAttribute.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- SecUtil.cs
- StylusEventArgs.cs
- RequestStatusBarUpdateEventArgs.cs
- SemanticResolver.cs
- AssemblyResourceLoader.cs
- DynamicPropertyReader.cs
- ResetableIterator.cs
- ImageDrawing.cs
- ComponentCommands.cs
- DynamicResourceExtensionConverter.cs
- IMembershipProvider.cs
- SqlDependencyUtils.cs
- WebPartUserCapability.cs
- ListViewGroupCollectionEditor.cs
- FilteredXmlReader.cs
- DesignerObject.cs
- TextCompositionManager.cs
- ConfigurationErrorsException.cs
- XmlHierarchicalEnumerable.cs
- PersistChildrenAttribute.cs
- DataGridViewCellStyle.cs
- Timer.cs
- ProfilePropertySettingsCollection.cs
- TextBox.cs
- ResumeStoryboard.cs
- EventProvider.cs
- OleDbError.cs
- CompilerErrorCollection.cs
- TableRow.cs
- DecoderFallbackWithFailureFlag.cs
- _Win32.cs
- PipeStream.cs
- SelectionPattern.cs
- InputScopeNameConverter.cs
- TileModeValidation.cs
- ResourceProperty.cs
- arc.cs
- ProfileParameter.cs
- CompensatableTransactionScopeActivityDesigner.cs
- SystemTcpStatistics.cs
- StaticFileHandler.cs
- MenuAdapter.cs
- WinEventWrap.cs
- ToolStripHighContrastRenderer.cs
- InvalidEnumArgumentException.cs
- StaticSiteMapProvider.cs
- LightweightCodeGenerator.cs
- BrowserCapabilitiesCompiler.cs
- TreeNodeCollectionEditor.cs
- BlurEffect.cs
- ListCollectionView.cs
- Types.cs
- BroadcastEventHelper.cs
- ColorConverter.cs
- HTMLTextWriter.cs
- PrefixQName.cs
- MemberCollection.cs
- PointAnimationUsingKeyFrames.cs
- BamlLocalizationDictionary.cs
- GZipStream.cs
- RectangleConverter.cs
- DeferredSelectedIndexReference.cs
- DataViewListener.cs
- DockingAttribute.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- ConnectionPoint.cs
- CaseExpr.cs
- ByteAnimationBase.cs
- UrlAuthorizationModule.cs
- HttpCookie.cs
- X509ClientCertificateAuthentication.cs
- Quad.cs
- Int64AnimationUsingKeyFrames.cs
- TemplateField.cs
- SrgsRulesCollection.cs
- ContextMarshalException.cs
- SafeArrayRankMismatchException.cs
- ObservableCollectionDefaultValueFactory.cs
- VisualTreeHelper.cs
- httpapplicationstate.cs
- UpDownBase.cs
- PropertyEntry.cs
- Clock.cs
- DictionaryKeyPropertyAttribute.cs
- ArrangedElementCollection.cs
- DoubleConverter.cs
- SHA1.cs
- TypeGeneratedEventArgs.cs
- CheckBoxBaseAdapter.cs
- IntSecurity.cs
- GetImportedCardRequest.cs
- SmiSettersStream.cs
- ProviderBase.cs
- TemplatedWizardStep.cs
- OrderedDictionary.cs