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
- WebScriptMetadataMessageEncoderFactory.cs
- DataSourceBooleanViewSchemaConverter.cs
- StringExpressionSet.cs
- MetadataArtifactLoaderFile.cs
- ActionFrame.cs
- DataSourceHelper.cs
- PropertyEntry.cs
- AnnouncementEndpoint.cs
- brushes.cs
- DecodeHelper.cs
- FreezableOperations.cs
- ToggleButtonAutomationPeer.cs
- SelectedCellsCollection.cs
- SqlExpressionNullability.cs
- StateManager.cs
- SliderAutomationPeer.cs
- ApplicationHost.cs
- QueryCacheManager.cs
- Compiler.cs
- ApplicationInterop.cs
- XmlByteStreamReader.cs
- SelectionPattern.cs
- SwitchLevelAttribute.cs
- DesignerActionTextItem.cs
- EditorZone.cs
- MetadataArtifactLoaderFile.cs
- odbcmetadatacolumnnames.cs
- XamlSerializer.cs
- ToolBarOverflowPanel.cs
- WebPartDisplayMode.cs
- FrameworkRichTextComposition.cs
- BitmapEffectDrawingContextState.cs
- KnowledgeBase.cs
- ToolStripSystemRenderer.cs
- XPathEmptyIterator.cs
- LinkClickEvent.cs
- SqlDataSourceFilteringEventArgs.cs
- FunctionDetailsReader.cs
- CompilationUtil.cs
- HttpProfileBase.cs
- UnescapedXmlDiagnosticData.cs
- TextChange.cs
- OpenTypeLayout.cs
- DataGridTablesFactory.cs
- MessageContractAttribute.cs
- GridProviderWrapper.cs
- CLSCompliantAttribute.cs
- ObjectDataSourceDesigner.cs
- ImageDrawing.cs
- DataGridTextBox.cs
- LifetimeServices.cs
- RegexCode.cs
- RelationshipNavigation.cs
- BatchParser.cs
- LambdaCompiler.Generated.cs
- StringUtil.cs
- SimpleMailWebEventProvider.cs
- XmlReflectionMember.cs
- FixedBufferAttribute.cs
- SqlComparer.cs
- GridViewDeletedEventArgs.cs
- DefaultValueAttribute.cs
- FileUtil.cs
- NameHandler.cs
- Utils.cs
- DateTimeConstantAttribute.cs
- HandlerBase.cs
- SrgsSemanticInterpretationTag.cs
- ListBindableAttribute.cs
- ResourcePermissionBaseEntry.cs
- LockedAssemblyCache.cs
- ColumnCollection.cs
- ProfileSettingsCollection.cs
- ADConnectionHelper.cs
- XmlAnyElementAttributes.cs
- ProjectionCamera.cs
- CertificateManager.cs
- QueryReaderSettings.cs
- TemplatePagerField.cs
- MemoryMappedFile.cs
- WebPartConnectionsCancelVerb.cs
- Deflater.cs
- MessageDescription.cs
- KeyInfo.cs
- TextParagraph.cs
- SchemaImporter.cs
- PropertyChangingEventArgs.cs
- GeneralTransform3DCollection.cs
- TransformGroup.cs
- DynamicRenderer.cs
- DataGridViewRowCancelEventArgs.cs
- SelectionItemPattern.cs
- XmlDigitalSignatureProcessor.cs
- Thickness.cs
- TargetFrameworkAttribute.cs
- SecondaryIndex.cs
- BuilderPropertyEntry.cs
- ServiceDescriptionSerializer.cs
- ConstructorArgumentAttribute.cs
- ScaleTransform.cs