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
- DelegatingTypeDescriptionProvider.cs
- CharacterBufferReference.cs
- SpeechSynthesizer.cs
- IndexOutOfRangeException.cs
- EmptyControlCollection.cs
- MessageSmuggler.cs
- RemoteWebConfigurationHostServer.cs
- AppSettingsExpressionEditor.cs
- AssemblyNameProxy.cs
- Label.cs
- Stylus.cs
- SinglePhaseEnlistment.cs
- ResourceManager.cs
- ButtonStandardAdapter.cs
- SevenBitStream.cs
- RegexStringValidator.cs
- HttpModulesSection.cs
- CollectionViewProxy.cs
- Decorator.cs
- FlowLayoutSettings.cs
- DataReaderContainer.cs
- BinaryUtilClasses.cs
- DeclaredTypeValidator.cs
- WebPartEditVerb.cs
- DiscoveryMessageSequenceCD1.cs
- Missing.cs
- CompositeScriptReferenceEventArgs.cs
- DbQueryCommandTree.cs
- CompilerResults.cs
- FileVersionInfo.cs
- OpenFileDialog.cs
- QueryAccessibilityHelpEvent.cs
- SecurityDescriptor.cs
- ILGen.cs
- MimeWriter.cs
- InvokeHandlers.cs
- SoapMessage.cs
- ApplicationFileParser.cs
- RelationshipWrapper.cs
- ListViewGroupItemCollection.cs
- XsdBuilder.cs
- TreeNodeEventArgs.cs
- XmlAnyElementAttribute.cs
- SelectionHighlightInfo.cs
- ImageMap.cs
- TextProperties.cs
- TextServicesCompartment.cs
- AsyncResult.cs
- InternalCache.cs
- WorkflowElementDialogWindow.xaml.cs
- NameValuePair.cs
- NumberAction.cs
- Rect.cs
- EdmFunctions.cs
- MatrixTransform3D.cs
- MapPathBasedVirtualPathProvider.cs
- InputBindingCollection.cs
- FieldDescriptor.cs
- ButtonStandardAdapter.cs
- CheckoutException.cs
- IgnoreFileBuildProvider.cs
- UrlMappingsSection.cs
- NullableDecimalMinMaxAggregationOperator.cs
- CodeValidator.cs
- Brush.cs
- GregorianCalendarHelper.cs
- ToolStripItemClickedEventArgs.cs
- DataGridToolTip.cs
- UnsafeNativeMethods.cs
- DSASignatureDeformatter.cs
- TrackingServices.cs
- ClientConvert.cs
- MediaScriptCommandRoutedEventArgs.cs
- CodeTypeParameter.cs
- MaterialCollection.cs
- TerminatorSinks.cs
- PropertyInformation.cs
- OdbcException.cs
- _ShellExpression.cs
- WorkflowMessageEventHandler.cs
- ZoomPercentageConverter.cs
- QueryTaskGroupState.cs
- RSAOAEPKeyExchangeFormatter.cs
- AmbientLight.cs
- FixUpCollection.cs
- ClaimSet.cs
- precedingquery.cs
- DataGridViewCellStyleConverter.cs
- DocumentPaginator.cs
- UnsafeNativeMethods.cs
- DeferredSelectedIndexReference.cs
- WindowsScroll.cs
- BaseTemplateCodeDomTreeGenerator.cs
- BuilderPropertyEntry.cs
- IdentitySection.cs
- SafeEventLogWriteHandle.cs
- FileAuthorizationModule.cs
- PackagingUtilities.cs
- QueryStringParameter.cs
- AtomContentProperty.cs