Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / CompMod / System / ComponentModel / DesignTimeVisibleAttribute.cs / 1 / DesignTimeVisibleAttribute.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
*/
namespace System.ComponentModel {
using System;
using System.Security.Permissions;
///
///
/// DesignTimeVisibileAttribute marks a component's visibility. If
/// DesignTimeVisibileAttribute.Yes is present, a visual designer can show
/// this component on a designer.
///
///
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)]
public sealed class DesignTimeVisibleAttribute : Attribute {
private bool visible;
///
/// Creates a new DesignTimeVisibleAttribute with the visible
/// property set to the given value.
///
public DesignTimeVisibleAttribute(bool visible) {
this.visible = visible;
}
///
/// Creates a new DesignTimeVisibleAttribute set to the default
/// value of true.
///
public DesignTimeVisibleAttribute() {
}
///
/// True if this component should be shown at design time, or false
/// if it shouldn't.
///
public bool Visible {
get {
return visible;
}
}
///
/// Marks a component as visible in a visual designer.
///
public static readonly DesignTimeVisibleAttribute Yes = new DesignTimeVisibleAttribute(true);
///
/// Marks a component as not visible in a visual designer.
///
public static readonly DesignTimeVisibleAttribute No = new DesignTimeVisibleAttribute(false);
///
/// The default visiblity. (equal to Yes.)
///
public static readonly DesignTimeVisibleAttribute Default = Yes;
///
/// [To be supplied.]
///
public override bool Equals(object obj) {
if (obj == this) {
return true;
}
DesignTimeVisibleAttribute other = obj as DesignTimeVisibleAttribute;
return other != null && other.Visible == visible;
}
///
/// [To be supplied.]
///
public override int GetHashCode() {
return typeof(DesignTimeVisibleAttribute).GetHashCode() ^ (visible ? -1 : 0);
}
///
/// [To be supplied.]
///
public override bool IsDefaultAttribute() {
return (this.Visible == Default.Visible);
}
}
}
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HiddenFieldPageStatePersister.cs
- HtmlHead.cs
- CodeDomExtensionMethods.cs
- XmlWriter.cs
- EventManager.cs
- sapiproxy.cs
- TextureBrush.cs
- GridViewAutomationPeer.cs
- _FtpControlStream.cs
- NullableConverter.cs
- StringStorage.cs
- DateTimeSerializationSection.cs
- CmsUtils.cs
- SystemColors.cs
- InputReportEventArgs.cs
- DbConnectionOptions.cs
- EntitySqlQueryState.cs
- FlowchartDesigner.xaml.cs
- SynchronizationContext.cs
- SecurityTokenRequirement.cs
- CssStyleCollection.cs
- Int32Rect.cs
- TypedTableBase.cs
- SqlRowUpdatedEvent.cs
- InputManager.cs
- DataGridViewBindingCompleteEventArgs.cs
- CalendarDay.cs
- WorkerRequest.cs
- CacheModeValueSerializer.cs
- DesignerAdapterUtil.cs
- SetStateDesigner.cs
- WindowsComboBox.cs
- _ServiceNameStore.cs
- InteropAutomationProvider.cs
- Vector3DIndependentAnimationStorage.cs
- EllipticalNodeOperations.cs
- _ContextAwareResult.cs
- CheckedPointers.cs
- SQLInt32Storage.cs
- GeneralTransformGroup.cs
- XmlAttributeOverrides.cs
- CodeComment.cs
- SqlMethodAttribute.cs
- ComponentResourceManager.cs
- IntegerValidator.cs
- PlaceHolder.cs
- UIElementParagraph.cs
- QueryOptionExpression.cs
- CompiledAction.cs
- FormViewDeleteEventArgs.cs
- StylusTip.cs
- Relationship.cs
- XmlTypeAttribute.cs
- BypassElement.cs
- ParserHooks.cs
- ErrorFormatter.cs
- BatchWriter.cs
- IResourceProvider.cs
- ErrorWebPart.cs
- DataGridAddNewRow.cs
- SafeCryptoKeyHandle.cs
- FormatConvertedBitmap.cs
- TickBar.cs
- JournalEntryStack.cs
- SingleAnimationUsingKeyFrames.cs
- InvalidOleVariantTypeException.cs
- ToolStripTextBox.cs
- SmtpFailedRecipientsException.cs
- MessageParameterAttribute.cs
- SamlAuthenticationStatement.cs
- GZipDecoder.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- BasicKeyConstraint.cs
- xmlsaver.cs
- DocumentGridContextMenu.cs
- CallSiteHelpers.cs
- SizeConverter.cs
- RequestCacheValidator.cs
- infer.cs
- InitialServerConnectionReader.cs
- ConfigXmlSignificantWhitespace.cs
- SubMenuStyleCollection.cs
- InteropBitmapSource.cs
- TypeContext.cs
- FileInfo.cs
- DataListAutoFormat.cs
- FontFaceLayoutInfo.cs
- DataTableMapping.cs
- PresentationSource.cs
- FloaterParagraph.cs
- Context.cs
- DesignBindingConverter.cs
- HierarchicalDataTemplate.cs
- _HelperAsyncResults.cs
- ThousandthOfEmRealPoints.cs
- NameValueCollection.cs
- WebHttpEndpoint.cs
- LiteralDesigner.cs
- FloatUtil.cs
- AVElementHelper.cs