using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Threading;
using System.Reflection;
using System.Security.Policy;
using IReaper.Properties;
namespace IReaper.Initializer{
public class RestoreOldRecordTask:AbstractInitTask
{
protected override void JobContent()
{
string path = Path.Combine(Settings.Default.RootPath, ".data");
if (!File.Exists(path))
return;
EventWaitHandle wait = null;
try
{
Guid guid = Guid.NewGuid();
string hash = guid.ToString();
wait = new EventWaitHandle(false, EventResetMode.AutoReset, hash);
System.Diagnostics.Process.Start(@".\Recovery\IReaper.exe", hash + " " + Settings.Default.RootPath);
this.InitManager.SetMessage(StringResources.BeginConvert);
if (wait.WaitOne(60 * 1000,false))//1)
{
this.InitManager.SetMessage(StringResources.ISOVER);
}
else
this.InitManager.SetMessage(StringResources.Failed);
}
catch (Exception e)
{
this.InitManager.SetException(e);
}
finally
{
if (wait != null)
wait.Close();
}
}
}
}
|