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
- CultureMapper.cs
- NotConverter.cs
- Membership.cs
- EntityDataSourceStatementEditor.cs
- CalendarSelectionChangedEventArgs.cs
- EventsTab.cs
- XmlSchemaNotation.cs
- TypeLibConverter.cs
- PackWebRequestFactory.cs
- EdmRelationshipRoleAttribute.cs
- AutomationPropertyChangedEventArgs.cs
- SmiConnection.cs
- ApplicationSettingsBase.cs
- BufferedWebEventProvider.cs
- HashUtility.cs
- GridEntryCollection.cs
- AssemblyHash.cs
- MatrixAnimationUsingKeyFrames.cs
- TemplateControl.cs
- Cloud.cs
- CorePropertiesFilter.cs
- EdmProviderManifest.cs
- lengthconverter.cs
- ItemCollectionEditor.cs
- WebPartEditorApplyVerb.cs
- EntityDataSourceStatementEditor.cs
- newitemfactory.cs
- ToolStrip.cs
- _Semaphore.cs
- HtmlHistory.cs
- InstanceDescriptor.cs
- WebZone.cs
- ActivityExecutionFilter.cs
- HandlerBase.cs
- MenuItemCollectionEditor.cs
- _Events.cs
- VerificationException.cs
- UndirectedGraph.cs
- FontUnit.cs
- ConnectionConsumerAttribute.cs
- FixedSOMContainer.cs
- UnionCqlBlock.cs
- SqlConnection.cs
- WindowsGraphics.cs
- ClonableStack.cs
- EntryIndex.cs
- WebServiceParameterData.cs
- ArrayConverter.cs
- TemplateField.cs
- TableStyle.cs
- UIAgentMonitorHandle.cs
- EntitySqlQueryCacheEntry.cs
- CustomAttributeFormatException.cs
- RepeatInfo.cs
- CommandEventArgs.cs
- ClientScriptManagerWrapper.cs
- counter.cs
- SelectionEditor.cs
- Encoder.cs
- AsyncDataRequest.cs
- InstalledVoice.cs
- TransformerTypeCollection.cs
- ParameterReplacerVisitor.cs
- LineSegment.cs
- DbDeleteCommandTree.cs
- WindowsListViewGroupSubsetLink.cs
- RepeatBehavior.cs
- StrokeNodeOperations2.cs
- FixedDocumentSequencePaginator.cs
- HttpCacheParams.cs
- PngBitmapEncoder.cs
- MenuItemBinding.cs
- CommunicationObjectFaultedException.cs
- WsdlBuildProvider.cs
- ObjectListCommand.cs
- EntityContainerRelationshipSet.cs
- ContentIterators.cs
- XMLDiffLoader.cs
- Lease.cs
- TransformedBitmap.cs
- BorderGapMaskConverter.cs
- smtppermission.cs
- EmptyControlCollection.cs
- RichTextBox.cs
- UnicastIPAddressInformationCollection.cs
- diagnosticsswitches.cs
- PolicyLevel.cs
- ObjectSecurity.cs
- SimpleBitVector32.cs
- PackageDigitalSignature.cs
- UtilityExtension.cs
- RevocationPoint.cs
- DuplicateWaitObjectException.cs
- XsdCachingReader.cs
- DataRowChangeEvent.cs
- LookupTables.cs
- MenuAdapter.cs
- TypeGenericEnumerableViewSchema.cs
- CorePropertiesFilter.cs
- ExpressionEvaluator.cs