Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / CompMod / System / ComponentModel / DesignerCategoryAttribute.cs / 1 / DesignerCategoryAttribute.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
*/
namespace System.ComponentModel {
using System;
using System.ComponentModel;
using System.Security.Permissions;
///
/// Specifies that the designer for a class belongs to a certain
/// category.
///
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
public sealed class DesignerCategoryAttribute : Attribute {
private string category;
private string typeId;
///
///
/// Specifies that a component marked with this category uses a
/// component designer. This field is read-only.
///
///
public static readonly DesignerCategoryAttribute Component = new DesignerCategoryAttribute("Component");
///
///
/// Specifies that a component marked with this category cannot use a visual
/// designer. This field is read-only.
///
///
public static readonly DesignerCategoryAttribute Default = new DesignerCategoryAttribute();
///
///
/// Specifies that a component marked with this category uses a form designer.
/// This field is read-only.
///
///
public static readonly DesignerCategoryAttribute Form = new DesignerCategoryAttribute("Form");
///
///
/// Specifies that a component marked with this category uses a generic designer.
/// This field is read-only.
///
///
public static readonly DesignerCategoryAttribute Generic = new DesignerCategoryAttribute("Designer");
///
///
/// Initializes a new instance of the class with the
/// default category.
///
///
public DesignerCategoryAttribute() {
category = string.Empty;
}
///
///
/// Initializes a new instance of the class with
/// the given category name.
///
///
public DesignerCategoryAttribute(string category) {
this.category = category;
}
///
///
/// Gets the name of the category.
///
///
public string Category {
get {
return category;
}
}
///
///
///
/// This defines a unique ID for this attribute type. It is used
/// by filtering algorithms to identify two attributes that are
/// the same type. For most attributes, this just returns the
/// Type instance for the attribute. DesignerAttribute overrides
/// this to include the name of the category
///
///
public override object TypeId {
get {
if (typeId == null) {
typeId = GetType().FullName + Category;
}
return typeId;
}
}
///
///
///
///
///
///
public override bool Equals(object obj){
if (obj == this) {
return true;
}
DesignerCategoryAttribute other = obj as DesignerCategoryAttribute;
return (other != null) && other.category == category;
}
///
/// [To be supplied.]
///
public override int GetHashCode() {
return category.GetHashCode();
}
///
///
///
///
///
///
public override bool IsDefaultAttribute() {
return category.Equals(Default.Category);
}
}
}
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- NotFiniteNumberException.cs
- DesignerActionItem.cs
- SiteMapHierarchicalDataSourceView.cs
- HtmlSelect.cs
- ConfigurationManagerHelperFactory.cs
- RoutedEventValueSerializer.cs
- Certificate.cs
- SettingsPropertyIsReadOnlyException.cs
- StringUtil.cs
- DataGridViewCellStyle.cs
- TypeUsage.cs
- OrderByQueryOptionExpression.cs
- Style.cs
- AccessorTable.cs
- FeatureSupport.cs
- KerberosRequestorSecurityTokenAuthenticator.cs
- Events.cs
- EmbeddedMailObjectsCollection.cs
- LoginUtil.cs
- DataGridViewRowsRemovedEventArgs.cs
- AdCreatedEventArgs.cs
- SecurityElement.cs
- KnownColorTable.cs
- ArrayElementGridEntry.cs
- Cursor.cs
- ReadWriteControlDesigner.cs
- FileEnumerator.cs
- ListBox.cs
- LogWriteRestartAreaState.cs
- ToolStripItemTextRenderEventArgs.cs
- XPathParser.cs
- ColumnReorderedEventArgs.cs
- MailWriter.cs
- X509ChainElement.cs
- HostedBindingBehavior.cs
- ListViewHitTestInfo.cs
- XslCompiledTransform.cs
- TableLayoutSettingsTypeConverter.cs
- Collection.cs
- ResourceKey.cs
- TdsParserSessionPool.cs
- ComplexTypeEmitter.cs
- OracleCommand.cs
- SymbolPair.cs
- DataGridAddNewRow.cs
- AccessedThroughPropertyAttribute.cs
- CommentAction.cs
- MultipleViewPatternIdentifiers.cs
- DocumentPageView.cs
- GlyphRun.cs
- ListViewItemEventArgs.cs
- SoapCommonClasses.cs
- SafeIUnknown.cs
- HttpValueCollection.cs
- TextEditorSelection.cs
- ContainerParagraph.cs
- Equal.cs
- ObjectResult.cs
- ContentElementAutomationPeer.cs
- WeakEventManager.cs
- SqlParameterCollection.cs
- DefaultDiscoveryService.cs
- ValidatorUtils.cs
- NumberFunctions.cs
- StateRuntime.cs
- SqlClientFactory.cs
- XsltFunctions.cs
- SectionXmlInfo.cs
- MatrixKeyFrameCollection.cs
- FormClosedEvent.cs
- _ContextAwareResult.cs
- Helper.cs
- DataServiceRequestOfT.cs
- XmlReflectionImporter.cs
- WebPartDisplayModeCollection.cs
- Journaling.cs
- ObjectListGeneralPage.cs
- DSASignatureFormatter.cs
- UserNameSecurityToken.cs
- XmlDesigner.cs
- EdmSchemaError.cs
- AxisAngleRotation3D.cs
- Hashtable.cs
- ViewCellRelation.cs
- FlowDocumentPage.cs
- Soap.cs
- TextEditorContextMenu.cs
- StrongNameUtility.cs
- ValueConversionAttribute.cs
- thaishape.cs
- Label.cs
- SqlWriter.cs
- DataGridItemCollection.cs
- CodeTypeMemberCollection.cs
- COM2ExtendedTypeConverter.cs
- DataControlButton.cs
- BitHelper.cs
- ArgumentValidation.cs
- TemplateKeyConverter.cs
- HttpHostedTransportConfiguration.cs