Este artículo se tradujo de forma manual. Mueva el puntero sobre las frases del artículo para ver el texto original.
Traducción
Original
Este tema aún no ha recibido ninguna valoración - Valorar este tema

AssemblyTitleAttribute (Clase)

Especifica una descripción para un ensamblado.

System.Object
  System.Attribute
    System.Reflection.AssemblyTitleAttribute

Espacio de nombres:  System.Reflection
Ensamblado:  mscorlib (en mscorlib.dll)
[ComVisibleAttribute(true)]
[AttributeUsageAttribute(AttributeTargets.Assembly, Inherited = false)]
public sealed class AssemblyTitleAttribute : Attribute

El tipo AssemblyTitleAttribute expone los siguientes miembros.

  NombreDescripción
Método públicoCompatible con XNA Frameworkzf8bbayf.PortableClassLibrary(es-es,VS.100).gifAssemblyTitleAttributeInicializa una nueva instancia de la clase AssemblyTitleAttribute.
Arriba
  NombreDescripción
Propiedad públicaCompatible con XNA Frameworkzf8bbayf.PortableClassLibrary(es-es,VS.100).gifTitleObtiene la información de título del ensamblado.
Propiedad públicaTypeIdCuando se implementa en una clase derivada, obtiene un identificador único para este Attribute. (Se hereda de Attribute).
Arriba
  NombreDescripción
Método públicoCompatible con XNA Frameworkzf8bbayf.PortableClassLibrary(es-es,VS.100).gifEqualsInfraestructura. Devuelve un valor que indica si esta instancia equivale a un objeto especificado. (Se hereda de Attribute).
Método protegidoCompatible con XNA Frameworkzf8bbayf.PortableClassLibrary(es-es,VS.100).gifFinalize Permite que un objeto intente liberar recursos y realizar otras operaciones de limpieza antes de ser reclamado por la recolección de elementos no utilizados. (Se hereda de Object).
Método públicoCompatible con XNA Frameworkzf8bbayf.PortableClassLibrary(es-es,VS.100).gifGetHashCodeDevuelve el código hash de esta instancia. (Se hereda de Attribute).
Método públicoCompatible con XNA Frameworkzf8bbayf.PortableClassLibrary(es-es,VS.100).gifGetTypeObtiene el objeto Type de la instancia actual. (Se hereda de Object).
Método públicoIsDefaultAttributeCuando se reemplaza en una clase derivada, indica si el valor de esta instancia es el valor predeterminado para la clase derivada. (Se hereda de Attribute).
Método públicoCompatible con XNA FrameworkMatchCuando se reemplaza en una clase derivada, devuelve un valor que indica si esta instancia es igual a un objeto especificado. (Se hereda de Attribute).
Método protegidoCompatible con XNA Frameworkzf8bbayf.PortableClassLibrary(es-es,VS.100).gifMemberwiseClone Crea una copia superficial del Object actual. (Se hereda de Object).
Método públicoCompatible con XNA Frameworkzf8bbayf.PortableClassLibrary(es-es,VS.100).gifToStringDevuelve una cadena que representa el objeto actual. (Se hereda de Object).
Arriba
  NombreDescripción
Implementación explícita de interfacesMétodo privado_Attribute.GetIDsOfNamesAsigna un conjunto de nombres a un conjunto correspondiente de identificadores de envío. (Se hereda de Attribute).
Implementación explícita de interfacesMétodo privado_Attribute.GetTypeInfoObtiene la información de tipos de un objeto, que puede utilizarse para obtener la información de tipos de una interfaz. (Se hereda de Attribute).
Implementación explícita de interfacesMétodo privado_Attribute.GetTypeInfoCount

Recupera el número de interfaces de tipo de información que suministra un objeto (0 ó 1)

(Se hereda de Attribute).
Implementación explícita de interfacesMétodo privado_Attribute.InvokeProporciona acceso a las propiedades y los métodos expuestos por un objeto. (Se hereda de Attribute).
Arriba

El título del ensamblado es un nombre descriptivo, que puede incluir espacios.

En Windows Vista, la información especificada para este atributo aparece en la pestaña Detalles del cuadro de diálogo Propiedades de archivo de Windows del ensamblado. El nombre de la propiedad es File description. En Windows XP, esta información aparece en la pestaña Versión del cuadro de diálogo Propiedades de archivo de Windows.

El ejemplo siguiente muestra cómo agregar atributos, incluido el atributo AssemblyTitleAttribute, a un ensamblado dinámico. El ejemplo guarda el ensamblado en el disco y el valor de atributo se puede ver utilizando el cuadro de diálogo Propiedades de archivo de Windows.


using System;
using System.Reflection;
using System.Reflection.Emit;

