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
- SqlProviderServices.cs
- BlockUIContainer.cs
- IndentedTextWriter.cs
- MessagePartDescriptionCollection.cs
- TimeSpanConverter.cs
- WebRequest.cs
- GreenMethods.cs
- CodeDelegateCreateExpression.cs
- DataListItem.cs
- Popup.cs
- EraserBehavior.cs
- MaskedTextBox.cs
- ScriptingProfileServiceSection.cs
- SQLConvert.cs
- ChannelSinkStacks.cs
- DataGridViewSelectedColumnCollection.cs
- UnionCodeGroup.cs
- SerialPinChanges.cs
- CalculatedColumn.cs
- PropertyDescriptorComparer.cs
- ConnectivityStatus.cs
- ReferencedAssembly.cs
- GACMembershipCondition.cs
- ModelUIElement3D.cs
- Thickness.cs
- RectangleHotSpot.cs
- UnrecognizedPolicyAssertionElement.cs
- ZipIOModeEnforcingStream.cs
- AsyncDataRequest.cs
- ByteStack.cs
- RegexInterpreter.cs
- ContextStaticAttribute.cs
- ConnectionManager.cs
- EventLogHandle.cs
- DispatcherTimer.cs
- DependencyPropertyChangedEventArgs.cs
- TableCell.cs
- ConfigXmlComment.cs
- FusionWrap.cs
- DependencyPropertyChangedEventArgs.cs
- DataGridViewCellStyle.cs
- UIPropertyMetadata.cs
- SpanIndex.cs
- LinkButton.cs
- WebBrowserEvent.cs
- COMException.cs
- CustomAttributeFormatException.cs
- AppDomainManager.cs
- WorkflowServiceHost.cs
- DataDocumentXPathNavigator.cs
- SafeLocalMemHandle.cs
- WindowsAuthenticationEventArgs.cs
- CategoriesDocument.cs
- DataExpression.cs
- List.cs
- DataGridCommandEventArgs.cs
- codemethodreferenceexpression.cs
- EmptyElement.cs
- BasicKeyConstraint.cs
- DataColumnMappingCollection.cs
- MemberMaps.cs
- DataGridViewSelectedCellCollection.cs
- RuntimeCompatibilityAttribute.cs
- CompoundFileStorageReference.cs
- GraphicsPath.cs
- TreeViewImageKeyConverter.cs
- FixedSOMSemanticBox.cs
- CqlLexer.cs
- BinaryUtilClasses.cs
- NonSerializedAttribute.cs
- BoolExpression.cs
- InertiaTranslationBehavior.cs
- AnnouncementSendsAsyncResult.cs
- TagMapInfo.cs
- storepermission.cs
- _UriTypeConverter.cs
- LabelDesigner.cs
- XmlSchemaFacet.cs
- Error.cs
- FormsAuthenticationEventArgs.cs
- FragmentQueryKB.cs
- SqlCachedBuffer.cs
- XsltCompileContext.cs
- ListBindableAttribute.cs
- SecurityMode.cs
- XPathChildIterator.cs
- activationcontext.cs
- dataSvcMapFileLoader.cs
- AdvancedBindingPropertyDescriptor.cs
- TextCompositionEventArgs.cs
- CreateUserWizardStep.cs
- CustomLineCap.cs
- StringConcat.cs
- RuleSetDialog.Designer.cs
- WsdlWriter.cs
- AutomationPropertyInfo.cs
- FragmentQueryKB.cs
- OperationInfoBase.cs
- Fault.cs
- DesignerHost.cs