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
- Semaphore.cs
- Command.cs
- HttpCapabilitiesBase.cs
- DecoderFallbackWithFailureFlag.cs
- IndicCharClassifier.cs
- ExclusiveHandleList.cs
- RedirectionProxy.cs
- OleDbEnumerator.cs
- PenLineJoinValidation.cs
- Deserializer.cs
- ContentFilePart.cs
- SimpleFileLog.cs
- WeakReferenceKey.cs
- UiaCoreTypesApi.cs
- FileDataSourceCache.cs
- SourceFileInfo.cs
- QuaternionAnimation.cs
- XPathAncestorIterator.cs
- StateElement.cs
- SiteMapProvider.cs
- RectangleConverter.cs
- DetailsViewRowCollection.cs
- TableLayoutPanel.cs
- InstanceView.cs
- ActivityExecutionContextCollection.cs
- SoundPlayer.cs
- SwitchAttribute.cs
- EntityViewGenerationConstants.cs
- FreezableOperations.cs
- AnnotationHelper.cs
- XmlDocumentType.cs
- Models.cs
- QilXmlWriter.cs
- ActivityTypeCodeDomSerializer.cs
- URI.cs
- SoapClientMessage.cs
- OdbcConnectionFactory.cs
- DSASignatureDeformatter.cs
- OletxTransactionHeader.cs
- PathGradientBrush.cs
- ExpressionPrefixAttribute.cs
- EventPrivateKey.cs
- EntityClassGenerator.cs
- HtmlElement.cs
- MissingSatelliteAssemblyException.cs
- DrawListViewColumnHeaderEventArgs.cs
- DataGridItemEventArgs.cs
- HuffmanTree.cs
- NotImplementedException.cs
- CommonDialog.cs
- SplitContainer.cs
- NGCSerializationManager.cs
- TraversalRequest.cs
- NamespaceCollection.cs
- OperationResponse.cs
- DbParameterCollectionHelper.cs
- CFGGrammar.cs
- ContainsRowNumberChecker.cs
- AuthStoreRoleProvider.cs
- DataGridViewCellCancelEventArgs.cs
- XmlSchemaValidator.cs
- OpenTypeLayoutCache.cs
- SQLString.cs
- SiblingIterators.cs
- OrthographicCamera.cs
- XmlSecureResolver.cs
- VirtualizingStackPanel.cs
- PngBitmapEncoder.cs
- EntityParameterCollection.cs
- QilExpression.cs
- TreeChangeInfo.cs
- AppDomainManager.cs
- AssertSection.cs
- FunctionDescription.cs
- ObjectCache.cs
- TextBoxLine.cs
- RawKeyboardInputReport.cs
- KeyboardNavigation.cs
- WriteTimeStream.cs
- Transform.cs
- GridErrorDlg.cs
- DateTimeStorage.cs
- TdsEnums.cs
- ListViewHitTestInfo.cs
- IEnumerable.cs
- RijndaelManaged.cs
- ExistsInCollection.cs
- WebPartPersonalization.cs
- XmlEntity.cs
- CatalogZoneBase.cs
- DataGridViewTextBoxColumn.cs
- HttpCapabilitiesSectionHandler.cs
- Vector3DConverter.cs
- ProgressBar.cs
- CriticalHandle.cs
- TextModifierScope.cs
- TemplatedMailWebEventProvider.cs
- ErrorRuntimeConfig.cs
- WindowsTreeView.cs
- ContractAdapter.cs