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
- PointKeyFrameCollection.cs
- invalidudtexception.cs
- EventOpcode.cs
- ClientScriptManager.cs
- CodeAttachEventStatement.cs
- ScrollBar.cs
- DataGridViewRowsAddedEventArgs.cs
- CheckBoxPopupAdapter.cs
- MappingSource.cs
- CurrencyWrapper.cs
- HostingPreferredMapPath.cs
- ItemsControl.cs
- HGlobalSafeHandle.cs
- EncodingStreamWrapper.cs
- CompositionAdorner.cs
- HwndSource.cs
- WinEventWrap.cs
- ItemContainerProviderWrapper.cs
- RuleSettings.cs
- DefaultAuthorizationContext.cs
- XmlTypeAttribute.cs
- SerializationAttributes.cs
- PixelFormats.cs
- UnsafeNativeMethods.cs
- AbsoluteQuery.cs
- PlatformNotSupportedException.cs
- EncodingInfo.cs
- WorkflowServiceNamespace.cs
- BevelBitmapEffect.cs
- RayMeshGeometry3DHitTestResult.cs
- Soap.cs
- IntegerValidatorAttribute.cs
- TraceHwndHost.cs
- CngAlgorithm.cs
- XamlGridLengthSerializer.cs
- ProcessHostMapPath.cs
- ListViewDeletedEventArgs.cs
- TemplateColumn.cs
- SafeNativeMethods.cs
- ColumnWidthChangingEvent.cs
- CustomValidator.cs
- PartitionedStream.cs
- AdapterDictionary.cs
- UDPClient.cs
- _ListenerResponseStream.cs
- ReferentialConstraint.cs
- NativeConfigurationLoader.cs
- AuthorizationContext.cs
- SystemIPv4InterfaceProperties.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- BooleanSwitch.cs
- IdSpace.cs
- Content.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- XmlTypeAttribute.cs
- RegexCaptureCollection.cs
- CompileXomlTask.cs
- PageRouteHandler.cs
- XmlSchemaChoice.cs
- MetabaseReader.cs
- XPathQilFactory.cs
- ConfigXmlReader.cs
- PasswordDeriveBytes.cs
- CreateUserErrorEventArgs.cs
- Permission.cs
- SymbolEqualComparer.cs
- CodeMemberProperty.cs
- HttpContext.cs
- FlowNode.cs
- ExpressionBindings.cs
- SQLResource.cs
- OleServicesContext.cs
- FastEncoderStatics.cs
- EventHandlerList.cs
- CodeSnippetTypeMember.cs
- TabletDeviceInfo.cs
- LayoutExceptionEventArgs.cs
- XPathScanner.cs
- SQLMembershipProvider.cs
- VariableQuery.cs
- RectKeyFrameCollection.cs
- EventArgs.cs
- EntityParameterCollection.cs
- Slider.cs
- ContentPlaceHolder.cs
- SoapReflectionImporter.cs
- WebPartTransformerCollection.cs
- DataException.cs
- TemplateColumn.cs
- TextServicesCompartment.cs
- HostingEnvironmentSection.cs
- SymLanguageType.cs
- ToolStripComboBox.cs
- categoryentry.cs
- CharacterString.cs
- UnauthorizedWebPart.cs
- BulletChrome.cs
- dataprotectionpermission.cs
- TreeNode.cs
- Point4D.cs