Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / DesignerAttribute.cs / 1305376 / 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(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ ///// 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. /// ///// 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(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007./// 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
- SelectionItemPatternIdentifiers.cs
- Site.cs
- CheckBoxFlatAdapter.cs
- ApplicationProxyInternal.cs
- AspCompat.cs
- MouseButton.cs
- BoolLiteral.cs
- AttributeCollection.cs
- RemotingSurrogateSelector.cs
- ControlOperationBehavior.cs
- SqlDataAdapter.cs
- Bezier.cs
- Gdiplus.cs
- ScrollPatternIdentifiers.cs
- TextServicesCompartment.cs
- IisTraceWebEventProvider.cs
- Rectangle.cs
- DoubleKeyFrameCollection.cs
- UICuesEvent.cs
- ScaleTransform.cs
- Configuration.cs
- UnsafeNativeMethods.cs
- NeutralResourcesLanguageAttribute.cs
- FlowDocumentPaginator.cs
- HyperLinkColumn.cs
- XmlWhitespace.cs
- CreateInstanceBinder.cs
- safesecurityhelperavalon.cs
- SelectedDatesCollection.cs
- EventMappingSettingsCollection.cs
- TrackingQuery.cs
- IntSumAggregationOperator.cs
- SafeIUnknown.cs
- IgnorePropertiesAttribute.cs
- Command.cs
- GridItemCollection.cs
- FillRuleValidation.cs
- SessionEndingEventArgs.cs
- DelimitedListTraceListener.cs
- ReaderWriterLock.cs
- SplineKeyFrames.cs
- AsymmetricKeyExchangeFormatter.cs
- ErrorReporting.cs
- InputScope.cs
- Crc32.cs
- SelectionProcessor.cs
- ReadContentAsBinaryHelper.cs
- ThumbAutomationPeer.cs
- XmlSchemaIdentityConstraint.cs
- _UriTypeConverter.cs
- ResolveInfo.cs
- CriticalHandle.cs
- TextModifier.cs
- CheckableControlBaseAdapter.cs
- BitVector32.cs
- StylusPointPropertyUnit.cs
- SizeChangedEventArgs.cs
- VariableReference.cs
- AcceleratedTokenAuthenticator.cs
- DefinitionProperties.cs
- CompositeDataBoundControl.cs
- ReachVisualSerializer.cs
- DetailsViewDeleteEventArgs.cs
- ProxyGenerationError.cs
- SyndicationPerson.cs
- Recipient.cs
- KeyInterop.cs
- ObjectHelper.cs
- DataObjectFieldAttribute.cs
- WindowsRichEdit.cs
- CodeTryCatchFinallyStatement.cs
- RadioButton.cs
- SwitchDesigner.xaml.cs
- ColumnTypeConverter.cs
- SetStateDesigner.cs
- WebPartDisplayModeCancelEventArgs.cs
- _CookieModule.cs
- CryptoApi.cs
- AsymmetricSignatureFormatter.cs
- TabControl.cs
- EditorBrowsableAttribute.cs
- KeySpline.cs
- IpcPort.cs
- RelOps.cs
- DBSqlParserColumn.cs
- MembershipAdapter.cs
- XsdValidatingReader.cs
- WebPartTracker.cs
- MessageQueuePermission.cs
- UserNamePasswordValidator.cs
- Keyboard.cs
- Vector3DAnimationUsingKeyFrames.cs
- SurrogateChar.cs
- RandomNumberGenerator.cs
- UrlParameterWriter.cs
- Serializer.cs
- ImageInfo.cs
- WindowsBrush.cs
- DataObjectCopyingEventArgs.cs
- AtomServiceDocumentSerializer.cs