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
- ObjectDataSourceStatusEventArgs.cs
- ChildrenQuery.cs
- DataGridCommandEventArgs.cs
- UndoUnit.cs
- ConnectionManagementSection.cs
- WindowsAuthenticationModule.cs
- XmlSchemaAttribute.cs
- CapabilitiesPattern.cs
- StorageMappingFragment.cs
- DynamicResourceExtensionConverter.cs
- SchemaInfo.cs
- ErrorRuntimeConfig.cs
- HttpResponse.cs
- HandlerFactoryWrapper.cs
- DesignerActionGlyph.cs
- DbTransaction.cs
- QilFactory.cs
- TextUtf8RawTextWriter.cs
- DataGridViewCell.cs
- DataContractJsonSerializer.cs
- MatrixTransform3D.cs
- SR.cs
- CheckBoxRenderer.cs
- ResourcesGenerator.cs
- ApplicationServiceManager.cs
- OdbcError.cs
- LifetimeServices.cs
- DataServiceKeyAttribute.cs
- ApplicationId.cs
- AppDomainProtocolHandler.cs
- FrameSecurityDescriptor.cs
- StorageMappingItemCollection.cs
- FixedTextBuilder.cs
- KnownBoxes.cs
- OracleConnection.cs
- CodeCastExpression.cs
- UniqueConstraint.cs
- sqlcontext.cs
- ObjectDataSourceView.cs
- SafeHandles.cs
- TypeBinaryExpression.cs
- ImageMap.cs
- MDIWindowDialog.cs
- OleDbReferenceCollection.cs
- RelationshipEndMember.cs
- CapabilitiesRule.cs
- ObjectConverter.cs
- DataGridViewComboBoxColumn.cs
- SmtpNegotiateAuthenticationModule.cs
- ColorTranslator.cs
- TemplateXamlTreeBuilder.cs
- ExpandedProjectionNode.cs
- OLEDB_Enum.cs
- Int32RectConverter.cs
- XmlAttribute.cs
- Int16.cs
- TextSchema.cs
- RuntimeHandles.cs
- SafeNativeMethods.cs
- SingleStorage.cs
- TrackingServices.cs
- _AutoWebProxyScriptHelper.cs
- WorkflowStateRollbackService.cs
- SimpleLine.cs
- infer.cs
- TextUtf8RawTextWriter.cs
- CodeCatchClauseCollection.cs
- MapPathBasedVirtualPathProvider.cs
- Region.cs
- HexParser.cs
- GeometryHitTestResult.cs
- PostBackOptions.cs
- OutOfMemoryException.cs
- FontWeights.cs
- ADConnectionHelper.cs
- AnnotationService.cs
- LostFocusEventManager.cs
- ZipIOCentralDirectoryBlock.cs
- DateTime.cs
- ColorConverter.cs
- SchemaImporter.cs
- SqlException.cs
- FixedTextBuilder.cs
- Geometry.cs
- SecureUICommand.cs
- OracleEncoding.cs
- SoapIgnoreAttribute.cs
- ProfileEventArgs.cs
- VectorCollection.cs
- TemplateBindingExtensionConverter.cs
- CryptoKeySecurity.cs
- CatalogZoneBase.cs
- MaskedTextProvider.cs
- RsaSecurityToken.cs
- PlaceHolder.cs
- CompiledRegexRunner.cs
- Site.cs
- SessionParameter.cs
- TraceEventCache.cs
- ListChangedEventArgs.cs