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
- KoreanCalendar.cs
- MouseCaptureWithinProperty.cs
- EdgeProfileValidation.cs
- OleDbFactory.cs
- _ConnectionGroup.cs
- MissingSatelliteAssemblyException.cs
- SiteMapDesignerDataSourceView.cs
- KeyTimeConverter.cs
- EdmTypeAttribute.cs
- SystemSounds.cs
- HandleCollector.cs
- CTreeGenerator.cs
- Rotation3D.cs
- SqlXmlStorage.cs
- WebPartZoneCollection.cs
- SigningProgress.cs
- _CacheStreams.cs
- WizardPanelChangingEventArgs.cs
- SamlDelegatingWriter.cs
- NetStream.cs
- GlyphElement.cs
- ICspAsymmetricAlgorithm.cs
- OleDbDataReader.cs
- StoreAnnotationsMap.cs
- BuildManager.cs
- XmlSchemas.cs
- AccessViolationException.cs
- SoapHttpTransportImporter.cs
- StylusPointPropertyId.cs
- OperatingSystem.cs
- HeaderCollection.cs
- XmlSchemaProviderAttribute.cs
- DataSourceXmlElementAttribute.cs
- DataListItemEventArgs.cs
- dsa.cs
- PropertyRef.cs
- BrowserDefinition.cs
- ApplyTemplatesAction.cs
- WebPart.cs
- ObjectPersistData.cs
- GeneralTransform3DTo2DTo3D.cs
- SchemaNotation.cs
- TiffBitmapEncoder.cs
- PlatformCulture.cs
- WS2007FederationHttpBindingElement.cs
- HttpResponseHeader.cs
- DeobfuscatingStream.cs
- Tool.cs
- Documentation.cs
- OrCondition.cs
- VariantWrapper.cs
- NativeRightsManagementAPIsStructures.cs
- WCFModelStrings.Designer.cs
- ToolStripContainer.cs
- XPathNavigatorKeyComparer.cs
- FilteredDataSetHelper.cs
- Component.cs
- WindowCollection.cs
- ChannelServices.cs
- StandardOleMarshalObject.cs
- ThrowOnMultipleAssignment.cs
- HttpGetServerProtocol.cs
- TraceUtility.cs
- WhitespaceRuleReader.cs
- IndexedSelectQueryOperator.cs
- Transform.cs
- ApplicationInterop.cs
- SurrogateDataContract.cs
- NativeMethods.cs
- SemaphoreFullException.cs
- ClientOptions.cs
- WebUtil.cs
- SizeF.cs
- FloaterBaseParagraph.cs
- UIElement3D.cs
- CrossContextChannel.cs
- safex509handles.cs
- IssuedTokenServiceCredential.cs
- ProgressiveCrcCalculatingStream.cs
- GridViewSelectEventArgs.cs
- ExternalException.cs
- ProcessModelInfo.cs
- HttpHandlerAction.cs
- SQLInt32.cs
- PersonalizationAdministration.cs
- TextSearch.cs
- UdpDiscoveryEndpointProvider.cs
- EntityDataSourceColumn.cs
- XmlC14NWriter.cs
- UITypeEditor.cs
- NewArray.cs
- DataGridViewCellStyleEditor.cs
- MarkupExtensionParser.cs
- TextCompositionEventArgs.cs
- WebBaseEventKeyComparer.cs
- TemplateBuilder.cs
- ManagementBaseObject.cs
- BuildManager.cs
- SoapFaultCodes.cs
- InvalidAsynchronousStateException.cs