다음을 통해 공유


Reference3.Isolated 속성

업데이트: 2007년 11월

COM 참조가 격리되어 있는지, 즉 Windows에 등록되어 있지 않은지 여부를 가져오거나 설정합니다.

네임스페이스:  VSLangProj80
어셈블리:  VSLangProj80(VSLangProj80.dll)

구문

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)

속성 값

형식: System.Boolean

참조가 격리되어 있는지 여부를 나타내는 boolean 값입니다.

예제

이 예제에서는 열린 Visual Basic, Visual C# 또는 Visual J# 프로젝트에 COM 참조를 추가하고 각 참조의 Isolated 속성을 표시합니다. 이 예제를 추가 기능으로 실행하려면 방법: 자동화 개체 모델 코드의 예제 컴파일 및 실행을 참조하십시오.

추가되는 참조(spcommon.dll)의 기본 경로는 <설치 루트>\Program Files\Common Files\SpeechEngines\Microsoft입니다. 예제의 <file path>를 이 경로 또는 적절한 다른 파일 경로로 바꿉니다.

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());
}

권한

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

Reference3 인터페이스

Reference3 멤버

VSLangProj80 네임스페이스