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
- ListItemParagraph.cs
- WebServiceClientProxyGenerator.cs
- BooleanAnimationBase.cs
- StorageConditionPropertyMapping.cs
- Set.cs
- InternalsVisibleToAttribute.cs
- HttpDictionary.cs
- BinaryFormatter.cs
- SQLBinaryStorage.cs
- JoinGraph.cs
- ReachSerializerAsync.cs
- NativeMethods.cs
- DesignerActionTextItem.cs
- TransformConverter.cs
- BinaryConverter.cs
- MultipartIdentifier.cs
- CustomAttribute.cs
- WebHttpEndpointElement.cs
- SyntaxCheck.cs
- SoapExtensionTypeElement.cs
- XmlSchemaGroup.cs
- SafeRegistryHandle.cs
- BuildProvider.cs
- StreamGeometryContext.cs
- ManipulationDelta.cs
- CaseInsensitiveOrdinalStringComparer.cs
- ProcessHostServerConfig.cs
- ServiceManager.cs
- ZipIOExtraFieldPaddingElement.cs
- PasswordTextContainer.cs
- SqlIdentifier.cs
- ByteKeyFrameCollection.cs
- PeerContact.cs
- AssemblyCache.cs
- SchemaHelper.cs
- QuaternionConverter.cs
- HybridDictionary.cs
- RowBinding.cs
- SharedPersonalizationStateInfo.cs
- DataServiceProcessingPipelineEventArgs.cs
- AssertSection.cs
- MenuItemCollectionEditorDialog.cs
- DbProviderFactories.cs
- TreeNodeCollection.cs
- FileSecurity.cs
- RouteValueDictionary.cs
- DescendantOverDescendantQuery.cs
- WebPartEditVerb.cs
- ComboBoxItem.cs
- Filter.cs
- VectorKeyFrameCollection.cs
- FillErrorEventArgs.cs
- DataGridViewSelectedRowCollection.cs
- ExtensionWindow.cs
- FixedDocumentPaginator.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- ApplicationManager.cs
- DtrList.cs
- FrameworkContextData.cs
- AndCondition.cs
- CodeGotoStatement.cs
- _ServiceNameStore.cs
- COMException.cs
- DictionaryItemsCollection.cs
- PermissionAttributes.cs
- EncryptedKey.cs
- LinqDataSourceInsertEventArgs.cs
- ChangesetResponse.cs
- DataListCommandEventArgs.cs
- SecurityTokenParametersEnumerable.cs
- ConfigurationProperty.cs
- AtomMaterializer.cs
- DetailsViewRowCollection.cs
- XPathDocumentNavigator.cs
- StrokeSerializer.cs
- DrawingState.cs
- StagingAreaInputItem.cs
- RecognizedPhrase.cs
- Int64.cs
- ServiceModelEnumValidator.cs
- CopyAction.cs
- ViewLoader.cs
- AnnotationHighlightLayer.cs
- DocumentGridPage.cs
- ObjectConverter.cs
- WebPartsSection.cs
- ExpressionDumper.cs
- dbdatarecord.cs
- DrawingGroupDrawingContext.cs
- xmlsaver.cs
- SafeNativeMethods.cs
- DataControlPagerLinkButton.cs
- ProtocolElementCollection.cs
- PartialArray.cs
- IndentTextWriter.cs
- DrawingVisual.cs
- MarkerProperties.cs
- FlowDocumentScrollViewer.cs
- ButtonBase.cs
- SendMailErrorEventArgs.cs