Share via


ProjectContext 類別

維護Project Web App執行個體,請使用開發用戶端的內容,並包含Project Web App中存在的 Project Server 物件的整個企業的集合。

繼承階層架構

System.Object
  Microsoft.SharePoint.Client.ClientRuntimeContext
    Microsoft.SharePoint.Client.ClientContext
      Microsoft.ProjectServer.Client.ProjectContext

命名空間:  Microsoft.ProjectServer.Client
組件:  Microsoft.ProjectServer.Client (在 Microsoft.ProjectServer.Client.dll 中)

語法

'宣告
Public Class ProjectContext _
    Inherits ClientContext
'用途
Dim instance As ProjectContext
public class ProjectContext : ClientContext

備註

因為ProjectContext物件繼承自ClientContext SharePoint 中,您也可以透過ProjectContext物件存取 SharePoint CSOM。您不需要產生ProjectServer物件,它會在內部使用的用戶端程式碼。

注意事項注意事項

ProjectContext類別的優點是它包括WaitForQueue方法。如果您是使用ProjectServer類別,您就必須開發您自己的常式等待佇列工作,才可完成。

如需ProjectContext類別的詳細資訊,請參閱 < Getting started with the Project Server CSOM and .NET。如需程式碼範例,請參閱WaitForQueue(QueueJob, Int32)Projects

執行緒安全

這類型的任何公用 static (共用 於 Visual Basic 中) 成員是安全執行緒。不保證任何執行個體成員都是安全執行緒。

請參閱

參照

ProjectContext 成員

Microsoft.ProjectServer.Client 命名空間