Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- IgnoreFlushAndCloseStream.cs
- MediaPlayerState.cs
- PathParser.cs
- BitmapEffectGroup.cs
- AuthenticationSection.cs
- GenericIdentity.cs
- FixedPageProcessor.cs
- EntryIndex.cs
- ProfileProvider.cs
- SqlParameter.cs
- DataColumnMapping.cs
- DynamicMethod.cs
- TextEditorThreadLocalStore.cs
- RefreshPropertiesAttribute.cs
- SelectedGridItemChangedEvent.cs
- AssertFilter.cs
- FixedSOMPageConstructor.cs
- localization.cs
- ComplexBindingPropertiesAttribute.cs
- CommandHelper.cs
- TypeUnloadedException.cs
- EventEntry.cs
- _DomainName.cs
- PropertyConverter.cs
- PointCollection.cs
- SmtpReplyReader.cs
- NavigatorOutput.cs
- ListViewItem.cs
- TreeViewBindingsEditor.cs
- ProcessModelSection.cs
- ProcessHost.cs
- ToolStripItemImageRenderEventArgs.cs
- Track.cs
- DESCryptoServiceProvider.cs
- Guid.cs
- LazyTextWriterCreator.cs
- QuadraticBezierSegment.cs
- DeviceContext.cs
- Rotation3DAnimationUsingKeyFrames.cs
- HandleCollector.cs
- BooleanExpr.cs
- TextTreeObjectNode.cs
- ReflectionTypeLoadException.cs
- ElementInit.cs
- DataBinder.cs
- XmlTextAttribute.cs
- SimpleType.cs
- SpeechDetectedEventArgs.cs
- CompressStream.cs
- MobileUserControl.cs
- MailMessage.cs
- CurrencyManager.cs
- HMACSHA512.cs
- SchemaElement.cs
- WebControl.cs
- CustomErrorsSectionWrapper.cs
- WindowsToolbar.cs
- ValueSerializerAttribute.cs
- X509Chain.cs
- StickyNoteContentControl.cs
- CssClassPropertyAttribute.cs
- Double.cs
- DeviceContext.cs
- RadialGradientBrush.cs
- DataRowExtensions.cs
- SimpleParser.cs
- FixedLineResult.cs
- infer.cs
- PrivacyNoticeBindingElement.cs
- FontResourceCache.cs
- EntityViewContainer.cs
- TypeConverters.cs
- EdgeProfileValidation.cs
- ClonableStack.cs
- DataGridSortingEventArgs.cs
- CalendarDay.cs
- PrimitiveType.cs
- GeometryHitTestResult.cs
- HtmlInputRadioButton.cs
- StrongNameUtility.cs
- BulletedListEventArgs.cs
- DocumentOrderComparer.cs
- ProjectionCamera.cs
- PreviewKeyDownEventArgs.cs
- RecognizedWordUnit.cs
- HtmlButton.cs
- XmlArrayAttribute.cs
- Sql8ExpressionRewriter.cs
- SchemaEntity.cs
- ValueHandle.cs
- DesignerVerbCollection.cs
- AlignmentXValidation.cs
- RotateTransform3D.cs
- XmlSerializationReader.cs
- Attachment.cs
- arabicshape.cs
- Boolean.cs
- CodeDelegateInvokeExpression.cs
- HttpEncoderUtility.cs
- PackageFilter.cs