Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- InternalConfigHost.cs
- CharKeyFrameCollection.cs
- DataGridPagerStyle.cs
- KeyValuePairs.cs
- XpsSerializationManager.cs
- MethodAccessException.cs
- DomainLiteralReader.cs
- BrowserDefinition.cs
- SlotInfo.cs
- FilterQuery.cs
- InvalidWMPVersionException.cs
- CqlIdentifiers.cs
- DeviceFilterEditorDialog.cs
- _KerberosClient.cs
- ServiceModelConfigurationSectionCollection.cs
- SqlGatherProducedAliases.cs
- BoundField.cs
- PrinterSettings.cs
- SpeechSeg.cs
- securitycriticaldata.cs
- SystemException.cs
- InheritanceAttribute.cs
- EventMappingSettings.cs
- SatelliteContractVersionAttribute.cs
- InvokeWebService.cs
- TargetParameterCountException.cs
- PocoPropertyAccessorStrategy.cs
- XpsResourcePolicy.cs
- MsmqProcessProtocolHandler.cs
- ColorAnimation.cs
- SetterBase.cs
- InvalidDataException.cs
- ParallelQuery.cs
- ClickablePoint.cs
- DataGridDesigner.cs
- UITypeEditor.cs
- OverflowException.cs
- listitem.cs
- SchemaImporter.cs
- XmlSchemaAll.cs
- StorageComplexPropertyMapping.cs
- Matrix.cs
- ToolStripOverflow.cs
- ListBase.cs
- TimeEnumHelper.cs
- WebScriptMetadataMessage.cs
- DesignerVerbCollection.cs
- DataGridViewLayoutData.cs
- WindowsAltTab.cs
- xmlformatgeneratorstatics.cs
- SqlDataSourceAdvancedOptionsForm.cs
- COM2PropertyDescriptor.cs
- AddInProcess.cs
- AuthenticationModulesSection.cs
- TemplateBaseAction.cs
- BroadcastEventHelper.cs
- CachedFontFamily.cs
- diagnosticsswitches.cs
- SelfIssuedTokenFactoryCredential.cs
- StringValidator.cs
- Codec.cs
- ConfigXmlText.cs
- BinaryObjectReader.cs
- SamlAuthenticationStatement.cs
- BitmapSizeOptions.cs
- DoubleLinkList.cs
- UriScheme.cs
- GlyphCache.cs
- DictionaryEntry.cs
- SettingsSection.cs
- GetWinFXPath.cs
- CodeNamespace.cs
- ResXResourceSet.cs
- MessageFilter.cs
- HtmlControl.cs
- DataViewSettingCollection.cs
- StylusDevice.cs
- UIPermission.cs
- ConnectionStringsExpressionBuilder.cs
- DelayDesigner.cs
- WsdlBuildProvider.cs
- PowerStatus.cs
- DelayedRegex.cs
- DefaultClaimSet.cs
- ObfuscationAttribute.cs
- Trace.cs
- DiscreteKeyFrames.cs
- Color.cs
- DSACryptoServiceProvider.cs
- CounterCreationData.cs
- BindUriHelper.cs
- ColumnMap.cs
- XhtmlConformanceSection.cs
- TimelineClockCollection.cs
- CopyCodeAction.cs
- SqlInfoMessageEvent.cs
- WorkflowOperationBehavior.cs
- ThemeDictionaryExtension.cs
- XPathEmptyIterator.cs
- TraceFilter.cs