Code:
/ DotNET / DotNET / 8.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;
///
/// Specifies whether a property can only be set at
/// design time.
///
[AttributeUsage(AttributeTargets.All)]
public sealed class DesignOnlyAttribute : Attribute {
private bool isDesignOnly = false;
///
///
/// Initializes a new instance of the class.
///
///
public DesignOnlyAttribute(bool isDesignOnly) {
this.isDesignOnly = isDesignOnly;
}
///
///
/// Gets a value indicating whether a property
/// can be set only at design time.
///
///
public bool IsDesignOnly {
get {
return isDesignOnly;
}
}
///
///
/// Specifies that a property can be set only at design time. This
/// field is read-only.
///
///
public static readonly DesignOnlyAttribute Yes = new DesignOnlyAttribute(true);
///
///
/// Specifies
/// that a
/// property can be set at design time or at run
/// time. This field is read-only.
///
///
public static readonly DesignOnlyAttribute No = new DesignOnlyAttribute(false);
///
///
/// Specifies the default value for the , which is . This field is
/// read-only.
///
///
public static readonly DesignOnlyAttribute Default = No;
///
///
///
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
- HandlerBase.cs
- DataServiceRequestOfT.cs
- DetailsViewRowCollection.cs
- CustomUserNameSecurityTokenAuthenticator.cs
- MarkupExtensionParser.cs
- StringComparer.cs
- KeyGestureConverter.cs
- RegisteredScript.cs
- HitTestWithPointDrawingContextWalker.cs
- HasCopySemanticsAttribute.cs
- Track.cs
- UniqueID.cs
- TypeFieldSchema.cs
- Compilation.cs
- VirtualPathProvider.cs
- HtmlCommandAdapter.cs
- CreateBookmarkScope.cs
- PasswordRecovery.cs
- XmlWriterSettings.cs
- SmtpClient.cs
- InfoCardRSAOAEPKeyExchangeFormatter.cs
- DataSourceCacheDurationConverter.cs
- CodeTypeDeclaration.cs
- CheckBoxStandardAdapter.cs
- ContractMapping.cs
- figurelength.cs
- UnsignedPublishLicense.cs
- BoundField.cs
- ConfigurationManagerInternal.cs
- FilteredAttributeCollection.cs
- Normalization.cs
- PrintDialog.cs
- CodeArgumentReferenceExpression.cs
- CodeGenHelper.cs
- _NestedSingleAsyncResult.cs
- TextParagraphCache.cs
- ImageMapEventArgs.cs
- RegionInfo.cs
- LostFocusEventManager.cs
- TransactionTraceIdentifier.cs
- SignatureDescription.cs
- GeometryModel3D.cs
- ToolStripGrip.cs
- BaseAutoFormat.cs
- MimeReflector.cs
- DefaultClaimSet.cs
- SecureStringHasher.cs
- TypeToArgumentTypeConverter.cs
- EntityTransaction.cs
- QueryPageSettingsEventArgs.cs
- RenderDataDrawingContext.cs
- FixedSOMFixedBlock.cs
- DataGridViewTopRowAccessibleObject.cs
- SecurityRuntime.cs
- StructuredProperty.cs
- wmiprovider.cs
- IRCollection.cs
- DataControlFieldCollection.cs
- Visual.cs
- FixedSOMTableCell.cs
- StringInfo.cs
- ShaperBuffers.cs
- MarshalDirectiveException.cs
- PathSegmentCollection.cs
- QueueAccessMode.cs
- EnlistmentState.cs
- ToolStripSeparatorRenderEventArgs.cs
- Rights.cs
- CodeBlockBuilder.cs
- DisplayNameAttribute.cs
- PropertyChangingEventArgs.cs
- HelpProvider.cs
- TreeBuilderBamlTranslator.cs
- FileSystemEventArgs.cs
- XmlNotation.cs
- GorillaCodec.cs
- SystemIPv4InterfaceProperties.cs
- HttpListenerPrefixCollection.cs
- FirstMatchCodeGroup.cs
- WizardPanel.cs
- AttributeProviderAttribute.cs
- PolicyManager.cs
- UnsafeNativeMethods.cs
- EntityModelBuildProvider.cs
- NativeMethods.cs
- XmlElementElementCollection.cs
- CryptoStream.cs
- DirectoryNotFoundException.cs
- MetaForeignKeyColumn.cs
- MimeParameter.cs
- X509Extension.cs
- HtmlControlAdapter.cs
- Schema.cs
- SamlDelegatingWriter.cs
- ActiveXSite.cs
- VectorConverter.cs
- EnumUnknown.cs
- RootBrowserWindowAutomationPeer.cs
- FixedDocumentPaginator.cs
- HttpServerVarsCollection.cs