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
- DeviceContext2.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- Exceptions.cs
- ResourceManager.cs
- QueryOperationResponseOfT.cs
- XmlNamespaceMapping.cs
- SourceElementsCollection.cs
- MsmqHostedTransportConfiguration.cs
- SchemaComplexType.cs
- SemanticResolver.cs
- ComponentEditorPage.cs
- ISFTagAndGuidCache.cs
- PopOutPanel.cs
- CompilationRelaxations.cs
- ListenerHandler.cs
- EndpointDiscoveryMetadata11.cs
- LinkedDataMemberFieldEditor.cs
- XmlAtomicValue.cs
- ViewCellRelation.cs
- FilteredAttributeCollection.cs
- ExternalException.cs
- TypeSystem.cs
- Annotation.cs
- PageContent.cs
- LineGeometry.cs
- SymbolTable.cs
- TreeView.cs
- PhysicalOps.cs
- HttpContextServiceHost.cs
- TcpWorkerProcess.cs
- DomNameTable.cs
- TypeValidationEventArgs.cs
- CheckBox.cs
- DataBindingCollection.cs
- PathSegment.cs
- NameObjectCollectionBase.cs
- DispatcherSynchronizationContext.cs
- StringFormat.cs
- log.cs
- SortFieldComparer.cs
- FileClassifier.cs
- EllipticalNodeOperations.cs
- SafeUserTokenHandle.cs
- WaitHandle.cs
- TdsParserHelperClasses.cs
- ChannelCacheSettings.cs
- ButtonChrome.cs
- AnonymousIdentificationSection.cs
- InteropAutomationProvider.cs
- WebPartUserCapability.cs
- EndOfStreamException.cs
- AQNBuilder.cs
- xml.cs
- ListControlConvertEventArgs.cs
- DebugTraceHelper.cs
- HttpBindingExtension.cs
- NamespaceInfo.cs
- DocumentApplication.cs
- ArrayWithOffset.cs
- GridViewDeleteEventArgs.cs
- DataControlLinkButton.cs
- FormatVersion.cs
- ThreadAttributes.cs
- BitmapEffectGroup.cs
- Itemizer.cs
- TraceListeners.cs
- wpf-etw.cs
- WorkflowDefinitionContext.cs
- SqlTriggerAttribute.cs
- MenuItemBindingCollection.cs
- FixedBufferAttribute.cs
- DataGridTableCollection.cs
- CommandBinding.cs
- CompiledQuery.cs
- BuildManagerHost.cs
- _TransmitFileOverlappedAsyncResult.cs
- EntityTypeEmitter.cs
- ListControlStringCollectionEditor.cs
- OciHandle.cs
- PointF.cs
- IndicCharClassifier.cs
- Conditional.cs
- DispatcherExceptionFilterEventArgs.cs
- ObjectItemCollection.cs
- _NtlmClient.cs
- SamlSerializer.cs
- dtdvalidator.cs
- ApplicationFileCodeDomTreeGenerator.cs
- OdbcRowUpdatingEvent.cs
- LinkButton.cs
- StandardCommandToolStripMenuItem.cs
- DataMemberConverter.cs
- RuntimeEnvironment.cs
- HtmlHead.cs
- KeyGestureValueSerializer.cs
- WaitHandle.cs
- TraversalRequest.cs
- UDPClient.cs
- TemplateControl.cs
- PropertyChangingEventArgs.cs