Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- EntityFunctions.cs
- BaseResourcesBuildProvider.cs
- DeploymentSectionCache.cs
- GacUtil.cs
- WhitespaceRuleLookup.cs
- NativeObjectSecurity.cs
- ReflectPropertyDescriptor.cs
- COMException.cs
- COM2EnumConverter.cs
- HttpCachePolicyBase.cs
- Int64AnimationUsingKeyFrames.cs
- XmlSchemas.cs
- CompositionAdorner.cs
- StoreContentChangedEventArgs.cs
- JobDuplex.cs
- KeyValuePairs.cs
- PersonalizationEntry.cs
- Overlapped.cs
- CallId.cs
- XmlNotation.cs
- ServicePoint.cs
- SmiEventSink_Default.cs
- AccessorTable.cs
- BidOverLoads.cs
- PeerNameRecordCollection.cs
- WebServiceHost.cs
- SignatureHelper.cs
- DataConnectionHelper.cs
- EventManager.cs
- ViewBox.cs
- FeatureSupport.cs
- XmlSerializerAssemblyAttribute.cs
- CodeArgumentReferenceExpression.cs
- PhysicalFontFamily.cs
- SqlDataSourceQueryConverter.cs
- ScriptResourceInfo.cs
- LinqMaximalSubtreeNominator.cs
- CryptoApi.cs
- ZoomPercentageConverter.cs
- PerspectiveCamera.cs
- ProfessionalColorTable.cs
- LocalizabilityAttribute.cs
- XmlCharCheckingReader.cs
- DataGridRowEventArgs.cs
- FunctionDescription.cs
- SearchForVirtualItemEventArgs.cs
- TreeNode.cs
- CodeTypeParameter.cs
- __Filters.cs
- HttpTransportElement.cs
- PropertyMap.cs
- XmlSchemaSimpleContentExtension.cs
- LocatorManager.cs
- DataBoundControlAdapter.cs
- ParentQuery.cs
- WebPartConnectionsConnectVerb.cs
- ToolStripDropDown.cs
- IBuiltInEvidence.cs
- Thickness.cs
- FilterQuery.cs
- CodeStatement.cs
- _SafeNetHandles.cs
- XamlStyleSerializer.cs
- RandomNumberGenerator.cs
- FlowDocumentScrollViewer.cs
- CorrelationValidator.cs
- QilName.cs
- RelatedEnd.cs
- LicenseManager.cs
- BitmapCache.cs
- CellNormalizer.cs
- Italic.cs
- UnknownBitmapDecoder.cs
- DelegateArgument.cs
- ManagementInstaller.cs
- IdentityNotMappedException.cs
- RewritingSimplifier.cs
- SystemIPGlobalStatistics.cs
- IdleTimeoutMonitor.cs
- WinInetCache.cs
- RedirectionProxy.cs
- HttpHandlerAction.cs
- CodeCompileUnit.cs
- DocumentViewerConstants.cs
- AutomationPatternInfo.cs
- DataServiceHostWrapper.cs
- PriorityBinding.cs
- DrawingContext.cs
- ListParagraph.cs
- DynamicPropertyReader.cs
- MsmqOutputSessionChannel.cs
- SelectorItemAutomationPeer.cs
- AsyncResult.cs
- EventSinkHelperWriter.cs
- FromReply.cs
- PlanCompiler.cs
- WebPermission.cs
- TextBlock.cs
- XmlDataSourceNodeDescriptor.cs
- Stopwatch.cs