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
- PolyLineSegment.cs
- PresentationAppDomainManager.cs
- XPathMultyIterator.cs
- DescendantBaseQuery.cs
- ObjectViewFactory.cs
- SolidColorBrush.cs
- SeekableReadStream.cs
- WorkflowApplicationAbortedException.cs
- ValueChangedEventManager.cs
- SmiXetterAccessMap.cs
- TraversalRequest.cs
- ExpressionBindings.cs
- UInt32.cs
- XmlSignatureProperties.cs
- SplitterPanel.cs
- ChtmlTextWriter.cs
- HTTPRemotingHandler.cs
- DataBinder.cs
- ContainerParagraph.cs
- InvokePattern.cs
- ConfigurationValues.cs
- XmlNamespaceMappingCollection.cs
- CachedFontFamily.cs
- KeyValuePairs.cs
- Maps.cs
- CustomAttribute.cs
- XmlSchemaSimpleContent.cs
- KeySplineConverter.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- ControlPersister.cs
- PriorityBindingExpression.cs
- CaseInsensitiveHashCodeProvider.cs
- TypedRowGenerator.cs
- UnsafeNativeMethods.cs
- DoubleAnimationClockResource.cs
- DllHostInitializer.cs
- SuspendDesigner.cs
- CommandSet.cs
- BuildManager.cs
- ToolStripSystemRenderer.cs
- DeferrableContentConverter.cs
- EditingCommands.cs
- ExecutedRoutedEventArgs.cs
- Vector3dCollection.cs
- Image.cs
- TypeInfo.cs
- NameValuePermission.cs
- DispatchWrapper.cs
- UrlMappingsModule.cs
- ParameterExpression.cs
- TypeUnloadedException.cs
- RSAPKCS1SignatureFormatter.cs
- WebPartConnectionCollection.cs
- ConversionValidationRule.cs
- RuleSetBrowserDialog.cs
- CreateRefExpr.cs
- SizeAnimationClockResource.cs
- DropShadowBitmapEffect.cs
- RowType.cs
- MailHeaderInfo.cs
- WindowsScrollBar.cs
- ProviderSettings.cs
- GeometryValueSerializer.cs
- BindingList.cs
- SqlCrossApplyToCrossJoin.cs
- Polygon.cs
- FixedTextPointer.cs
- TranslateTransform3D.cs
- FormsAuthenticationModule.cs
- AxParameterData.cs
- ScrollEvent.cs
- MULTI_QI.cs
- DataGridHeadersVisibilityToVisibilityConverter.cs
- Evidence.cs
- tooltip.cs
- ISessionStateStore.cs
- EffectiveValueEntry.cs
- KeyboardEventArgs.cs
- CompilerCollection.cs
- ClockGroup.cs
- XsltContext.cs
- MetadataItemEmitter.cs
- sqlstateclientmanager.cs
- AtomicFile.cs
- DeferredReference.cs
- TreeNodeConverter.cs
- SelectionPatternIdentifiers.cs
- XmlSigningNodeWriter.cs
- QuaternionAnimation.cs
- SecurityAccessDeniedException.cs
- SimpleLine.cs
- DynamicILGenerator.cs
- MenuBindingsEditor.cs
- Thickness.cs
- SharedUtils.cs
- AuthenticationConfig.cs
- GetPageNumberCompletedEventArgs.cs
- CodeConditionStatement.cs
- QuaternionRotation3D.cs
- AsyncStreamReader.cs