Class ProjectServerManager
نام ها : Aspose.Tasks جمع آوری: WL29_.dll (25.4.0)
کلاس که روش هایی را برای خواندن و انجام عملیات بر روی پروژه ها در حساب مشخص شده Project Online فراهم می کند یادر مثال Project Server در زمان مشخص شده (نسخه های Project Server 2016 و 2019 پشتیبانی می شوند).
public sealed class ProjectServerManager
Inheritance
اعضای ارثی
object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Constructors
ProjectServerManager(ProjectServerCredentials)
یک مثال جدید از کلاس Aspose.Tasks.ProjectServerManager آغاز می شود.
public ProjectServerManager(ProjectServerCredentials credentials)
Parameters
credentials
ProjectServerCredentials
اعتبارات مورد استفاده برای اتصال به حساب Project Online.
Examples
این مثال نشان می دهد که چگونه برای ایجاد یک مثال از ProjectServerManager برای دسترسی به یک مثال پیش فرض از Project Server.
string site = "http://project_server_instance.local/";
var windowsCredentials = new NetworkCredential("Administrator", "my_password", "DOMAIN");
var projectServerCredentials = new ProjectServerCredentials(site, windowsCredentials);
ProjectServerManager manager = new ProjectServerManager(projectServerCredentials);
این مثال نشان می دهد که چگونه برای ایجاد مثال ProjectServerManager برای دسترسی به حساب در سرویس Project Online.
var credentials = new ProjectServerCredentials("https://xxxxxx.sharepoint.com", "yyyyy@xxxxxxx.onmicrosoft.com", "password");
ProjectServerManager manager = new ProjectServerManager(projectServerCredentials);
Methods
CreateNewProject(Project)
ایجاد پروژه جدید در مثال Project Server\Project Online با استفاده از گزینه های ذخیره پیش فرض.
public void CreateNewProject(Project project)
Parameters
project
Project
پروژه را در Project Server\Project Online ذخیره کنید.
Examples
در این مثال، پروژه از فایل .mpp بارگذاری می شود و به حساب Project Online ذخیره می شود.
var credentials = new ProjectServerCredentials("https://xxxxxx.sharepoint.com", "yyyyy@xxxxxxx.onmicrosoft.com", "password");
var project = new Project(@"sample.mpp");
ProjectServerManager manager = new ProjectServerManager(credentials);
manager.CreateNewProject(project);
Exceptions
در صورت خطای ارتباطی یا خطای بازگردانده شده توسط یک سرور.
CreateNewProject(پروژه، ProjectServerSaveOptions)
ایجاد پروژه جدید در مثال Project Server\Project Online با استفاده از گزینه های ذخیره مشخص شده.
public void CreateNewProject(Project project, ProjectServerSaveOptions saveOptions)
Parameters
project
Project
پروژه را در Project Server\Project Online ذخیره کنید.
saveOptions
ProjectServerSaveOptions
گزینه های کلاس Aspose.Tasks.ProjectServerSaveOptions
Examples
در این مثال، پروژه از فایل .mpp بارگذاری می شود و به حساب Project Online ذخیره می شود.
var credentials = new ProjectServerCredentials("https://xxxxxx.sharepoint.com", "yyyyy@xxxxxxx.onmicrosoft.com", "password");
var project = new Project(@"sample.mpp");
ProjectServerManager manager = new ProjectServerManager(credentials);
manager.CreateNewProject(project, new ProjectServerSaveOptions
{
ProjectName = "My new project"
});
Exceptions
در صورت خطای ارتباطی یا خطای بازگردانده شده توسط یک سرور.
GetProject(Guid)
پروژه را با راهنمای مشخص شده از حساب Project Online \ Project Server دریافت کنید.
public Project GetProject(Guid projectGuid)
Parameters
projectGuid
Guid
راهنمای پروژه برای خواندن
Returns
مثال کلاس Aspose.Tasks.Project که نشان دهنده خواندن پروژه از Project Online \ Project Server است.
GetProjectList()
لیست پروژه ها را از فروشگاه “کار” در حساب فعلی Project Online \ Project Server دریافت کنید.
public IEnumerable<projectinfo> GetProjectList()
Returns
IEnumerable <؛ ProjectInfo >
یک لیست از پروژه ها در حساب فعلی Project Online \ Project Server.
GetProjectRawData(Guid)
دریافت داده های باینری پروژه برای اهداف حل مشکل.
public Stream GetProjectRawData(Guid projectGuid)
Parameters
projectGuid
Guid
راهنمای پروژه برای خواندن
Returns
جریان حاوی داده های پروژه خام
Examples
In this example the debug info for the specific project is retrieved. You can pass the resulting "debug.zip" to the support team for troubleshooting purposes.
[C#]
var credentials = new ProjectServerCredentials("https://xxxxxx.sharepoint.com", "yyyyy@xxxxxxx.onmicrosoft.com", "password");
// Guid of project you are trying to get.
var projectGuid = new Guid("e0294bfb-5657-45c8-9cc5-82169fb95d69");
ProjectServerManager manager = new ProjectServerManager(credentials);
using (var fileStream = File.OpenWrite(@"c:\debug.zip"))
{
using (var stream = manager.GetProjectRawData(projectGuid))
{
stream.CopyTo(fileStream);
}
}
UpdateProject(Project)
به روز رسانی پروژه های موجود در مثال Project Server\Project Online با استفاده از گزینه های ذخیره پیش فرض.
public void UpdateProject(Project project)
Parameters
project
Project
پروژه را در Project Server\Project Online ذخیره کنید.
Examples
در این مثال، پروژه از حساب Project Online بارگذاری می شود، اصلاح می شود و به حساب Project Online بازگردانده می شود.
var credentials = new ProjectServerCredentials("https://xxxxxx.sharepoint.com", "yyyyy@xxxxxxx.onmicrosoft.com", "password");
ProjectServerManager manager = new ProjectServerManager(credentials);
var projectList = manager.GetProjectList();
var projectGuid = projectList.First().Id;
var project = manager.GetProject(projectGuid);
var task = project.RootTask.Children.Add("New task");
manager.UpdateProject(project);
Remarks
ویژگی پروژه ‘project.Get(Prj.Guid)’ باید یک راهنمای معتبر برای یک پروژه باشد که در حساب Project Server وجود دارد \ Project Online مثال.
Exceptions
در صورت خطای ارتباطی یا خطای بازگردانده شده توسط یک سرور.
UpdateProject(پروژه، ProjectServerSaveOptions)
به روز رسانی پروژه های موجود در مثال Project Server\Project Online با استفاده از گزینه های ذخیره مشخص شده.
public void UpdateProject(Project project, ProjectServerSaveOptions saveOptions)
Parameters
project
Project
پروژه را در Project Server\Project Online ذخیره کنید.
saveOptions
ProjectServerSaveOptions
گزینه های کلاس Aspose.Tasks.ProjectServerSaveOptions
Examples
در این مثال، پروژه از حساب Project Online بارگذاری می شود، اصلاح می شود و به حساب Project Online بازگردانده می شود.
var credentials = new ProjectServerCredentials("https://xxxxxx.sharepoint.com", "yyyyy@xxxxxxx.onmicrosoft.com", "password");
ProjectServerManager manager = new ProjectServerManager(credentials);
var projectList = manager.GetProjectList();
var projectGuid = projectList.First().Id;
var project = manager.GetProject(projectGuid);
var task = project.RootTask.Children.Add("New task");
manager.UpdateProject(project, new ProjectServerSaveOptions
{
ProjectGuid = projectGuid
});
Remarks
saveOptions.ProjectGuid باید به راهنمای یک پروژه که در مثال Project Server\ Project Online وجود دارد تنظیم شود.
Exceptions
در صورت خطای ارتباطی یا خطای بازگردانده شده توسط یک سرور.
ExecutingWebRequest
یک رویداد که هنگام ارسال درخواست وب به API وب Project Server ایجاد می شود.
public event EventHandler<webrequesteventargs> ExecutingWebRequest
نوع رویداد
EventHandler <؛ WebRequestEventArgs >