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
- GridViewUpdatedEventArgs.cs
- ResXFileRef.cs
- DbConvert.cs
- TableLayout.cs
- FillErrorEventArgs.cs
- InstanceLockQueryResult.cs
- errorpatternmatcher.cs
- XslTransform.cs
- ToolStripItem.cs
- EnvironmentPermission.cs
- _FtpControlStream.cs
- DbParameterCollectionHelper.cs
- GridViewSelectEventArgs.cs
- PreparingEnlistment.cs
- HMACSHA384.cs
- SemanticAnalyzer.cs
- OleDbParameter.cs
- KeyManager.cs
- Pen.cs
- SqlClientMetaDataCollectionNames.cs
- EntityDesignerDataSourceView.cs
- ProcessStartInfo.cs
- HtmlLink.cs
- DataGridItemEventArgs.cs
- ListMarkerSourceInfo.cs
- XmlNamespaceMappingCollection.cs
- XmlSchemaComplexContentExtension.cs
- DBAsyncResult.cs
- Selection.cs
- ToolStripSystemRenderer.cs
- AssemblyBuilder.cs
- TransformedBitmap.cs
- SmiRecordBuffer.cs
- GridViewHeaderRowPresenter.cs
- ObjectDataSourceFilteringEventArgs.cs
- PreservationFileReader.cs
- XmlSchemaSimpleTypeUnion.cs
- ExpressionBindingsDialog.cs
- JsonXmlDataContract.cs
- UInt16Storage.cs
- TranslateTransform.cs
- Debug.cs
- MenuScrollingVisibilityConverter.cs
- XmlNamespaceManager.cs
- DescendantQuery.cs
- CollectionView.cs
- UnhandledExceptionEventArgs.cs
- InternalControlCollection.cs
- DocumentReferenceCollection.cs
- LocatorPartList.cs
- GeneralTransform3DGroup.cs
- Encoder.cs
- TreeNodeBindingCollection.cs
- FixedTextBuilder.cs
- HuffCodec.cs
- ScriptControlDescriptor.cs
- WmlPageAdapter.cs
- SignedXml.cs
- SoapAttributeAttribute.cs
- RefreshPropertiesAttribute.cs
- ProfileModule.cs
- CompositionTarget.cs
- FlowThrottle.cs
- Misc.cs
- DataGridViewCheckBoxColumn.cs
- DayRenderEvent.cs
- ResourceReader.cs
- PerspectiveCamera.cs
- HelpInfo.cs
- InputScopeManager.cs
- PixelFormatConverter.cs
- StagingAreaInputItem.cs
- SchemaManager.cs
- HebrewCalendar.cs
- Base64Encoding.cs
- CursorConverter.cs
- querybuilder.cs
- XPathDocumentNavigator.cs
- LayoutExceptionEventArgs.cs
- NumericUpDown.cs
- ToolStripProgressBar.cs
- AuthenticationSection.cs
- XmlSchemaComplexType.cs
- _ContextAwareResult.cs
- ConfigurationManager.cs
- DecimalAnimation.cs
- LambdaValue.cs
- UnsafeNativeMethods.cs
- OperationContractGenerationContext.cs
- Label.cs
- GridViewRowCollection.cs
- EmissiveMaterial.cs
- AbsoluteQuery.cs
- HtmlElementCollection.cs
- cookieexception.cs
- ResourceDescriptionAttribute.cs
- PropertyGridCommands.cs
- SqlConnectionHelper.cs
- GroupQuery.cs
- SafeProcessHandle.cs