Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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; ////// [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
- WebRequestModulesSection.cs
- GridItemPattern.cs
- PropertyAccessVisitor.cs
- BindingExpressionBase.cs
- MultiPartWriter.cs
- metadatamappinghashervisitor.cs
- DbConnectionPoolGroup.cs
- EventSource.cs
- DropTarget.cs
- SchemaObjectWriter.cs
- UnorderedHashRepartitionStream.cs
- Size.cs
- RankException.cs
- DataControlLinkButton.cs
- ConnectionStringsExpressionBuilder.cs
- SourceElementsCollection.cs
- MediaSystem.cs
- AttributeExtensions.cs
- VariableBinder.cs
- InternalControlCollection.cs
- CatalogZone.cs
- SrgsElementFactory.cs
- BatchParser.cs
- DeviceContext.cs
- SpecularMaterial.cs
- CurrencyWrapper.cs
- DefaultTextStore.cs
- StrongNamePublicKeyBlob.cs
- AutomationProperty.cs
- SerializationStore.cs
- HttpCapabilitiesBase.cs
- PageRanges.cs
- ValidatingReaderNodeData.cs
- ArrayTypeMismatchException.cs
- ConnectionStringsExpressionBuilder.cs
- _LocalDataStoreMgr.cs
- NameObjectCollectionBase.cs
- EventHandlerList.cs
- _LazyAsyncResult.cs
- SqlCommand.cs
- ImageListImageEditor.cs
- LoadWorkflowByKeyAsyncResult.cs
- TabPage.cs
- SettingsPropertyNotFoundException.cs
- MappingModelBuildProvider.cs
- DeclarativeCatalogPart.cs
- ConstructorBuilder.cs
- SupportingTokenBindingElement.cs
- DifferencingCollection.cs
- ExcCanonicalXml.cs
- CompilationRelaxations.cs
- MailAddressCollection.cs
- NavigationProperty.cs
- ObjectReaderCompiler.cs
- PropertyInformation.cs
- OverloadGroupAttribute.cs
- SemanticKeyElement.cs
- BamlLocalizer.cs
- WebPartDisplayModeCancelEventArgs.cs
- DefaultValueConverter.cs
- RtfFormatStack.cs
- UpdatePanelTrigger.cs
- LinearGradientBrush.cs
- OlePropertyStructs.cs
- GeneralTransform3DTo2DTo3D.cs
- CultureInfoConverter.cs
- _ListenerResponseStream.cs
- PropertyPushdownHelper.cs
- TypeLibConverter.cs
- SessionEndedEventArgs.cs
- CodeDOMProvider.cs
- RowUpdatingEventArgs.cs
- DocumentPage.cs
- IndependentAnimationStorage.cs
- IndexedEnumerable.cs
- ProfileSettingsCollection.cs
- ColumnCollection.cs
- TimelineCollection.cs
- ObjectStateManager.cs
- JoinTreeNode.cs
- ExpressionCopier.cs
- DataBoundControlAdapter.cs
- InputMethod.cs
- FormsAuthenticationConfiguration.cs
- JournalEntryListConverter.cs
- EndOfStreamException.cs
- WindowsListView.cs
- UxThemeWrapper.cs
- XmlAttribute.cs
- arabicshape.cs
- EncoderParameter.cs
- AspNetHostingPermission.cs
- FragmentQueryKB.cs
- CodeNamespaceCollection.cs
- OracleParameter.cs
- VersionedStreamOwner.cs
- ReadingWritingEntityEventArgs.cs
- InvalidPropValue.cs
- XmlSerializerAssemblyAttribute.cs
- InlinedLocationReference.cs