本文整理匯總了C#中MonoDevelop.Projects.Workspace.SaveAsync方法的典型用法代碼示例。如果您正苦於以下問題:C# Workspace.SaveAsync方法的具體用法?C# Workspace.SaveAsync怎麽用?C# Workspace.SaveAsync使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MonoDevelop.Projects.Workspace
的用法示例。
在下文中一共展示了Workspace.SaveAsync方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: TestSaveWorkspace
public async Task TestSaveWorkspace ()
{
// Saving a workspace must save all solutions and projects it contains
string dir = Util.CreateTmpDir ("TestSaveWorkspace");
Workspace ws = new Workspace ();
ws.FileName = Path.Combine (dir, "workspace");
Solution sol = new Solution ();
sol.FileName = Path.Combine (dir, "thesolution");
ws.Items.Add (sol);
DotNetProject p = Services.ProjectService.CreateDotNetProject ("C#");
p.FileName = Path.Combine (dir, "theproject");
sol.RootFolder.Items.Add (p);
await ws.SaveAsync (Util.GetMonitor ());
Assert.IsTrue (File.Exists (ws.FileName));
Assert.IsTrue (File.Exists (sol.FileName));
Assert.IsTrue (File.Exists (p.FileName));
}