次の方法で共有


ServerDocument.DeploymentManifestUrl プロパティ (2007 System)

更新 : 2007 年 11 月

ドキュメントに関連付けられている Visual Studio Tools for Office カスタマイズの配置マニフェストの URL を取得または設定します。

名前空間 :  Microsoft.VisualStudio.Tools.Applications
アセンブリ :  Microsoft.VisualStudio.Tools.Applications.ServerDocument.v9.0 (Microsoft.VisualStudio.Tools.Applications.ServerDocument.v9.0.dll 内)

構文

'宣言
Public Property DeploymentManifestUrl As Uri
'使用
Dim instance As ServerDocument
Dim value As Uri

value = instance.DeploymentManifestUrl

instance.DeploymentManifestUrl = value
public Uri DeploymentManifestUrl { get; set; }

プロパティ値

型 : System.Uri

ドキュメントに関連付けられているカスタマイズの配置マニフェストの名前と場所を指定する URL です。

解説

カスタマイズの配置マニフェストを別の場所に移動し、移動先の場所からカスタマイズの更新を確認するには、このプロパティを新しい URL に設定します。このプロパティを設定する場合、URL は、ドキュメントに関連付けられているカスタマイズの配置マニフェストを指す必要があります。

このプロパティを使用して、ドキュメントに新しいカスタマイズを関連付けることはできません。カスタマイズが含まれていないドキュメントに新しいカスタマイズを追加するには、AddCustomization メソッドを使用します。カスタマイズが含まれているドキュメントに別のカスタマイズを追加するには、まず、RemoveCustomization メソッドを使用して現在のカスタマイズを削除し、次に AddCustomization メソッドを使用します。

次のコード例は、ServerDocument(String) コンストラクタを使用して、指定したドキュメントを読み込むための新しい ServerDocument を作成します。この例では、ドキュメントにアタッチされた Visual Studio Tools for Office カスタマイズの配置マニフェストの URL を表示します。

この例では、Microsoft.VisualStudio.Tools.Applications.ServerDocument.v9.0.dll アセンブリと Microsoft.VisualStudio.Tools.Applications.Runtime.v9.0.dll アセンブリへの参照、およびコード ファイルの先頭に記述された Microsoft.VisualStudio.Tools.Applications 名前空間および Microsoft.VisualStudio.Tools.Applications.Runtime 名前空間に対する Imports ステートメント (Visual Basic の場合) または using ステートメント (C# の場合) が必要です。

Private Sub CreateServerDocumentFromPath(ByVal documentPath As String)
    Dim runtimeVersion As Integer = 0
    Dim serverDocument1 As ServerDocument = Nothing

    Try
        runtimeVersion = ServerDocument.GetCustomizationVersion(documentPath)
        If runtimeVersion = 3 Then
            serverDocument1 = New ServerDocument(documentPath)
            MessageBox.Show("The URL of the deployment manifest is: " & vbLf & _
                serverDocument1.DeploymentManifestUrl.ToString())
        End If

    Catch ex As System.IO.FileNotFoundException
        System.Windows.Forms.MessageBox.Show("The specified document does not exist.")
    Catch ex As UnknownCustomizationFileException
        System.Windows.Forms.MessageBox.Show("The specified document has a file " & _
            "extension that is not supported by Visual Studio Tools for Office.")
    Finally
        If Not (serverDocument1 Is Nothing) Then
            serverDocument1.Close()
        End If
    End Try
End Sub
private void CreateServerDocumentFromPath(string documentPath)
{
    int runtimeVersion = 0;
    ServerDocument serverDocument1 = null;

    try
    {
        runtimeVersion = ServerDocument.GetCustomizationVersion(documentPath);
        if (runtimeVersion == 3)
        {
            serverDocument1 = new ServerDocument(documentPath);
            MessageBox.Show("The URL of the deployment manifest is: \n" +
                serverDocument1.DeploymentManifestUrl.ToString());
        }
    }
    catch (System.IO.FileNotFoundException)
    {
        System.Windows.Forms.MessageBox.Show("The specified document does not exist.");
    }
    catch (UnknownCustomizationFileException)
    {
        System.Windows.Forms.MessageBox.Show("The specified document has a file " +
            "extension that is not supported by Visual Studio Tools for Office.");
    }
    finally
    {
        if (serverDocument1 != null)
            serverDocument1.Close();
    }
}

アクセス許可

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

参照

参照

ServerDocument クラス

ServerDocument メンバ

Microsoft.VisualStudio.Tools.Applications 名前空間