PageRenderTime 13ms CodeModel.GetById 6ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Examples/014 - Verifying repository asynchronously.linq

#
Unknown | 28 lines | 26 code | 2 blank | 0 comment | 0 complexity | 50f3b927d35d2fad560adf868cde524f MD5 | raw file
 1<Query Kind="Program">
 2  <Reference Relative="..\Mercurial.Net\bin\Debug\Mercurial.NET.dll">C:\dev\vs.net\Mercurial.Net\Mercurial.Net\bin\Debug\Mercurial.NET.dll</Reference>
 3  <Namespace>Mercurial</Namespace>
 4</Query>
 5
 6// *****************************************************
 7// *
 8// * This example shows how to verify the integrity
 9// * of the repository, asynchronously.
10// *
11// ***********************
12
13void Main()
14{
15	var repoPath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(Util.CurrentQueryPath), ".."));
16    var repo = new Repository(repoPath);
17    var evt = new ManualResetEvent(false);
18    var ar = repo.BeginExecute(new VerifyCommand(), c =>
19    {
20        Debug.WriteLine(((VerifyCommand)c.AsyncState).RawStandardOutput);
21        evt.Set();
22    });
23    Debug.WriteLine("waiting...");
24    repo.EndExecute(ar);
25    Debug.WriteLine("finished executing");
26    evt.WaitOne();
27    Debug.WriteLine("event signalled");
28}