AppManifest 屬性 (2003 系統)
取得 AppManifest,表示文件中包含的應用程式資訊清單。
命名空間: Microsoft.VisualStudio.Tools.Applications.Runtime
組件: Microsoft.VisualStudio.Tools.Applications.Runtime (在 Microsoft.VisualStudio.Tools.Applications.Runtime.dll 中)
語法
'宣告
Public ReadOnly Property AppManifest As AppManifest
'用途
Dim instance As ServerDocument
Dim value As AppManifest
value = instance.AppManifest
public AppManifest AppManifest { get; }
屬性值
型別:Microsoft.VisualStudio.Tools.Applications.Runtime. . :: .AppManifest
AppManifest,表示文件中包含的應用程式資訊清單。
範例
下列程式碼範例會建立新的 ServerDocument,然後使用 AppManifest 屬性顯示文件中應用程式資訊清單的內容。這個範例需要對 Microsoft.VisualStudio.Tools.Applications.Runtime 組件的參考,並且在程式碼檔的開頭需要 Microsoft.VisualStudio.Tools.Applications.Runtime 命名空間的 Imports (適用於 Visual Basic) 或 using (適用於 C#) 陳述式。
Private Sub DisplayManifest(ByVal fileName As String)
If ServerDocument.IsCustomized(fileName) Then
Dim serverDocument1 As ServerDocument = Nothing
Try
serverDocument1 = New ServerDocument(fileName)
MsgBox("The application manifest " + _
"contains the following XML: " + vbLf + vbLf + _
serverDocument1.AppManifest.ToXml())
Finally
If Not serverDocument1 Is Nothing Then
serverDocument1.Close()
End If
End Try
Else
MsgBox("The specified document is not " + _
"customized.")
End If
End Sub
private void DisplayManifest(string fileName)
{
if (ServerDocument.IsCustomized(fileName))
{
ServerDocument serverDocument1 = null;
try
{
serverDocument1 = new ServerDocument(fileName);
MessageBox.Show("The application manifest " +
"contains the following XML: \n\n" +
serverDocument1.AppManifest.ToXml());
}
finally
{
if (serverDocument1 != null)
serverDocument1.Close();
}
}
else
{
MessageBox.Show("The specified document is not " +
"customized.");
}
}
使用權限
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。