Reference3.SubType プロパティ

更新 : 2007 年 11 月

アセンブリのサブタイプを設定または取得します。

名前空間 :  VSLangProj80
アセンブリ :  VSLangProj80 (VSLangProj80.dll 内)

構文

'宣言
Property SubType As String
'使用
Dim instance As Reference3
Dim value As String

value = instance.SubType

instance.SubType = value
string SubType { get; set; }
property String^ SubType {
    String^ get ();
    void set (String^ value);
}
function get SubType () : String
function set SubType (value : String)

プロパティ値

型 : System.String

アセンブリのサブタイプを表す文字列値。SQL Server の Visual Basic プロジェクトまたは Visual C# プロジェクトの場合、参照が対象の SQL Server から取得されたときは、このプロパティは SQLCLR に設定されます。

解説

このプロパティは、SQL Server の Visual Basic プロジェクトまたは Visual C# プロジェクトの場合にのみ役に立ちます。

この例では、開いた Visual Basic プロジェクトまたは Visual C# プロジェクトに参照を追加し、参照のサブタイプがあれば、それを表示します。このサンプル コードをアドインとして実行するには、「方法 : オートメーション オブジェクト モデルのコード例をコンパイルおよび実行する」を参照してください。

追加する参照の既定のパスは、<drive>:\Program Files\Microsoft SQL Server\90\COM です。例の <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)
    DisplaySubType(applicationObject)
End Sub
Sub DisplaySubType(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 subtype.
    Dim newRef As Reference3
    ' Replace <file path> with an actual file path.
    newRef = CType(aVSProject.References.Add _
("<file path>\sqldistx.dll "), Reference3)
    MsgBox("Added an assembly reference, named: " & newRef.Name)
    MsgBox("The SubType of " & newRef.Name & " is " _
    & newRef.SubType)
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;
    DisplaySubType(((DTE2)applicationObject));
}
public void DisplaySubType(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 an Assembly reference and display its subtype.
    // Replace <file path> with an actual file path.
    aRef = (Reference3)vsProject.References.Add
((@"<file path>\sqldistx.dll"));
    MessageBox.Show("Added reference, named: "
+ aRef.Name);
MessageBox.Show("The SubType of " + aRef.Name + " is "
+ aRef.SubType);
}

アクセス許可

  • 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

参照

Reference3 インターフェイス

Reference3 メンバ

VSLangProj80 名前空間