Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RelatedImageListAttribute.cs
- CultureInfo.cs
- ColorAnimation.cs
- ForeignKeyFactory.cs
- EdmItemError.cs
- WinEventHandler.cs
- TypeLibConverter.cs
- QilChoice.cs
- CryptoProvider.cs
- RootBrowserWindowProxy.cs
- OdbcUtils.cs
- TextEditorCopyPaste.cs
- TabletCollection.cs
- PageClientProxyGenerator.cs
- ApplicationContext.cs
- Transform3DCollection.cs
- CursorConverter.cs
- TcpDuplicateContext.cs
- CssClassPropertyAttribute.cs
- ParameterToken.cs
- OrderedDictionaryStateHelper.cs
- EndPoint.cs
- UserControlCodeDomTreeGenerator.cs
- EventlogProvider.cs
- PathGeometry.cs
- DataGridViewButtonCell.cs
- Helpers.cs
- CheckBox.cs
- BaseUriWithWildcard.cs
- EventDescriptorCollection.cs
- NullableIntSumAggregationOperator.cs
- Vector.cs
- ToolStripDropDownClosingEventArgs.cs
- WebResponse.cs
- TypedElement.cs
- CodeAssignStatement.cs
- ButtonFieldBase.cs
- DoubleConverter.cs
- ListViewItem.cs
- RectKeyFrameCollection.cs
- PathStreamGeometryContext.cs
- ServiceHttpModule.cs
- Vector.cs
- DataServiceQueryProvider.cs
- MeasureData.cs
- ActiveDocumentEvent.cs
- _LazyAsyncResult.cs
- FileInfo.cs
- PartialToken.cs
- TableParagraph.cs
- RectConverter.cs
- RSAOAEPKeyExchangeDeformatter.cs
- XmlSchemaDocumentation.cs
- XmlCustomFormatter.cs
- ControlCollection.cs
- HelloMessage11.cs
- FormsAuthenticationConfiguration.cs
- InfoCardRSAPKCS1SignatureFormatter.cs
- WebBrowserNavigatingEventHandler.cs
- Missing.cs
- SizeConverter.cs
- ShutDownListener.cs
- DataGridViewColumn.cs
- JsonReader.cs
- StrokeSerializer.cs
- DataSourceControl.cs
- DefaultValidator.cs
- MarkupExtensionParser.cs
- DocumentPageView.cs
- SourceFileInfo.cs
- WindowsToolbar.cs
- XomlCompilerHelpers.cs
- QueryResponse.cs
- XmlTextReaderImpl.cs
- LightweightEntityWrapper.cs
- CodeDefaultValueExpression.cs
- EventWaitHandleSecurity.cs
- CollectionChangedEventManager.cs
- DataSysAttribute.cs
- sqlser.cs
- CuspData.cs
- DataFieldCollectionEditor.cs
- DataObjectPastingEventArgs.cs
- TextRunCacheImp.cs
- Invariant.cs
- SafeHandles.cs
- TabItemAutomationPeer.cs
- ContentFileHelper.cs
- BitmapImage.cs
- SimpleHandlerBuildProvider.cs
- HwndProxyElementProvider.cs
- TdsEnums.cs
- MinimizableAttributeTypeConverter.cs
- EntityDesignerBuildProvider.cs
- PointCollectionConverter.cs
- MatcherBuilder.cs
- DesignTimeParseData.cs
- XmlDictionaryString.cs
- ConversionContext.cs
- SnapLine.cs