Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / CompMod / System / ComponentModel / DesignerAttribute.cs / 1 / DesignerAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.ComponentModel { using System; using System.ComponentModel; using System.ComponentModel.Design; using System.Diagnostics; using System.Globalization; using System.Security.Permissions; ////// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = true, Inherited = true)] public sealed class DesignerAttribute : Attribute { private readonly string designerTypeName; private readonly string designerBaseTypeName; private string typeId; ///Specifies the class to use to implement design-time services. ////// public DesignerAttribute(string designerTypeName) { string temp = designerTypeName.ToUpper(CultureInfo.InvariantCulture); Debug.Assert(temp.IndexOf(".DLL") == -1, "Came across: " + designerTypeName + " . Please remove the .dll extension"); this.designerTypeName = designerTypeName; this.designerBaseTypeName = typeof(IDesigner).FullName; } ////// Initializes a new instance of the ///class using the name of the type that /// provides design-time services. /// /// public DesignerAttribute(Type designerType) { this.designerTypeName = designerType.AssemblyQualifiedName; this.designerBaseTypeName = typeof(IDesigner).FullName; } ////// Initializes a new instance of the ///class using the type that provides /// design-time services. /// /// public DesignerAttribute(string designerTypeName, string designerBaseTypeName) { string temp = designerTypeName.ToUpper(CultureInfo.InvariantCulture); Debug.Assert(temp.IndexOf(".DLL") == -1, "Came across: " + designerTypeName + " . Please remove the .dll extension"); this.designerTypeName = designerTypeName; this.designerBaseTypeName = designerBaseTypeName; } ////// Initializes a new instance of the ///class using the designer type and the /// base class for the designer. /// /// public DesignerAttribute(string designerTypeName, Type designerBaseType) { string temp = designerTypeName.ToUpper(CultureInfo.InvariantCulture); Debug.Assert(temp.IndexOf(".DLL") == -1, "Came across: " + designerTypeName + " . Please remove the .dll extension"); this.designerTypeName = designerTypeName; this.designerBaseTypeName = designerBaseType.AssemblyQualifiedName; } ////// Initializes a new instance of the ///class, using the name of the designer /// class and the base class for the designer. /// /// public DesignerAttribute(Type designerType, Type designerBaseType) { this.designerTypeName = designerType.AssemblyQualifiedName; this.designerBaseTypeName = designerBaseType.AssemblyQualifiedName; } ////// Initializes a new instance of the ///class using the types of the designer and /// designer base class. /// /// public string DesignerBaseTypeName { get { return designerBaseTypeName; } } ////// Gets /// the name of the base type of this designer. /// ////// public string DesignerTypeName { get { return designerTypeName; } } ////// Gets the name of the designer type associated with this designer attribute. /// ////// /// public override object TypeId { get { if (typeId == null) { string baseType = designerBaseTypeName; int comma = baseType.IndexOf(','); if (comma != -1) { baseType = baseType.Substring(0, comma); } typeId = GetType().FullName + baseType; } return typeId; } } public override bool Equals(object obj) { if (obj == this) { return true; } DesignerAttribute other = obj as DesignerAttribute; return (other != null) && other.designerBaseTypeName == designerBaseTypeName && other.designerTypeName == designerTypeName; } public override int GetHashCode() { return designerTypeName.GetHashCode() ^ designerBaseTypeName.GetHashCode(); } } }/// 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 type of the designer base type. /// ///
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ListBase.cs
- KeyManager.cs
- ConfigUtil.cs
- basemetadatamappingvisitor.cs
- SoapFault.cs
- MethodSet.cs
- DataBinder.cs
- XsltFunctions.cs
- HtmlInputText.cs
- Screen.cs
- UInt16Converter.cs
- TypeDescriptionProviderAttribute.cs
- RegisteredHiddenField.cs
- DispatcherExceptionEventArgs.cs
- TextBoxRenderer.cs
- LocalizedNameDescriptionPair.cs
- BmpBitmapEncoder.cs
- XPathNodeHelper.cs
- PropertyDescriptorGridEntry.cs
- ZipIORawDataFileBlock.cs
- UserControl.cs
- BrowserCapabilitiesFactoryBase.cs
- httpstaticobjectscollection.cs
- VisualStyleRenderer.cs
- NumberSubstitution.cs
- TryLoadRunnableWorkflowCommand.cs
- Menu.cs
- __ConsoleStream.cs
- EntityClientCacheKey.cs
- StringHandle.cs
- UnsafeNativeMethods.cs
- CurrentTimeZone.cs
- RequestedSignatureDialog.cs
- BulletedListEventArgs.cs
- RowCache.cs
- DesignerResources.cs
- MissingMethodException.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- SelectionRange.cs
- BinaryObjectReader.cs
- ModifyActivitiesPropertyDescriptor.cs
- MarshalDirectiveException.cs
- DBConnection.cs
- SettingsProperty.cs
- ParallelEnumerable.cs
- TreeIterators.cs
- TagMapCollection.cs
- EditingMode.cs
- ContentType.cs
- MessageQueuePermissionEntryCollection.cs
- BuildManager.cs
- ListViewGroupConverter.cs
- MetadataItemCollectionFactory.cs
- Latin1Encoding.cs
- LocationEnvironment.cs
- GPRECTF.cs
- PathFigureCollection.cs
- ToolboxComponentsCreatingEventArgs.cs
- contentDescriptor.cs
- XmlElement.cs
- SizeAnimationClockResource.cs
- RelationshipEnd.cs
- FunctionQuery.cs
- SiblingIterators.cs
- FilteredXmlReader.cs
- TableStyle.cs
- Main.cs
- HtmlString.cs
- XsltSettings.cs
- TextEditorDragDrop.cs
- QueryGeneratorBase.cs
- BoundField.cs
- DbParameterCollectionHelper.cs
- WsdlParser.cs
- EditableRegion.cs
- SerialStream.cs
- SecurityRequiresReviewAttribute.cs
- CommandHelpers.cs
- HtmlMeta.cs
- PeerCollaboration.cs
- RequiredAttributeAttribute.cs
- ToolBar.cs
- ToolboxItemCollection.cs
- ConfigurationElement.cs
- PropertyValueUIItem.cs
- ResourceReferenceExpressionConverter.cs
- DataRow.cs
- XmlSignificantWhitespace.cs
- SqlDataSourceParameterParser.cs
- SQLUtility.cs
- AsymmetricSignatureFormatter.cs
- PassportAuthenticationModule.cs
- _LocalDataStoreMgr.cs
- SettingsPropertyValue.cs
- MouseDevice.cs
- ToolStripItemImageRenderEventArgs.cs
- CustomAssemblyResolver.cs
- EntityTypeEmitter.cs
- ToolboxItemAttribute.cs
- _ReceiveMessageOverlappedAsyncResult.cs