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
- PageHandlerFactory.cs
- FieldDescriptor.cs
- DataServiceProviderMethods.cs
- COSERVERINFO.cs
- DataColumnMapping.cs
- ButtonFieldBase.cs
- PolygonHotSpot.cs
- BamlResourceSerializer.cs
- ApplicationInfo.cs
- InstanceNormalEvent.cs
- XmlSchemaSimpleContentExtension.cs
- PlatformNotSupportedException.cs
- CompilerLocalReference.cs
- OptimizedTemplateContent.cs
- DataRecordInfo.cs
- PrimitiveXmlSerializers.cs
- DSASignatureDeformatter.cs
- DocumentOrderQuery.cs
- PreProcessor.cs
- IndexedGlyphRun.cs
- SliderAutomationPeer.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- OdbcError.cs
- PipeConnection.cs
- SelectionEditingBehavior.cs
- Converter.cs
- StandardCommands.cs
- ContentFilePart.cs
- GeneratedContractType.cs
- PassportAuthentication.cs
- InitializationEventAttribute.cs
- WebControlAdapter.cs
- ScrollItemPattern.cs
- FontInfo.cs
- Suspend.cs
- Automation.cs
- StylusPointPropertyInfoDefaults.cs
- MetafileHeader.cs
- GeometryHitTestResult.cs
- BoundColumn.cs
- XmlIncludeAttribute.cs
- Parser.cs
- Visual3D.cs
- TextEncodedRawTextWriter.cs
- XNodeNavigator.cs
- ReturnType.cs
- WebMessageEncodingElement.cs
- TextServicesProperty.cs
- DetailsViewUpdatedEventArgs.cs
- LineServicesCallbacks.cs
- FusionWrap.cs
- WaitForChangedResult.cs
- ToolStripDropDownItem.cs
- WindowsAltTab.cs
- FormView.cs
- MatrixUtil.cs
- PointAnimationClockResource.cs
- sqlmetadatafactory.cs
- Rectangle.cs
- GridPattern.cs
- _RequestCacheProtocol.cs
- ClockGroup.cs
- EnvelopedSignatureTransform.cs
- DbReferenceCollection.cs
- OdbcConnection.cs
- SqlDataSourceQueryEditorForm.cs
- EditingCommands.cs
- CustomErrorsSection.cs
- WebAdminConfigurationHelper.cs
- RedistVersionInfo.cs
- CommaDelimitedStringAttributeCollectionConverter.cs
- AdCreatedEventArgs.cs
- XmlDataSourceNodeDescriptor.cs
- AuthorizationPolicyTypeElementCollection.cs
- DesignerSerializationVisibilityAttribute.cs
- DateTimeSerializationSection.cs
- MsmqTransportBindingElement.cs
- Operator.cs
- InputBinder.cs
- ExtractedStateEntry.cs
- NavigationExpr.cs
- MSAAEventDispatcher.cs
- Transform3DGroup.cs
- XmlComment.cs
- KeyValuePairs.cs
- KeyInterop.cs
- AttributeConverter.cs
- Msec.cs
- InstanceDataCollectionCollection.cs
- ParserContext.cs
- HttpContextWrapper.cs
- XPathSelectionIterator.cs
- SizeConverter.cs
- BindingExpression.cs
- OutputCacheSection.cs
- TextEndOfParagraph.cs
- WindowsListViewSubItem.cs
- CodeObject.cs
- OdbcParameterCollection.cs
- DateTimeValueSerializerContext.cs