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
- precedingsibling.cs
- Timeline.cs
- ViewStateModeByIdAttribute.cs
- PreviewPageInfo.cs
- EditBehavior.cs
- PermissionAttributes.cs
- BuildDependencySet.cs
- MetadataArtifactLoader.cs
- LinqDataView.cs
- Int16Animation.cs
- PrinterUnitConvert.cs
- CodeCommentStatementCollection.cs
- CountdownEvent.cs
- AutomationPatternInfo.cs
- HostVisual.cs
- GroupQuery.cs
- PhonemeConverter.cs
- QualifiedId.cs
- SchemaMapping.cs
- SqlUtil.cs
- DeleteMemberBinder.cs
- Int16Converter.cs
- WebMessageEncodingElement.cs
- DataGridColumnHeaderAutomationPeer.cs
- ScriptDescriptor.cs
- ThrowOnMultipleAssignment.cs
- IFlowDocumentViewer.cs
- CommandLibraryHelper.cs
- IgnoreFileBuildProvider.cs
- FindRequestContext.cs
- UniqueSet.cs
- MsmqIntegrationProcessProtocolHandler.cs
- XmlCharType.cs
- RC2CryptoServiceProvider.cs
- CompositeFontParser.cs
- FormsAuthenticationConfiguration.cs
- Vector3DCollectionValueSerializer.cs
- ControlDesignerState.cs
- AttributeXamlType.cs
- ComboBoxAutomationPeer.cs
- Config.cs
- GetFileNameResult.cs
- DataGridCellsPanel.cs
- ParserStack.cs
- LabelEditEvent.cs
- CqlWriter.cs
- XmlSchemaParticle.cs
- Dictionary.cs
- DbDataSourceEnumerator.cs
- PersianCalendar.cs
- CommandValueSerializer.cs
- ImageList.cs
- DataBindingHandlerAttribute.cs
- HttpListener.cs
- IImplicitResourceProvider.cs
- HttpCacheParams.cs
- CatalogPartCollection.cs
- SapiRecoInterop.cs
- DefaultSection.cs
- XPathEmptyIterator.cs
- ISAPIRuntime.cs
- COM2FontConverter.cs
- InputScope.cs
- SystemNetworkInterface.cs
- MediaElement.cs
- QueryMath.cs
- OperatingSystem.cs
- TokenBasedSet.cs
- MarkupObject.cs
- PartitionResolver.cs
- HtmlInputButton.cs
- StringInfo.cs
- TextServicesCompartmentContext.cs
- ModifyActivitiesPropertyDescriptor.cs
- CodeEventReferenceExpression.cs
- StringDictionaryWithComparer.cs
- LogEntrySerializationException.cs
- RemoteCryptoSignHashRequest.cs
- ConvertersCollection.cs
- AuthenticodeSignatureInformation.cs
- JpegBitmapEncoder.cs
- DataSpaceManager.cs
- PerfCounters.cs
- VisualBrush.cs
- ResXResourceWriter.cs
- UpdatePanelTriggerCollection.cs
- Debug.cs
- QueryIntervalOp.cs
- GradientBrush.cs
- XsltException.cs
- Table.cs
- Compiler.cs
- FontCacheLogic.cs
- CursorConverter.cs
- FlowchartSizeFeature.cs
- FileChangeNotifier.cs
- SQLChars.cs
- METAHEADER.cs
- XmlnsPrefixAttribute.cs
- CodeTypeMember.cs