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
- AdapterSwitches.cs
- GeometryGroup.cs
- NetStream.cs
- ControlIdConverter.cs
- ProcessInfo.cs
- AssemblyAttributesGoHere.cs
- IxmlLineInfo.cs
- SafeUserTokenHandle.cs
- GlyphRunDrawing.cs
- ListViewTableRow.cs
- WebBaseEventKeyComparer.cs
- MetadataUtilsSmi.cs
- WebControlParameterProxy.cs
- TextServicesManager.cs
- EndOfStreamException.cs
- PopupControlService.cs
- WebSysDefaultValueAttribute.cs
- LayoutEditorPart.cs
- HorizontalAlignConverter.cs
- DataGridViewCellValidatingEventArgs.cs
- SiteMapProvider.cs
- Matrix.cs
- CodeIdentifier.cs
- RegexNode.cs
- ArrayElementGridEntry.cs
- DataRelationCollection.cs
- GeneralTransform2DTo3D.cs
- Ipv6Element.cs
- ToolStripComboBox.cs
- EventManager.cs
- MemberProjectionIndex.cs
- WebBrowserContainer.cs
- HttpBrowserCapabilitiesWrapper.cs
- EllipticalNodeOperations.cs
- DetailsViewUpdatedEventArgs.cs
- SpecialNameAttribute.cs
- SizeKeyFrameCollection.cs
- WorkflowDebuggerSteppingAttribute.cs
- Constant.cs
- SourceElementsCollection.cs
- InfiniteTimeSpanConverter.cs
- CapabilitiesAssignment.cs
- WhitespaceSignificantCollectionAttribute.cs
- OdbcConnectionFactory.cs
- UpdateInfo.cs
- EntityDataSourceDataSelection.cs
- filewebresponse.cs
- FormatterConverter.cs
- httpserverutility.cs
- ValidationService.cs
- DataBindingCollection.cs
- IndexedString.cs
- HtmlImage.cs
- FixedSOMPage.cs
- EnterpriseServicesHelper.cs
- PublisherIdentityPermission.cs
- Trace.cs
- KeyNotFoundException.cs
- HostSecurityManager.cs
- DetailsViewInsertedEventArgs.cs
- StylusCaptureWithinProperty.cs
- CloudCollection.cs
- DataGridViewRowHeaderCell.cs
- StatusStrip.cs
- HtmlButton.cs
- XmlTypeAttribute.cs
- Empty.cs
- DataRowComparer.cs
- MatrixTransform.cs
- OneToOneMappingSerializer.cs
- ReferencedAssembly.cs
- CodeParameterDeclarationExpression.cs
- DataGridPageChangedEventArgs.cs
- ProtocolReflector.cs
- AtlasWeb.Designer.cs
- GroupDescription.cs
- FirstMatchCodeGroup.cs
- CheckoutException.cs
- MemberHolder.cs
- ScriptingProfileServiceSection.cs
- StatusBar.cs
- SHA384.cs
- HandlerBase.cs
- ResourceSet.cs
- HandleExceptionArgs.cs
- DataService.cs
- PaginationProgressEventArgs.cs
- Package.cs
- DoubleStorage.cs
- XmlSubtreeReader.cs
- BatchServiceHost.cs
- CurrentChangingEventManager.cs
- HttpListenerRequestUriBuilder.cs
- CheckedPointers.cs
- LogReservationCollection.cs
- WebBrowser.cs
- FlowDocumentPageViewerAutomationPeer.cs
- Adorner.cs
- PaginationProgressEventArgs.cs
- FakeModelItemImpl.cs