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
- ArrayElementGridEntry.cs
- _Semaphore.cs
- RSACryptoServiceProvider.cs
- DescendantQuery.cs
- DocumentGridContextMenu.cs
- DataContractSet.cs
- SoapFault.cs
- Journaling.cs
- UriParserTemplates.cs
- ByteFacetDescriptionElement.cs
- SingleObjectCollection.cs
- SqlReorderer.cs
- AsymmetricSecurityProtocol.cs
- SecurityHelper.cs
- FixedLineResult.cs
- CmsInterop.cs
- BasicBrowserDialog.designer.cs
- TypedRowHandler.cs
- CompilerGeneratedAttribute.cs
- SqlFlattener.cs
- XmlMtomReader.cs
- ListViewTableCell.cs
- WebResourceAttribute.cs
- BufferedGraphicsManager.cs
- GraphicsPathIterator.cs
- PeerInvitationResponse.cs
- IpcChannel.cs
- Int16Animation.cs
- PathParser.cs
- ValidationHelper.cs
- ObjectConverter.cs
- InputLanguageSource.cs
- _Events.cs
- MetadataItem_Static.cs
- StringFreezingAttribute.cs
- StatusBarPanelClickEvent.cs
- ArrayWithOffset.cs
- ByteKeyFrameCollection.cs
- XamlFilter.cs
- XMLDiffLoader.cs
- ValidationSummary.cs
- EventListener.cs
- TextSegment.cs
- CodeLinePragma.cs
- PackUriHelper.cs
- TraceLevelHelper.cs
- JoinSymbol.cs
- CalendarDataBindingHandler.cs
- CodeSnippetStatement.cs
- basenumberconverter.cs
- ObjectCloneHelper.cs
- DBConnection.cs
- HttpValueCollection.cs
- DecimalKeyFrameCollection.cs
- ProgressBarAutomationPeer.cs
- ISAPIWorkerRequest.cs
- EndpointDiscoveryBehavior.cs
- ButtonField.cs
- TcpStreams.cs
- RootBrowserWindow.cs
- XmlReaderSettings.cs
- DeviceOverridableAttribute.cs
- WebResourceAttribute.cs
- SizeKeyFrameCollection.cs
- ByteAnimationUsingKeyFrames.cs
- VirtualizingPanel.cs
- ToolBarDesigner.cs
- PersonalizationStateInfo.cs
- DelayedRegex.cs
- CompositeFontParser.cs
- Reference.cs
- IResourceProvider.cs
- _DynamicWinsockMethods.cs
- ImportContext.cs
- XmlSchemaComplexType.cs
- HostingEnvironmentSection.cs
- AuthenticateEventArgs.cs
- KnownIds.cs
- DBNull.cs
- X509CertificateValidationMode.cs
- HebrewCalendar.cs
- RootNamespaceAttribute.cs
- LocalizationParserHooks.cs
- LogicalExpressionEditor.cs
- XmlSchemaSimpleContentExtension.cs
- DetailsViewUpdatedEventArgs.cs
- FilterFactory.cs
- SmtpTransport.cs
- NativeMethods.cs
- DbDataSourceEnumerator.cs
- NamespaceEmitter.cs
- ReflectionTypeLoadException.cs
- FilteredDataSetHelper.cs
- UriTemplateTrieLocation.cs
- QilGeneratorEnv.cs
- AccessDataSourceView.cs
- AutomationEvent.cs
- LambdaCompiler.Statements.cs
- UIElement3DAutomationPeer.cs
- LinkArea.cs