Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / DesignOnlyAttribute.cs / 1305376 / 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
- Rotation3DAnimation.cs
- ClientSponsor.cs
- FactoryMaker.cs
- LinqDataView.cs
- StateDesigner.Layouts.cs
- TextPattern.cs
- DesignerDataStoredProcedure.cs
- ResolveNameEventArgs.cs
- WriterOutput.cs
- JsonXmlDataContract.cs
- ViewStateModeByIdAttribute.cs
- VisualTreeUtils.cs
- QilInvoke.cs
- Ray3DHitTestResult.cs
- PlainXmlDeserializer.cs
- InputChannelBinder.cs
- CngProperty.cs
- WebPartUserCapability.cs
- WebEventCodes.cs
- RSAOAEPKeyExchangeDeformatter.cs
- IndexedEnumerable.cs
- ChannelSinkStacks.cs
- DataSourceView.cs
- DataGridViewCellStateChangedEventArgs.cs
- ButtonChrome.cs
- OleServicesContext.cs
- TransactionInterop.cs
- EventLogger.cs
- TreeIterator.cs
- DropShadowEffect.cs
- IRCollection.cs
- MailMessageEventArgs.cs
- PrivacyNoticeElement.cs
- BrowserDefinitionCollection.cs
- HttpRuntimeSection.cs
- AttributeUsageAttribute.cs
- Facet.cs
- InitializerFacet.cs
- DoubleMinMaxAggregationOperator.cs
- EntityTypeEmitter.cs
- RegexRunnerFactory.cs
- CommandPlan.cs
- TrackBar.cs
- XPathSingletonIterator.cs
- Processor.cs
- PropertyGroupDescription.cs
- PerformanceCounterLib.cs
- FragmentNavigationEventArgs.cs
- XmlLanguageConverter.cs
- DataKeyCollection.cs
- DocumentApplication.cs
- ProcessThread.cs
- UrlAuthFailureHandler.cs
- XmlIgnoreAttribute.cs
- PerformanceCounters.cs
- StatementContext.cs
- MSG.cs
- ErrorRuntimeConfig.cs
- ListViewHitTestInfo.cs
- XmlRootAttribute.cs
- FileInfo.cs
- FilteredDataSetHelper.cs
- TileBrush.cs
- HttpPostedFile.cs
- XmlSchemaObjectCollection.cs
- MessageEncoder.cs
- Attributes.cs
- RegularExpressionValidator.cs
- DBCommandBuilder.cs
- ControlCollection.cs
- ListViewUpdateEventArgs.cs
- CustomError.cs
- GridLengthConverter.cs
- TextRange.cs
- MetadataItemSerializer.cs
- PointAnimation.cs
- ConnectionManagementElementCollection.cs
- RoamingStoreFileUtility.cs
- GridViewHeaderRowPresenter.cs
- ToolStripDropTargetManager.cs
- TextSpanModifier.cs
- GroupQuery.cs
- EventSource.cs
- PanelDesigner.cs
- Object.cs
- DmlSqlGenerator.cs
- FixedSOMTableRow.cs
- RecoverInstanceLocksCommand.cs
- ConfigurationLocationCollection.cs
- ExceptionHandlerDesigner.cs
- ProviderConnectionPoint.cs
- ServiceEndpointElementCollection.cs
- XamlStream.cs
- SafeProcessHandle.cs
- TraceListeners.cs
- DocumentReference.cs
- ToolStripArrowRenderEventArgs.cs
- RichTextBox.cs
- ComponentRenameEvent.cs
- DateBoldEvent.cs