Compartir a través de


Reference3.Isolated (Propiedad)

Actualización: noviembre 2007

Obtiene o establece si la referencia COM está aislada, es decir, no se registró con Windows.

Espacio de nombres:  VSLangProj80
Ensamblado:  VSLangProj80 (en VSLangProj80.dll)

Sintaxis

Property Isolated As Boolean

Dim instance As Reference3
Dim value As Boolean

value = instance.Isolated

instance.Isolated = value
bool Isolated { get; set; }
property bool Isolated {
    bool get ();
    void set (bool value);
}
function get Isolated () : boolean
function set Isolated (value : boolean)

Valor de propiedad

Tipo: System.Boolean

Un valor boolean que indica si referencia está aislada.

Ejemplos

En este ejemplo se agrega una referencia COM a un proyecto de Visual Basic, Visual C# o Visual J# abierto y se muestra su propiedad Isolated. Para ejecutar este ejemplo como complemento, vea Cómo: Compilar y ejecutar los ejemplos de código del modelo de objetos de automatización.

Las rutas de acceso predeterminadas para la referencia agregada (spcommon.dll) son: <raíz de instalación>\Archivos de programa\Common Files\SpeechEngines\Microsoft. En el ejemplo, reemplace <file path> por esta u otra ruta de acceso de archivo, según corresponda.

Imports VSLangProj
Imports VSLangProj2
Imports VSLangProj80
Public Sub OnConnection(ByVal application As Object,_
 ByVal connectMode As ext_ConnectMode, ByVal addInInst As Object, _
 ByRef custom As Array) Implements IDTExtensibility2.OnConnection
    applicationObject = CType(application, DTE2)
    addInInstance = CType(addInInst, AddIn)
    GetIsolatedValue(applicationObject)
End Sub
Sub GetIsolatedValue(ByVal dte As DTE2)
    Dim aProject As Project
    Dim aVSProject As VSProject2
    aProject = applicationObject.Solution.Projects.Item(1)
        aVSProject = _
CType(applicationObject.Solution.Projects.Item(1).Object, VSProject2)
    ' Add an Assembly reference and display its identity.
    Dim newRef As Reference3
    ' Add a COM reference and display its isolation value.
    ' Replace the <file path> with an actual file path.
    newRef = CType(aVSProject.References.Add_
("<file path>\spcommon.dll"), Reference3)
    MsgBox("Added a COM reference, named: " & newRef.Name)
    MsgBox("The Isolated value of " & newRef.Name & " is " 
    & newRef.Isolated.ToString())
End Sub
using System.Windows.Forms;
using VSLangProj;
using VSLangProj2;
using VSLangProj80;
public void OnConnection(object application,
 ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
    applicationObject = (DTE2)application;
    addInInstance = (AddIn)addInInst;
    GetIsolatedValue(((DTE2)applicationObject));
}
public void GetIsolatedValue(DTE2 dte)
{
    // The first project is a Visual Basic, C#, or J# project.
    VSProject2 vsProject = 
((VSProject2)(applicationObject.Solution.Projects.Item(1).Object));
    Reference3 aRef = null;
    // Add a COM reference and display its isolated value.
    // Replace <file path> with an actual file path.
    aRef = (Reference3)vsProject.References.Add
((@"<file path>\spcommon.dll"));
    MessageBox.Show("Added a COM reference, named: " + aRef.Name);
    MessageBox.Show("The isolated value of " + aRef.Name + " is " 
+ aRef.Isolated.ToString());
}

Permisos

Vea también

Referencia

Reference3 (Interfaz)

Reference3 (Miembros)

VSLangProj80 (Espacio de nombres)