Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- ElementUtil.cs
- TypeValidationEventArgs.cs
- AppSettingsExpressionBuilder.cs
- PipeStream.cs
- MatchSingleFxEngineOpcode.cs
- TableHeaderCell.cs
- JsonReader.cs
- Label.cs
- ConsumerConnectionPointCollection.cs
- HwndSourceParameters.cs
- ListControl.cs
- SpecialNameAttribute.cs
- AmbientLight.cs
- FontFamilyValueSerializer.cs
- WhiteSpaceTrimStringConverter.cs
- ResolveCriteria11.cs
- ForeignConstraint.cs
- TreeViewImageIndexConverter.cs
- GZipStream.cs
- JapaneseLunisolarCalendar.cs
- CaseInsensitiveComparer.cs
- XamlGridLengthSerializer.cs
- ChangePassword.cs
- NameNode.cs
- PhysicalFontFamily.cs
- JoinGraph.cs
- LocalFileSettingsProvider.cs
- ResXResourceWriter.cs
- NodeCounter.cs
- ErrorInfoXmlDocument.cs
- EmptyEnumerator.cs
- InvokePatternIdentifiers.cs
- FixedTextContainer.cs
- VirtualPathUtility.cs
- ApplicationServiceManager.cs
- ComboBoxRenderer.cs
- TableRowGroup.cs
- FrameworkElement.cs
- GetKeyedHashRequest.cs
- SByte.cs
- FileSystemInfo.cs
- FormView.cs
- CompressStream.cs
- BitStack.cs
- MULTI_QI.cs
- DbConnectionHelper.cs
- ImageDrawing.cs
- XmlSerializationReader.cs
- Stack.cs
- UnsafeNativeMethods.cs
- ResourceReferenceExpression.cs
- CounterCreationDataCollection.cs
- SQLDecimalStorage.cs
- LeftCellWrapper.cs
- ListViewSortEventArgs.cs
- Material.cs
- StreamWithDictionary.cs
- DataColumnMapping.cs
- DrawListViewSubItemEventArgs.cs
- HtmlTableRow.cs
- AutomationElementCollection.cs
- _NegotiateClient.cs
- HuffModule.cs
- ResourceManagerWrapper.cs
- ArrayExtension.cs
- ContentWrapperAttribute.cs
- QilTargetType.cs
- XmlSchemaInclude.cs
- Int32AnimationUsingKeyFrames.cs
- TextTrailingWordEllipsis.cs
- X509ServiceCertificateAuthenticationElement.cs
- DataListComponentEditor.cs
- DataGridViewCellMouseEventArgs.cs
- CaseExpr.cs
- MimeAnyImporter.cs
- SizeChangedInfo.cs
- EntityCodeGenerator.cs
- QilReference.cs
- ClientConfigurationHost.cs
- mactripleDES.cs
- ChangeProcessor.cs
- UrlAuthorizationModule.cs
- MiniCustomAttributeInfo.cs
- DbCommandTree.cs
- TdsParserSafeHandles.cs
- SplayTreeNode.cs
- HtmlAnchor.cs
- SiteMapSection.cs
- CapacityStreamGeometryContext.cs
- SoapAttributes.cs
- HttpModulesSection.cs
- formatstringdialog.cs
- LongCountAggregationOperator.cs
- RepeatEnumerable.cs
- Size.cs
- DeferredTextReference.cs
- HostingPreferredMapPath.cs
- ScaleTransform3D.cs
- RenderingBiasValidation.cs
- EqualityComparer.cs