Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- HttpChannelHelpers.cs
- ColorPalette.cs
- BinaryCommonClasses.cs
- ReachDocumentSequenceSerializerAsync.cs
- FixedTextContainer.cs
- SqlTrackingService.cs
- DataObjectPastingEventArgs.cs
- DataGridViewRowCancelEventArgs.cs
- CodePageEncoding.cs
- FrameworkRichTextComposition.cs
- TemplateBindingExtensionConverter.cs
- SmtpNtlmAuthenticationModule.cs
- PageThemeBuildProvider.cs
- FontStyle.cs
- HostSecurityManager.cs
- ImportedNamespaceContextItem.cs
- Size.cs
- DbConnectionPoolGroup.cs
- CapabilitiesAssignment.cs
- AssemblyAssociatedContentFileAttribute.cs
- NoneExcludedImageIndexConverter.cs
- DataGridViewTopLeftHeaderCell.cs
- WebPartsSection.cs
- WindowsRichEdit.cs
- UnsafeMethods.cs
- Wizard.cs
- PortCache.cs
- DictionarySurrogate.cs
- BezierSegment.cs
- StorageModelBuildProvider.cs
- AnonymousIdentificationModule.cs
- LinkClickEvent.cs
- CompilationUtil.cs
- Classification.cs
- ToolStripControlHost.cs
- ToolTipAutomationPeer.cs
- InstanceKeyNotReadyException.cs
- OleDbMetaDataFactory.cs
- SQLChars.cs
- Queue.cs
- sortedlist.cs
- OLEDB_Enum.cs
- UpDownBase.cs
- TypeToken.cs
- CharacterShapingProperties.cs
- MarshalByRefObject.cs
- ComAdminWrapper.cs
- filewebrequest.cs
- PropertyCollection.cs
- Int32RectValueSerializer.cs
- BasicHttpSecurityMode.cs
- ExtendedProtectionPolicy.cs
- XXXOnTypeBuilderInstantiation.cs
- XmlElementElementCollection.cs
- HostedNamedPipeTransportManager.cs
- ReservationCollection.cs
- NativeObjectSecurity.cs
- XmlDictionary.cs
- XmlAtomicValue.cs
- HttpException.cs
- WebBrowserDocumentCompletedEventHandler.cs
- _NativeSSPI.cs
- BinHexEncoder.cs
- DragEvent.cs
- ExpandedProjectionNode.cs
- HashMembershipCondition.cs
- DocComment.cs
- TableAutomationPeer.cs
- BooleanFunctions.cs
- EmptyEnumerable.cs
- DataBinding.cs
- InkCanvasFeedbackAdorner.cs
- ComponentEditorForm.cs
- ColorMap.cs
- DataBindingValueUIHandler.cs
- MsmqException.cs
- CalendarKeyboardHelper.cs
- CqlParserHelpers.cs
- SchemaImporter.cs
- CheckableControlBaseAdapter.cs
- TraceSource.cs
- XmlILStorageConverter.cs
- RectValueSerializer.cs
- ThousandthOfEmRealDoubles.cs
- RowsCopiedEventArgs.cs
- FilteredAttributeCollection.cs
- GenericAuthenticationEventArgs.cs
- TableStyle.cs
- JsonReader.cs
- BinaryParser.cs
- ListViewGroup.cs
- AddValidationError.cs
- AstTree.cs
- PathTooLongException.cs
- ListDictionaryInternal.cs
- EventRoute.cs
- EntityWrapperFactory.cs
- UserCancellationException.cs
- XmlQuerySequence.cs
- oledbmetadatacolumnnames.cs