class Example
{
   public static void Main()
   {
      AssemblyName assemName = new AssemblyName();
      assemName.Name = "EmittedAssembly";

      // Create a dynamic assembly in the current application domain,
      // specifying that the assembly is to be saved.
      //
      AssemblyBuilder myAssembly = 
         AppDomain.CurrentDomain.DefineDynamicAssembly(assemName, 
            AssemblyBuilderAccess.Save);


      // To apply an attribute to a dynamic assembly, first get the 
      // attribute type. The AssemblyFileVersionAttribute sets the 
      // File Version field on the Version tab of the Windows file
      // properties dialog.
      //
      Type attributeType = typeof(AssemblyFileVersionAttribute);

      // To identify the constructor, use an array of types representing
      // the constructor's parameter types. This ctor takes a string.
      //
      Type[] ctorParameters = { typeof(string) };

      // Get the constructor for the attribute.
      //
      ConstructorInfo ctor = attributeType.GetConstructor(ctorParameters);

      // Pass the constructor and an array of arguments (in this case,
      // an array containing a single string) to the 
      // CustomAttributeBuilder constructor.
      //
      object[] ctorArgs = { "2.0.3033.0" };
      CustomAttributeBuilder attribute = 
         new CustomAttributeBuilder(ctor, ctorArgs);

      // Finally, apply the attribute to the assembly.
      //
      myAssembly.SetCustomAttribute(attribute);


      // The pattern described above is used to create and apply
      // several more attributes. As it happens, all these attributes
      // have a constructor that takes a string, so the same ctorArgs
      // variable works for all of them.


      // The AssemblyTitleAttribute sets the Description field on
      // the General tab and the Version tab of the Windows file 
      // properties dialog.
      //
      attributeType = typeof(AssemblyTitleAttribute);
      ctor = attributeType.GetConstructor(ctorParameters);
      ctorArgs = new object[] { "The Application Title" };
      attribute = new CustomAttributeBuilder(ctor, ctorArgs);
      myAssembly.SetCustomAttribute(attribute);

      // The AssemblyCopyrightAttribute sets the Copyright field on
      // the Version tab.
      //
      attributeType = typeof(AssemblyCopyrightAttribute);
      ctor = attributeType.GetConstructor(ctorParameters);
      ctorArgs = new object[] { "� My Example Company 1991-2005" };
      attribute = new CustomAttributeBuilder(ctor, ctorArgs);
      myAssembly.SetCustomAttribute(attribute);

      // The AssemblyDescriptionAttribute sets the Comment item.
      //
      attributeType = typeof(AssemblyDescriptionAttribute);
      ctor = attributeType.GetConstructor(ctorParameters);
      attribute = new CustomAttributeBuilder(ctor, 
         new object[] { "This is a comment." });
      myAssembly.SetCustomAttribute(attribute);

      // The AssemblyCompanyAttribute sets the Company item.
      //
      attributeType = typeof(AssemblyCompanyAttribute);
      ctor = attributeType.GetConstructor(ctorParameters);
      attribute = new CustomAttributeBuilder(ctor, 
         new object[] { "My Example Company" });
      myAssembly.SetCustomAttribute(attribute);

      // The AssemblyProductAttribute sets the Product Name item.
      //
      attributeType = typeof(AssemblyProductAttribute);
      ctor = attributeType.GetConstructor(ctorParameters);
      attribute = new CustomAttributeBuilder(ctor, 
         new object[] { "My Product Name" });
      myAssembly.SetCustomAttribute(attribute);


      // Define the assembly's only module. For a single-file assembly,
      // the module name is the assembly name.
      //
      ModuleBuilder myModule = 
         myAssembly.DefineDynamicModule(assemName.Name, 
            assemName.Name + ".exe");

      // No types or methods are created for this example.


      // Define the unmanaged version information resource, which
      // contains the attribute informaion applied earlier, and save
      // the assembly. Use the Windows Explorer to examine the properties
      // of the .exe file.
      //
      myAssembly.DefineVersionInfoResource();
      myAssembly.Save(assemName.Name + ".exe");

   }
}


.NET Framework

Compatible con: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Compatible con: 4, 3.5 SP1

Compatible con:

Windows 7, Windows Vista SP1 o posterior, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (no se admite Server Core), Windows Server 2008 R2 (se admite Server Core con SP1 o posterior), Windows Server 2003 SP2

.NET Framework no admite todas las versiones de todas las plataformas. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.
Todos los miembros static (Shared en Visual Basic) públicos de este tipo son seguros para la ejecución de subprocesos. No se garantiza que los miembros de instancias sean seguros para la ejecución de subprocesos.
¿Te ha resultado útil?
(Caracteres restantes: 1500)

Adiciones de comunidad

AGREGAR
© 2013 Microsoft. Reservados todos los derechos.