Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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);
}
}
}
// 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.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);
}
}
}
// 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
- HtmlControlDesigner.cs
- TranslateTransform3D.cs
- Drawing.cs
- log.cs
- ResXResourceReader.cs
- User.cs
- CodeSnippetTypeMember.cs
- SmiContextFactory.cs
- XmlEncoding.cs
- XsltException.cs
- ButtonColumn.cs
- UrlMappingCollection.cs
- ObjectTag.cs
- TreeIterators.cs
- TextTrailingWordEllipsis.cs
- FilterException.cs
- Resources.Designer.cs
- EntitySetBase.cs
- LogReserveAndAppendState.cs
- CodeTryCatchFinallyStatement.cs
- RtfControlWordInfo.cs
- CacheEntry.cs
- DefaultParameterValueAttribute.cs
- assemblycache.cs
- MethodBuilder.cs
- XmlValueConverter.cs
- OpenTypeCommon.cs
- EntityPropertyMappingAttribute.cs
- SrgsNameValueTag.cs
- FreezableCollection.cs
- XmlDictionaryString.cs
- PriorityQueue.cs
- ImageUrlEditor.cs
- ExtentJoinTreeNode.cs
- ValueProviderWrapper.cs
- TouchPoint.cs
- GreenMethods.cs
- WebBrowserNavigatedEventHandler.cs
- StylusPointPropertyInfo.cs
- ByteStream.cs
- DriveInfo.cs
- UriSchemeKeyedCollection.cs
- ThreadStateException.cs
- DirectoryObjectSecurity.cs
- XmlDictionaryReaderQuotas.cs
- CompositeFontFamily.cs
- WorkflowDataContext.cs
- TreeWalkHelper.cs
- GridViewAutomationPeer.cs
- FileEnumerator.cs
- FormsAuthentication.cs
- CompareValidator.cs
- CodePageEncoding.cs
- ListenerElementsCollection.cs
- XPathMultyIterator.cs
- DataRecord.cs
- AndCondition.cs
- SymbolPair.cs
- ListView.cs
- DecimalStorage.cs
- RoutedEvent.cs
- ChangeToolStripParentVerb.cs
- CheckPair.cs
- ExtensibleClassFactory.cs
- ParameterToken.cs
- CngProvider.cs
- GenericAuthenticationEventArgs.cs
- AddingNewEventArgs.cs
- FuncTypeConverter.cs
- FileLogRecord.cs
- RuntimeEnvironment.cs
- MenuCommandService.cs
- OdbcUtils.cs
- SecurityPolicySection.cs
- EntityDataSourceViewSchema.cs
- PackageDigitalSignature.cs
- UnaryExpression.cs
- WorkflowTransactionOptions.cs
- JsonEnumDataContract.cs
- TypeCollectionDesigner.xaml.cs
- SqlBinder.cs
- SqlInfoMessageEvent.cs
- CompositeCollectionView.cs
- RecognizerStateChangedEventArgs.cs
- UpdateException.cs
- PropertyMetadata.cs
- BooleanSwitch.cs
- SqlConnectionManager.cs
- Lasso.cs
- ToolStripArrowRenderEventArgs.cs
- InkPresenter.cs
- DbUpdateCommandTree.cs
- HttpChannelHelper.cs
- SafeSecurityHandles.cs
- AxHost.cs
- TdsValueSetter.cs
- WebUtil.cs
- PrintingPermissionAttribute.cs
- SchemaElementLookUpTable.cs
- connectionpool.cs