Поделиться через


ServerDocument.DeploymentManifestUrl Свойство (2007 System)

Обновлен: Ноябрь 2007

Возвращает или задает URL-адрес манифеста развертывания для настройки Visual Studio Tools for Office, связанной с документом.

Пространство имен:  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, который загружает указанный документ. Затем в примере отображается URL-адрес манифеста развертывания для настройки Visual Studio Tools for Office, прикрепленной к документу.

Для этого примера требуются ссылки на сборки Microsoft.VisualStudio.Tools.Applications.ServerDocument.v9.0.dll, Microsoft.VisualStudio.Tools.Applications.Runtime.v9.0.dll и операторы Imports (в Visual Basic) или using (в C#) для пространств имен Microsoft.VisualStudio.Tools.Applications и Microsoft.VisualStudio.Tools.Applications.Runtime в начале файла с кодом.

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 - пространство имен