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
- TemplateModeChangedEventArgs.cs
- SqlXmlStorage.cs
- HttpCachePolicyElement.cs
- TypeHelper.cs
- XmlAttributes.cs
- ShapingEngine.cs
- CodeTypeMember.cs
- BindingBase.cs
- CodeAssignStatement.cs
- AutomationEvent.cs
- DataGridColumnReorderingEventArgs.cs
- CSharpCodeProvider.cs
- ColorDialog.cs
- AdapterDictionary.cs
- CompilerScopeManager.cs
- ColorConverter.cs
- DateTimeValueSerializerContext.cs
- FieldMetadata.cs
- ChildDocumentBlock.cs
- RelationHandler.cs
- BridgeDataReader.cs
- CatalogPartCollection.cs
- EnumMember.cs
- ListItemConverter.cs
- WizardPanelChangingEventArgs.cs
- WorkflowMarkupSerializer.cs
- NumericUpDownAccelerationCollection.cs
- ImpersonationContext.cs
- PathFigure.cs
- Panel.cs
- HwndSubclass.cs
- TraceSource.cs
- TdsParserSessionPool.cs
- cache.cs
- XmlSchemaObjectTable.cs
- LocalizeDesigner.cs
- DesignTimeParseData.cs
- DbModificationClause.cs
- AsymmetricSecurityProtocolFactory.cs
- ToolStripMenuItemDesigner.cs
- SafeLocalAllocation.cs
- Light.cs
- DisplayMemberTemplateSelector.cs
- MsmqIntegrationChannelListener.cs
- ErrorFormatter.cs
- CheckableControlBaseAdapter.cs
- InstanceCreationEditor.cs
- BasicHttpBinding.cs
- DataSetFieldSchema.cs
- Tile.cs
- SessionState.cs
- GridViewPageEventArgs.cs
- ContractType.cs
- LinearKeyFrames.cs
- TextSpan.cs
- ConfigurationValues.cs
- HtmlElementCollection.cs
- ContainerAction.cs
- SynchronizedDispatch.cs
- DataObjectAttribute.cs
- NavigationService.cs
- UnsafeNativeMethods.cs
- ReadOnlyDataSourceView.cs
- ColumnMapVisitor.cs
- SyndicationFeedFormatter.cs
- SpecularMaterial.cs
- Annotation.cs
- HyperLinkDesigner.cs
- FloatMinMaxAggregationOperator.cs
- ImageDrawing.cs
- DataSourceCache.cs
- DbProviderSpecificTypePropertyAttribute.cs
- MutexSecurity.cs
- AudioException.cs
- PlatformCulture.cs
- Canvas.cs
- ColumnWidthChangedEvent.cs
- PrintDocument.cs
- GifBitmapEncoder.cs
- MasterPageParser.cs
- serverconfig.cs
- RequestCacheManager.cs
- SqlDataSourceDesigner.cs
- IteratorFilter.cs
- XmlQueryStaticData.cs
- NumberFormatInfo.cs
- SapiInterop.cs
- FloaterParaClient.cs
- Triplet.cs
- StylusButtonEventArgs.cs
- AnimationClock.cs
- DefinitionBase.cs
- ReliableMessagingVersion.cs
- StateManagedCollection.cs
- XmlnsDictionary.cs
- AspNetSynchronizationContext.cs
- KeyConverter.cs
- FirstQueryOperator.cs
- QueryMath.cs
- ComplexBindingPropertiesAttribute.cs