Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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();
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// 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();
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ToolStripGrip.cs
- LostFocusEventManager.cs
- RelatedCurrencyManager.cs
- DbgCompiler.cs
- Button.cs
- RTTypeWrapper.cs
- PaginationProgressEventArgs.cs
- WindowsListViewItem.cs
- XmlObjectSerializerContext.cs
- EventWaitHandle.cs
- SortQueryOperator.cs
- _AcceptOverlappedAsyncResult.cs
- BindingManagerDataErrorEventArgs.cs
- ActivityInterfaces.cs
- IInstanceTable.cs
- KeyProperty.cs
- ImageIndexConverter.cs
- HttpResponseWrapper.cs
- DiscoveryReferences.cs
- RulePatternOps.cs
- _FtpDataStream.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- TextSpanModifier.cs
- MoveSizeWinEventHandler.cs
- ListGeneralPage.cs
- HttpFormatExtensions.cs
- DefaultAssemblyResolver.cs
- DocumentPage.cs
- TextModifierScope.cs
- ExtensionFile.cs
- ValidationResult.cs
- AbsoluteQuery.cs
- SQLBytesStorage.cs
- AsymmetricCryptoHandle.cs
- ContractInstanceProvider.cs
- LinearKeyFrames.cs
- LineGeometry.cs
- DeobfuscatingStream.cs
- PasswordBoxAutomationPeer.cs
- TypedAsyncResult.cs
- HtmlInputSubmit.cs
- LocalizationCodeDomSerializer.cs
- DragEvent.cs
- NullReferenceException.cs
- AudioBase.cs
- ThreadPool.cs
- EventLogEntry.cs
- SynchronousChannelMergeEnumerator.cs
- TraceContextEventArgs.cs
- EditorPart.cs
- XmlAttributes.cs
- ExtensionWindowResizeGrip.cs
- PointHitTestResult.cs
- CompiledIdentityConstraint.cs
- PersonalizationAdministration.cs
- ADMembershipProvider.cs
- MSAAEventDispatcher.cs
- TemporaryBitmapFile.cs
- WsatRegistrationHeader.cs
- GridViewColumnCollection.cs
- DataGridViewElement.cs
- NameValueFileSectionHandler.cs
- brushes.cs
- FormViewUpdateEventArgs.cs
- SpeechAudioFormatInfo.cs
- DataColumnMappingCollection.cs
- OneOfConst.cs
- MulticastOption.cs
- XamlNamespaceHelper.cs
- BindingOperations.cs
- DateRangeEvent.cs
- BufferedGraphicsManager.cs
- TemplateField.cs
- CuspData.cs
- MexTcpBindingCollectionElement.cs
- ParameterBuilder.cs
- PeerInputChannel.cs
- DataGridViewImageColumn.cs
- ResourceProviderFactory.cs
- MergablePropertyAttribute.cs
- ActiveXHelper.cs
- Stopwatch.cs
- ReliableChannelListener.cs
- SourceChangedEventArgs.cs
- CodeIndexerExpression.cs
- NumericUpDownAccelerationCollection.cs
- TileModeValidation.cs
- ConfigXmlElement.cs
- MatrixCamera.cs
- OperationDescription.cs
- TransactionState.cs
- TextTreeObjectNode.cs
- QilDataSource.cs
- EventLogPermissionEntry.cs
- ReachPrintTicketSerializerAsync.cs
- FreezableOperations.cs
- EntityClientCacheKey.cs
- XmlWriterSettings.cs
- BamlTreeUpdater.cs
- Span.cs