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
- MaterialGroup.cs
- WorkflowServiceHostFactory.cs
- TextSegment.cs
- ValidationEventArgs.cs
- WorkflowLayouts.cs
- Trustee.cs
- PageRequestManager.cs
- TypeInfo.cs
- ScrollItemPatternIdentifiers.cs
- OleDbRowUpdatingEvent.cs
- PointCollectionConverter.cs
- ISO2022Encoding.cs
- ColumnMapVisitor.cs
- SQLInt32Storage.cs
- KeysConverter.cs
- RequestSecurityTokenForGetBrowserToken.cs
- DbUpdateCommandTree.cs
- ToolStripRenderEventArgs.cs
- configsystem.cs
- regiisutil.cs
- Duration.cs
- TabletDeviceInfo.cs
- OleDbRowUpdatedEvent.cs
- JsonReaderWriterFactory.cs
- InsufficientMemoryException.cs
- ResolveCriteria11.cs
- sortedlist.cs
- EngineSite.cs
- CalculatedColumn.cs
- ColorConverter.cs
- SocketElement.cs
- NetworkCredential.cs
- SettingsPropertyCollection.cs
- CommonObjectSecurity.cs
- Drawing.cs
- BulletedListEventArgs.cs
- RequestNavigateEventArgs.cs
- OrthographicCamera.cs
- PropertyTabAttribute.cs
- MessageAction.cs
- CurrentChangedEventManager.cs
- PeerObject.cs
- SqlWorkflowPersistenceService.cs
- QueryResponse.cs
- DataProtection.cs
- Point3DCollectionValueSerializer.cs
- UnionExpr.cs
- XmlSchemaValidationException.cs
- ScriptingWebServicesSectionGroup.cs
- TraceContextEventArgs.cs
- DurableInstanceContextProvider.cs
- StorageMappingItemCollection.cs
- DurationConverter.cs
- NameValuePermission.cs
- WebControlsSection.cs
- Ref.cs
- SqlReferenceCollection.cs
- TextEditorTyping.cs
- ColumnPropertiesGroup.cs
- ComPersistableTypeElement.cs
- XmlConverter.cs
- Token.cs
- UnsafeNativeMethods.cs
- PropertyItem.cs
- GridViewColumnHeader.cs
- SoapCommonClasses.cs
- InsufficientMemoryException.cs
- MetadataUtilsSmi.cs
- SerializerWriterEventHandlers.cs
- StringBuilder.cs
- CustomError.cs
- FormViewCommandEventArgs.cs
- ControlCollection.cs
- WebPartDisplayMode.cs
- TargetInvocationException.cs
- ByteRangeDownloader.cs
- NopReturnReader.cs
- FixedPage.cs
- ConsoleCancelEventArgs.cs
- HttpRuntimeSection.cs
- DebugController.cs
- SHA384Cng.cs
- ModuleConfigurationInfo.cs
- Hash.cs
- SessionStateSection.cs
- ScaleTransform3D.cs
- ToolStripDropDownMenu.cs
- SqlXml.cs
- ConfigXmlText.cs
- IdentityModelStringsVersion1.cs
- ColorConvertedBitmap.cs
- PopupRootAutomationPeer.cs
- SubMenuStyleCollection.cs
- WindowsListViewItem.cs
- PlanCompiler.cs
- UndirectedGraph.cs
- TableLayout.cs
- HierarchicalDataBoundControlAdapter.cs
- AttachedAnnotationChangedEventArgs.cs
- DataGridClipboardHelper.cs