Code:
/ DotNET / DotNET / 8.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
- TimeSpanStorage.cs
- AttributeCollection.cs
- StrokeCollection.cs
- WebServiceHostFactory.cs
- OutOfMemoryException.cs
- ResourceExpressionBuilder.cs
- CachedPathData.cs
- Adorner.cs
- SynchronizedPool.cs
- _AutoWebProxyScriptWrapper.cs
- SqlDependency.cs
- WebBrowserBase.cs
- Int32CAMarshaler.cs
- ActivityExecutorSurrogate.cs
- AnnotationComponentChooser.cs
- MessageAction.cs
- PointAnimationUsingPath.cs
- SpellerInterop.cs
- DiagnosticStrings.cs
- XmlLanguageConverter.cs
- FixedPageAutomationPeer.cs
- MenuBase.cs
- sqlcontext.cs
- DataObjectSettingDataEventArgs.cs
- nulltextcontainer.cs
- DataControlField.cs
- RequestDescription.cs
- PreProcessInputEventArgs.cs
- ControlUtil.cs
- HandlerFactoryWrapper.cs
- RegexGroup.cs
- ObjectDisposedException.cs
- BulletedList.cs
- SimpleMailWebEventProvider.cs
- BoolExpressionVisitors.cs
- _ProxyRegBlob.cs
- ReceiveDesigner.xaml.cs
- ToolBarButton.cs
- DrawingAttributes.cs
- ReadOnlyHierarchicalDataSourceView.cs
- AuthenticationModulesSection.cs
- BinaryMethodMessage.cs
- MenuItemStyleCollectionEditor.cs
- DBDataPermissionAttribute.cs
- ListDictionaryInternal.cs
- PrimarySelectionGlyph.cs
- CacheAxisQuery.cs
- Attributes.cs
- XmlILStorageConverter.cs
- PartialCachingAttribute.cs
- HttpModulesSection.cs
- DispatcherTimer.cs
- DbConnectionPoolOptions.cs
- RotateTransform.cs
- BookmarkWorkItem.cs
- NamespaceEmitter.cs
- HttpGetServerProtocol.cs
- GeneralTransform3D.cs
- DeleteIndexBinder.cs
- Highlights.cs
- SequenceFullException.cs
- ToolBar.cs
- ProfessionalColors.cs
- SafeReversePInvokeHandle.cs
- HtmlGenericControl.cs
- HashMembershipCondition.cs
- X509Certificate2Collection.cs
- NumberSubstitution.cs
- BorderSidesEditor.cs
- ExpressionEditorAttribute.cs
- CodeAccessPermission.cs
- DesignerSerializationOptionsAttribute.cs
- COSERVERINFO.cs
- newitemfactory.cs
- URL.cs
- LayoutUtils.cs
- ObjectReaderCompiler.cs
- CustomAttribute.cs
- HttpWebRequestElement.cs
- WebPartEditVerb.cs
- XmlSchemaAttributeGroupRef.cs
- MonitoringDescriptionAttribute.cs
- ConfigurationStrings.cs
- IOException.cs
- LoginAutoFormat.cs
- XmlEntity.cs
- XmlSchemaParticle.cs
- SchemaNames.cs
- ContextMenu.cs
- StylusTip.cs
- FtpWebRequest.cs
- NamespaceDisplayAutomationPeer.cs
- ActivityExecutorSurrogate.cs
- CounterSample.cs
- SmiEventSink.cs
- RuleSettings.cs
- WCFBuildProvider.cs
- Operator.cs
- ProcessModelInfo.cs
- InternalControlCollection.cs