Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / DesignerCategoryAttribute.cs / 1305376 / DesignerCategoryAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.ComponentModel { using System; using System.ComponentModel; using System.Security.Permissions; ////// [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] public sealed class DesignerCategoryAttribute : Attribute { private string category; private string typeId; ///Specifies that the designer for a class belongs to a certain /// category. ////// public static readonly DesignerCategoryAttribute Component = new DesignerCategoryAttribute("Component"); ////// Specifies that a component marked with this category uses a /// component designer. This ///field is read-only. /// /// public static readonly DesignerCategoryAttribute Default = new DesignerCategoryAttribute(); ////// Specifies that a component marked with this category cannot use a visual /// designer. This ///field is read-only. /// /// public static readonly DesignerCategoryAttribute Form = new DesignerCategoryAttribute("Form"); ////// Specifies that a component marked with this category uses a form designer. /// This ///field is read-only. /// /// public static readonly DesignerCategoryAttribute Generic = new DesignerCategoryAttribute("Designer"); ////// Specifies that a component marked with this category uses a generic designer. /// This ///field is read-only. /// /// public DesignerCategoryAttribute() { category = string.Empty; } ////// Initializes a new instance of the ///class with the /// default category. /// /// public DesignerCategoryAttribute(string category) { this.category = category; } ////// Initializes a new instance of the ///class with /// the given category name. /// /// public string Category { get { return category; } } ////// Gets the name of the category. /// ////// /// public override object TypeId { get { if (typeId == null) { typeId = GetType().FullName + Category; } return typeId; } } ////// 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 bool Equals(object obj){ if (obj == this) { return true; } DesignerCategoryAttribute other = obj as DesignerCategoryAttribute; return (other != null) && other.category == category; } /// /// public override int GetHashCode() { return category.GetHashCode(); } ///[To be supplied.] ////// ////// ////// 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; ////// [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] public sealed class DesignerCategoryAttribute : Attribute { private string category; private string typeId; ///Specifies that the designer for a class belongs to a certain /// category. ////// public static readonly DesignerCategoryAttribute Component = new DesignerCategoryAttribute("Component"); ////// Specifies that a component marked with this category uses a /// component designer. This ///field is read-only. /// /// public static readonly DesignerCategoryAttribute Default = new DesignerCategoryAttribute(); ////// Specifies that a component marked with this category cannot use a visual /// designer. This ///field is read-only. /// /// public static readonly DesignerCategoryAttribute Form = new DesignerCategoryAttribute("Form"); ////// Specifies that a component marked with this category uses a form designer. /// This ///field is read-only. /// /// public static readonly DesignerCategoryAttribute Generic = new DesignerCategoryAttribute("Designer"); ////// Specifies that a component marked with this category uses a generic designer. /// This ///field is read-only. /// /// public DesignerCategoryAttribute() { category = string.Empty; } ////// Initializes a new instance of the ///class with the /// default category. /// /// public DesignerCategoryAttribute(string category) { this.category = category; } ////// Initializes a new instance of the ///class with /// the given category name. /// /// public string Category { get { return category; } } ////// Gets the name of the category. /// ////// /// public override object TypeId { get { if (typeId == null) { typeId = GetType().FullName + Category; } return typeId; } } ////// 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 bool Equals(object obj){ if (obj == this) { return true; } DesignerCategoryAttribute other = obj as DesignerCategoryAttribute; return (other != null) && other.category == category; } /// /// public override int GetHashCode() { return category.GetHashCode(); } ///[To be supplied.] ////// ////// ////// 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
- PolicyStatement.cs
- UnicastIPAddressInformationCollection.cs
- StringSource.cs
- ResourceExpressionBuilder.cs
- SecurityTokenAttachmentMode.cs
- LinkButton.cs
- SmuggledIUnknown.cs
- EventListener.cs
- ConnectionConsumerAttribute.cs
- Converter.cs
- XmlSerializationReader.cs
- Propagator.JoinPropagator.cs
- input.cs
- QilPatternVisitor.cs
- WsdlBuildProvider.cs
- ControlCollection.cs
- CompilerGlobalScopeAttribute.cs
- DependencyPropertyHelper.cs
- SiteMapNode.cs
- CounterCreationDataConverter.cs
- ConfigurationElementProperty.cs
- CharacterMetrics.cs
- XPathNavigatorKeyComparer.cs
- AbstractDataSvcMapFileLoader.cs
- Math.cs
- XPathItem.cs
- Query.cs
- SafeRightsManagementHandle.cs
- XNodeValidator.cs
- ConfigurationValidatorBase.cs
- Comparer.cs
- StringConverter.cs
- MaxValueConverter.cs
- ProviderUtil.cs
- FormCollection.cs
- AnchoredBlock.cs
- HttpCookiesSection.cs
- RijndaelCryptoServiceProvider.cs
- InfiniteTimeSpanConverter.cs
- MetadataWorkspace.cs
- DBDataPermission.cs
- EntityDesignerBuildProvider.cs
- DataGridTablesFactory.cs
- BaseCAMarshaler.cs
- CollectionBuilder.cs
- ContractBase.cs
- DocumentReferenceCollection.cs
- PersonalizationProviderCollection.cs
- TimeManager.cs
- TripleDESCryptoServiceProvider.cs
- SpanIndex.cs
- Point4DValueSerializer.cs
- TabItem.cs
- HtmlInputFile.cs
- ServiceReference.cs
- bidPrivateBase.cs
- SchemaType.cs
- ImageCollectionCodeDomSerializer.cs
- CompiledQueryCacheKey.cs
- AvTraceDetails.cs
- PipeException.cs
- BinaryFormatterWriter.cs
- ManagementException.cs
- Sorting.cs
- MimeWriter.cs
- DeviceContext.cs
- ReflectionTypeLoadException.cs
- WebEncodingValidatorAttribute.cs
- VirtualizedItemProviderWrapper.cs
- DataKey.cs
- OnOperation.cs
- JapaneseLunisolarCalendar.cs
- webproxy.cs
- PixelShader.cs
- XmlLanguageConverter.cs
- SchemaElementDecl.cs
- X509Certificate.cs
- MarkerProperties.cs
- CustomErrorCollection.cs
- CheckBoxField.cs
- DBSqlParserTable.cs
- Control.cs
- FontNameConverter.cs
- Baml2006ReaderSettings.cs
- XmlSchemaObject.cs
- ServicePerformanceCounters.cs
- XamlHttpHandlerFactory.cs
- SafeSecurityHandles.cs
- Identity.cs
- ServicesUtilities.cs
- Dictionary.cs
- HitTestDrawingContextWalker.cs
- GridToolTip.cs
- DaylightTime.cs
- XmlnsDictionary.cs
- CqlParserHelpers.cs
- ClientBuildManagerTypeDescriptionProviderBridge.cs
- ExpandedWrapper.cs
- DataKey.cs
- SafeIUnknown.cs