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
- RSAOAEPKeyExchangeFormatter.cs
- MultiplexingDispatchMessageFormatter.cs
- ReaderWriterLock.cs
- EditorPartCollection.cs
- ServiceOperationViewControl.cs
- ELinqQueryState.cs
- TableLayoutPanelCellPosition.cs
- EntityDataSourceSelectingEventArgs.cs
- InnerItemCollectionView.cs
- TriggerCollection.cs
- AdditionalEntityFunctions.cs
- RecordsAffectedEventArgs.cs
- OrderPreservingPipeliningMergeHelper.cs
- TextFormattingConverter.cs
- RequestContext.cs
- dataprotectionpermission.cs
- _ConnectStream.cs
- PenThreadPool.cs
- SecurityTokenAuthenticator.cs
- BrowserDefinition.cs
- WebHttpBehavior.cs
- NodeFunctions.cs
- ClientData.cs
- HandlerBase.cs
- SingleAnimationUsingKeyFrames.cs
- ConfigurationSchemaErrors.cs
- GenericWebPart.cs
- DbProviderFactories.cs
- Currency.cs
- httpserverutility.cs
- ShutDownListener.cs
- GPPOINT.cs
- HttpCacheVary.cs
- DelegateSerializationHolder.cs
- QuadraticBezierSegment.cs
- AuthenticatedStream.cs
- ResourcePropertyMemberCodeDomSerializer.cs
- ThreadStateException.cs
- XamlPointCollectionSerializer.cs
- ContextDataSourceContextData.cs
- XmlNotation.cs
- Codec.cs
- Label.cs
- DataBoundControlActionList.cs
- HttpCapabilitiesSectionHandler.cs
- XmlHierarchyData.cs
- MediaPlayerState.cs
- XsltArgumentList.cs
- ValidationError.cs
- BitmapEffectRenderDataResource.cs
- TextRangeEdit.cs
- EventData.cs
- Stroke2.cs
- Double.cs
- HttpRuntime.cs
- RootBuilder.cs
- AuthenticateEventArgs.cs
- ToolStripItemCollection.cs
- ShapeTypeface.cs
- RedBlackList.cs
- ResourceManager.cs
- WSSecurityOneDotZeroReceiveSecurityHeader.cs
- SQLRoleProvider.cs
- DeleteHelper.cs
- ToolStripArrowRenderEventArgs.cs
- MethodBody.cs
- InputScope.cs
- CommonObjectSecurity.cs
- NativeMethods.cs
- PageSetupDialog.cs
- ReflectionHelper.cs
- CodeSubDirectoriesCollection.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- NativeRecognizer.cs
- LogRecordSequence.cs
- MouseGestureValueSerializer.cs
- TraceData.cs
- Clipboard.cs
- ConnectionString.cs
- HtmlTextArea.cs
- PagesChangedEventArgs.cs
- ApplicationHost.cs
- OdbcDataReader.cs
- HttpResponse.cs
- BitVector32.cs
- CharStorage.cs
- CurrencyManager.cs
- ArraySet.cs
- GuidelineSet.cs
- AssemblyCollection.cs
- SoapAttributes.cs
- XmlWriter.cs
- ArrayList.cs
- GeneralTransform3DGroup.cs
- ObfuscationAttribute.cs
- CodePrimitiveExpression.cs
- ThemeableAttribute.cs
- ProcessInputEventArgs.cs
- ClonableStack.cs
- ProcessThreadCollection.cs