Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / DesignerCategoryAttribute.cs / 1305376 / 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
- CompoundFileReference.cs
- BaseInfoTable.cs
- ClientConvert.cs
- CodeIdentifiers.cs
- PropertyChangedEventManager.cs
- HttpResponseMessageProperty.cs
- DetailsViewPagerRow.cs
- RoleGroup.cs
- AnimationClockResource.cs
- XmlReflectionMember.cs
- ListManagerBindingsCollection.cs
- RequestBringIntoViewEventArgs.cs
- AsyncPostBackErrorEventArgs.cs
- ObjectManager.cs
- WSSecurityPolicy11.cs
- _TransmitFileOverlappedAsyncResult.cs
- UdpSocket.cs
- ListViewInsertedEventArgs.cs
- FileFormatException.cs
- initElementDictionary.cs
- SqlRetyper.cs
- WebPartHeaderCloseVerb.cs
- ChangeNode.cs
- processwaithandle.cs
- LookupTables.cs
- PaperSize.cs
- WindowsFormsHostAutomationPeer.cs
- ValidationRuleCollection.cs
- Viewport3DVisual.cs
- SpeechUI.cs
- ObjectContextServiceProvider.cs
- FolderLevelBuildProvider.cs
- WinCategoryAttribute.cs
- MessageBox.cs
- BufferBuilder.cs
- AppLevelCompilationSectionCache.cs
- _Rfc2616CacheValidators.cs
- CapabilitiesPattern.cs
- _StreamFramer.cs
- TextControl.cs
- TableDetailsCollection.cs
- ZipArchive.cs
- Bind.cs
- StorageFunctionMapping.cs
- InternalConfigConfigurationFactory.cs
- ConstructorNeedsTagAttribute.cs
- UserControlBuildProvider.cs
- SqlVersion.cs
- PublisherIdentityPermission.cs
- RegexEditorDialog.cs
- ToolboxBitmapAttribute.cs
- BaseHashHelper.cs
- EdmMember.cs
- prompt.cs
- ChineseLunisolarCalendar.cs
- DurableEnlistmentState.cs
- X509ChainElement.cs
- CleanUpVirtualizedItemEventArgs.cs
- DbTransaction.cs
- DesigntimeLicenseContext.cs
- HttpCookiesSection.cs
- BaseTreeIterator.cs
- ObjectReaderCompiler.cs
- HttpCacheVary.cs
- MultiDataTrigger.cs
- XmlUrlResolver.cs
- NeutralResourcesLanguageAttribute.cs
- SHA1Managed.cs
- PagePropertiesChangingEventArgs.cs
- TargetControlTypeAttribute.cs
- _AutoWebProxyScriptEngine.cs
- ClientScriptManagerWrapper.cs
- ViewGenResults.cs
- DoubleAnimationClockResource.cs
- TemplatedWizardStep.cs
- SineEase.cs
- SettingsSection.cs
- SharedPersonalizationStateInfo.cs
- DataTableNewRowEvent.cs
- basenumberconverter.cs
- DataView.cs
- ActivitiesCollection.cs
- InstanceDataCollectionCollection.cs
- PublisherMembershipCondition.cs
- DbInsertCommandTree.cs
- ObjectAnimationBase.cs
- SHA1Managed.cs
- ComboBoxRenderer.cs
- OracleException.cs
- ResXFileRef.cs
- XDRSchema.cs
- CdpEqualityComparer.cs
- WindowsGraphics.cs
- dsa.cs
- SystemNetworkInterface.cs
- HttpListenerContext.cs
- LinkedList.cs
- TextDecoration.cs
- ContentOperations.cs
- StructuralObject.cs