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
- Inline.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- LookupNode.cs
- SqlRetyper.cs
- CollectionChange.cs
- CommonXSendMessage.cs
- ErrorWrapper.cs
- NumericUpDown.cs
- GenericIdentity.cs
- SplashScreen.cs
- DbTransaction.cs
- Message.cs
- ReferencedAssembly.cs
- ObjectDataSourceView.cs
- StylusPointPropertyInfo.cs
- SendMessageRecord.cs
- InkCanvasAutomationPeer.cs
- Utils.cs
- EndGetFileNameFromUserRequest.cs
- GlobalAllocSafeHandle.cs
- XPathException.cs
- FrameworkPropertyMetadata.cs
- ControlBuilder.cs
- FlowNode.cs
- Size3DConverter.cs
- HttpDictionary.cs
- XmlDocumentType.cs
- CodeMemberProperty.cs
- BrowserCapabilitiesCodeGenerator.cs
- SqlUdtInfo.cs
- NullableIntSumAggregationOperator.cs
- XPathSelfQuery.cs
- MultiTrigger.cs
- TextRangeAdaptor.cs
- String.cs
- RegexGroupCollection.cs
- BCLDebug.cs
- Debug.cs
- HtmlWindowCollection.cs
- QueryActivatableWorkflowsCommand.cs
- ChangeTracker.cs
- SpotLight.cs
- WinFormsUtils.cs
- DeploymentExceptionMapper.cs
- Model3DCollection.cs
- ManifestResourceInfo.cs
- TextSegment.cs
- SmiGettersStream.cs
- ThreadExceptionDialog.cs
- IIS7WorkerRequest.cs
- HttpResponseInternalWrapper.cs
- UInt16.cs
- InvokeWebService.cs
- BatchServiceHost.cs
- DoubleAnimation.cs
- CodeCatchClauseCollection.cs
- XmlFormatExtensionPointAttribute.cs
- StorageRoot.cs
- lengthconverter.cs
- GuidelineCollection.cs
- PagesSection.cs
- IISMapPath.cs
- ServicePointManager.cs
- SqlCaseSimplifier.cs
- BrowserCapabilitiesCompiler.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- Registry.cs
- ConnectionOrientedTransportChannelFactory.cs
- XmlName.cs
- JapaneseLunisolarCalendar.cs
- PhysicalOps.cs
- SessionStateUtil.cs
- QueryGeneratorBase.cs
- DataGridViewEditingControlShowingEventArgs.cs
- ConfigurationException.cs
- PrintPreviewControl.cs
- TokenBasedSet.cs
- InternalEnumValidatorAttribute.cs
- ConstructorNeedsTagAttribute.cs
- ButtonRenderer.cs
- DataBindingHandlerAttribute.cs
- Compensate.cs
- InputReferenceExpression.cs
- LocalFileSettingsProvider.cs
- SqlProviderManifest.cs
- StreamUpgradeBindingElement.cs
- SizeChangedEventArgs.cs
- XmlWriterTraceListener.cs
- MimePart.cs
- DocumentApplicationJournalEntry.cs
- PersonalizationAdministration.cs
- CollectionConverter.cs
- CodeIndexerExpression.cs
- X509UI.cs
- BoolLiteral.cs
- AuthenticationManager.cs
- DocumentAutomationPeer.cs
- PersonalizationStateInfo.cs
- VarRefManager.cs
- handlecollector.cs