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
- Baml2006KnownTypes.cs
- SupportsEventValidationAttribute.cs
- CalendarSelectionChangedEventArgs.cs
- XmlSchemaSimpleTypeList.cs
- AssociationTypeEmitter.cs
- XsdDuration.cs
- ListDataHelper.cs
- AttachedPropertyBrowsableAttribute.cs
- IntegerValidatorAttribute.cs
- SchemaDeclBase.cs
- ConnectionPoint.cs
- CrossAppDomainChannel.cs
- TemplateControl.cs
- DrawToolTipEventArgs.cs
- UserControl.cs
- WebSysDescriptionAttribute.cs
- InternalBase.cs
- CodeTypeReference.cs
- SocketInformation.cs
- AutoScrollHelper.cs
- EventLog.cs
- COM2Properties.cs
- PropertyMapper.cs
- ExceptQueryOperator.cs
- AccessKeyManager.cs
- FilterEventArgs.cs
- DictionaryTraceRecord.cs
- Parser.cs
- Permission.cs
- XmlUtf8RawTextWriter.cs
- BypassElementCollection.cs
- DataGridViewRowCollection.cs
- MaskedTextBox.cs
- FontInfo.cs
- MouseButton.cs
- WebPartDisplayModeCancelEventArgs.cs
- TextAdaptor.cs
- WorkflowIdleElement.cs
- CatalogZone.cs
- CollectionConverter.cs
- RectAnimation.cs
- TraceUtils.cs
- EntityDataSourceQueryBuilder.cs
- GPStream.cs
- XmlElementAttributes.cs
- HtmlForm.cs
- ZipIOFileItemStream.cs
- ServiceBuildProvider.cs
- FileNotFoundException.cs
- ReplyChannelBinder.cs
- WrapPanel.cs
- TcpChannelFactory.cs
- XmlSiteMapProvider.cs
- SdlChannelSink.cs
- PagedControl.cs
- CheckoutException.cs
- AudioDeviceOut.cs
- DesignerImageAdapter.cs
- SR.cs
- SqlBuilder.cs
- sortedlist.cs
- CheckedListBox.cs
- EventLogPermissionEntryCollection.cs
- IdentityValidationException.cs
- OperationPerformanceCounters.cs
- FixedSOMPageElement.cs
- SqlConnectionPoolProviderInfo.cs
- DataGridViewComboBoxColumn.cs
- DummyDataSource.cs
- FixedPosition.cs
- DayRenderEvent.cs
- EntitySet.cs
- XmlCharType.cs
- OleDbRowUpdatingEvent.cs
- XmlSchemaDocumentation.cs
- PropertyRecord.cs
- Repeater.cs
- IntPtr.cs
- Sentence.cs
- ToolboxCategoryItems.cs
- Model3DCollection.cs
- WebControlAdapter.cs
- EdmComplexTypeAttribute.cs
- TrustManagerPromptUI.cs
- TextEndOfSegment.cs
- EdmMember.cs
- GridEntryCollection.cs
- LinkUtilities.cs
- RuntimeResourceSet.cs
- UTF7Encoding.cs
- VisualTreeFlattener.cs
- IArgumentProvider.cs
- TailPinnedEventArgs.cs
- CustomWebEventKey.cs
- EncoderReplacementFallback.cs
- ViewManager.cs
- IDictionary.cs
- RSAOAEPKeyExchangeDeformatter.cs
- FrameworkRichTextComposition.cs
- sqlstateclientmanager.cs