Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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(); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AppModelKnownContentFactory.cs
- ModelTreeEnumerator.cs
- OneToOneMappingSerializer.cs
- KnownBoxes.cs
- StorageBasedPackageProperties.cs
- LogLogRecordEnumerator.cs
- FormViewCommandEventArgs.cs
- RadioButton.cs
- SqlErrorCollection.cs
- Stack.cs
- QilNode.cs
- ColumnMap.cs
- ComplexTypeEmitter.cs
- AnnotationStore.cs
- UmAlQuraCalendar.cs
- CheckBoxField.cs
- SQLStringStorage.cs
- ByteConverter.cs
- PrintDocument.cs
- ProfessionalColors.cs
- TextEncodedRawTextWriter.cs
- OuterGlowBitmapEffect.cs
- LabelInfo.cs
- CategoryGridEntry.cs
- MetadataPropertyAttribute.cs
- Drawing.cs
- ToolStripManager.cs
- SettingsBase.cs
- HttpModuleAction.cs
- ControlParameter.cs
- TextPattern.cs
- WebWorkflowRole.cs
- XmlSchemaAny.cs
- XPathNodeList.cs
- XmlExtensionFunction.cs
- LinearGradientBrush.cs
- TemplateComponentConnector.cs
- IDataContractSurrogate.cs
- SecurityUtils.cs
- DetailsViewInsertEventArgs.cs
- TextOnlyOutput.cs
- EditorZoneBase.cs
- WFItemsToSpacerVisibility.cs
- DocumentXmlWriter.cs
- _IPv6Address.cs
- RegionIterator.cs
- HyperLinkDataBindingHandler.cs
- CompilationUtil.cs
- CheckBoxField.cs
- DesignerCalendarAdapter.cs
- AssemblyCollection.cs
- CompilerInfo.cs
- ImportDesigner.xaml.cs
- Block.cs
- MasterPageCodeDomTreeGenerator.cs
- RectConverter.cs
- DataTable.cs
- InvalidateEvent.cs
- Cursors.cs
- AppDomainFactory.cs
- SchemaImporterExtensionElement.cs
- MILUtilities.cs
- GuidelineSet.cs
- DynamicScriptObject.cs
- ComponentConverter.cs
- Stacktrace.cs
- ButtonDesigner.cs
- DataListDesigner.cs
- odbcmetadatacolumnnames.cs
- RayMeshGeometry3DHitTestResult.cs
- FixedSOMTableCell.cs
- ReaderWriterLock.cs
- IRCollection.cs
- HtmlGenericControl.cs
- IntSecurity.cs
- ConnectionManagementElementCollection.cs
- QilTernary.cs
- HandleExceptionArgs.cs
- ContainerUIElement3D.cs
- SystemMulticastIPAddressInformation.cs
- FixedSOMPageElement.cs
- DefaultValueTypeConverter.cs
- CompressEmulationStream.cs
- ClaimComparer.cs
- InputBindingCollection.cs
- MatcherBuilder.cs
- SecurityPolicySection.cs
- COM2ColorConverter.cs
- OleDbMetaDataFactory.cs
- ScrollViewer.cs
- SafeUserTokenHandle.cs
- CodeConstructor.cs
- DATA_BLOB.cs
- StringFunctions.cs
- MatcherBuilder.cs
- Profiler.cs
- IFlowDocumentViewer.cs
- EditorPartChrome.cs
- HandoffBehavior.cs
- DesignerListAdapter.cs