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; ////// [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); } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MemberAssignmentAnalysis.cs
- SoapFormatter.cs
- TheQuery.cs
- QueryCoreOp.cs
- ListArgumentProvider.cs
- SplayTreeNode.cs
- WindowsEditBox.cs
- RenderingBiasValidation.cs
- DynamicVirtualDiscoSearcher.cs
- HelpKeywordAttribute.cs
- MimeFormImporter.cs
- CompositeDataBoundControl.cs
- WindowClosedEventArgs.cs
- JulianCalendar.cs
- XsltQilFactory.cs
- Vector3DAnimationBase.cs
- DetailsViewDeletedEventArgs.cs
- WindowsEditBox.cs
- _HeaderInfoTable.cs
- KeyManager.cs
- BinaryMessageEncoder.cs
- DefaultValueTypeConverter.cs
- MobileCategoryAttribute.cs
- CalendarButtonAutomationPeer.cs
- AmbientProperties.cs
- BindingNavigatorDesigner.cs
- _KerberosClient.cs
- TransformDescriptor.cs
- FormViewRow.cs
- unsafenativemethodstextservices.cs
- QilPatternVisitor.cs
- Int32RectConverter.cs
- LinkButton.cs
- TreeBuilder.cs
- CodeEventReferenceExpression.cs
- RemoteWebConfigurationHost.cs
- Timer.cs
- CodeAttributeArgumentCollection.cs
- SyntaxCheck.cs
- PasswordBox.cs
- KeyEventArgs.cs
- Typeface.cs
- sqlmetadatafactory.cs
- ModelUIElement3D.cs
- GeometryDrawing.cs
- MouseOverProperty.cs
- HostedTransportConfigurationManager.cs
- Blend.cs
- OAVariantLib.cs
- NTAccount.cs
- DataStreamFromComStream.cs
- StyleSheetRefUrlEditor.cs
- CodeTypeDeclaration.cs
- Application.cs
- RuntimeHandles.cs
- TcpChannelListener.cs
- MailSettingsSection.cs
- SpellerInterop.cs
- TextServicesCompartmentContext.cs
- StringAnimationUsingKeyFrames.cs
- UnsafeNativeMethods.cs
- PageContentCollection.cs
- CompilationSection.cs
- ComponentEditorForm.cs
- ParserContext.cs
- StrokeCollection2.cs
- EnumValAlphaComparer.cs
- ThicknessKeyFrameCollection.cs
- AuthStoreRoleProvider.cs
- ProfileParameter.cs
- Positioning.cs
- TypeLoadException.cs
- BindToObject.cs
- VirtualPath.cs
- PageThemeParser.cs
- BitmapEffectOutputConnector.cs
- FixedSOMImage.cs
- HyperLinkStyle.cs
- ProviderCommandInfoUtils.cs
- GreenMethods.cs
- Assert.cs
- TableCell.cs
- WinInetCache.cs
- UnmanagedMemoryAccessor.cs
- RemoteArgument.cs
- AudioFormatConverter.cs
- CodeThrowExceptionStatement.cs
- ToolStripContentPanel.cs
- TextSelectionHighlightLayer.cs
- Double.cs
- MessageCredentialType.cs
- OpCodes.cs
- UIElement.cs
- DesignerForm.cs
- SecureUICommand.cs
- TypeInitializationException.cs
- TextTreeInsertElementUndoUnit.cs
- ModelVisual3D.cs
- HttpRequestBase.cs
- XmlNode.cs