Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / EditorAttribute.cs / 1305376 / EditorAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.ComponentModel { using System.Diagnostics; using System.Globalization; using System.Security.Permissions; ////// [AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)] public sealed class EditorAttribute : Attribute { private string baseTypeName; private string typeName; private string typeId; ///Specifies the editor to use to change a property. This class cannot be inherited. ////// public EditorAttribute() { this.typeName = string.Empty; this.baseTypeName = string.Empty; } ///Initializes a new instance of the ///class with the default editor, which is /// no editor. /// public EditorAttribute(string typeName, string baseTypeName) { string temp = typeName.ToUpper(CultureInfo.InvariantCulture); Debug.Assert(temp.IndexOf(".DLL") == -1, "Came across: " + typeName + " . Please remove the .dll extension"); this.typeName = typeName; this.baseTypeName = baseTypeName; } ///Initializes a new instance of the ///class with the type name and base type /// name of the editor. /// public EditorAttribute(string typeName, Type baseType) { string temp = typeName.ToUpper(CultureInfo.InvariantCulture); Debug.Assert(temp.IndexOf(".DLL") == -1, "Came across: " + typeName + " . Please remove the .dll extension"); this.typeName = typeName; this.baseTypeName = baseType.AssemblyQualifiedName; } ///Initializes a new instance of the ///class. /// public EditorAttribute(Type type, Type baseType) { this.typeName = type.AssemblyQualifiedName; this.baseTypeName = baseType.AssemblyQualifiedName; } ///Initializes a new instance of the ////// class. /// public string EditorBaseTypeName { get { return baseTypeName; } } ///Gets the name of the base class or interface serving as a lookup key for this editor. ////// public string EditorTypeName { get { return typeName; } } ///Gets the name of the editor class. ////// /// public override object TypeId { get { if (typeId == null) { string baseType = baseTypeName; 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; } EditorAttribute other = obj as EditorAttribute; return (other != null) && other.typeName == typeName && other.baseTypeName == baseTypeName; } public override int GetHashCode() { return base.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. EditorAttribute overrides /// this to include the type of the editor base type. /// ///
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- FrameworkObject.cs
- FloaterParaClient.cs
- MasterPageCodeDomTreeGenerator.cs
- EngineSiteSapi.cs
- SessionStateSection.cs
- Assembly.cs
- RoutedPropertyChangedEventArgs.cs
- GenericTypeParameterBuilder.cs
- BamlLocalizableResourceKey.cs
- ProxyBuilder.cs
- SubMenuStyleCollectionEditor.cs
- UnknownBitmapEncoder.cs
- SslStream.cs
- CharacterMetrics.cs
- DataMisalignedException.cs
- TableRow.cs
- SplitterPanel.cs
- FileDialogCustomPlace.cs
- DataServiceHost.cs
- DeferredElementTreeState.cs
- SQLDouble.cs
- GlyphRun.cs
- COMException.cs
- DoubleIndependentAnimationStorage.cs
- ScriptIgnoreAttribute.cs
- SerializableTypeCodeDomSerializer.cs
- XPathNodeList.cs
- PTUtility.cs
- DesignOnlyAttribute.cs
- EntitySqlQueryCacheKey.cs
- SchemeSettingElement.cs
- RoutingEndpointTrait.cs
- DeobfuscatingStream.cs
- PointLightBase.cs
- XmlnsPrefixAttribute.cs
- DockProviderWrapper.cs
- RowUpdatingEventArgs.cs
- DateTimePicker.cs
- ListParaClient.cs
- QilXmlReader.cs
- Math.cs
- SemanticAnalyzer.cs
- NavigationPropertyEmitter.cs
- TraceInternal.cs
- TargetPerspective.cs
- ListControlDesigner.cs
- FontStretches.cs
- CryptoHelper.cs
- PipelineModuleStepContainer.cs
- QilTernary.cs
- PersonalizableTypeEntry.cs
- Profiler.cs
- GetReadStreamResult.cs
- VectorCollection.cs
- ApplicationServicesHostFactory.cs
- SendAgentStatusRequest.cs
- ElementProxy.cs
- GrowingArray.cs
- EventSourceCreationData.cs
- entityreference_tresulttype.cs
- GridViewEditEventArgs.cs
- DocumentGrid.cs
- XsltCompileContext.cs
- BypassElementCollection.cs
- OpenFileDialog.cs
- WebEncodingValidator.cs
- Utility.cs
- XamlDesignerSerializationManager.cs
- SelectionProviderWrapper.cs
- RtfControlWordInfo.cs
- ListViewEditEventArgs.cs
- ThreadStaticAttribute.cs
- Window.cs
- SplineQuaternionKeyFrame.cs
- SafeHandles.cs
- UInt32.cs
- IODescriptionAttribute.cs
- XPathScanner.cs
- XmlSchemaException.cs
- COM2ColorConverter.cs
- PropertyMetadata.cs
- ToolStripMenuItem.cs
- AttachedAnnotation.cs
- ManifestResourceInfo.cs
- WebPartEditorCancelVerb.cs
- EditorZoneAutoFormat.cs
- ApplicationId.cs
- XmlTypeMapping.cs
- RNGCryptoServiceProvider.cs
- SqlTopReducer.cs
- CollectionView.cs
- BamlResourceSerializer.cs
- XmlCustomFormatter.cs
- DataGridItemCollection.cs
- DeclarationUpdate.cs
- FunctionUpdateCommand.cs
- ListViewInsertEventArgs.cs
- SequenceDesigner.cs
- MatrixAnimationBase.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs