本文整理汇总了C#中MissionPlanner.Controls.ProgressReporterDialogue.BeginInvoke方法的典型用法代码示例。如果您正苦于以下问题:C# ProgressReporterDialogue.BeginInvoke方法的具体用法?C# ProgressReporterDialogue.BeginInvoke怎么用?C# ProgressReporterDialogue.BeginInvoke使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MissionPlanner.Controls.ProgressReporterDialogue
的用法示例。
在下文中一共展示了ProgressReporterDialogue.BeginInvoke方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: updateCheckMain
public static void updateCheckMain(ProgressReporterDialogue frmProgressReporter)
{
var t = Type.GetType("Mono.Runtime");
MONO = (t != null);
try
{
if (dobeta)
{
CheckMD5(frmProgressReporter, ConfigurationManager.AppSettings["BetaUpdateLocationMD5"].ToString());
}
else
{
CheckMD5(frmProgressReporter, ConfigurationManager.AppSettings["UpdateLocationMD5"].ToString());
}
var process = new Process();
string exePath = Path.GetDirectoryName(Application.ExecutablePath);
if (MONO)
{
process.StartInfo.FileName = "mono";
process.StartInfo.Arguments = " \"" + exePath + Path.DirectorySeparatorChar + "Updater.exe\"" + " \"" + Application.ExecutablePath + "\"";
}
else
{
process.StartInfo.FileName = exePath + Path.DirectorySeparatorChar + "Updater.exe";
process.StartInfo.Arguments = Application.ExecutablePath;
}
try
{
foreach (string newupdater in Directory.GetFiles(exePath, "Updater.exe*.new"))
{
File.Copy(newupdater, newupdater.Remove(newupdater.Length - 4), true);
File.Delete(newupdater);
}
}
catch (Exception ex)
{
log.Error("Exception during update", ex);
}
if (frmProgressReporter != null)
frmProgressReporter.UpdateProgressAndStatus(-1, "Starting Updater");
log.Info("Starting new process: " + process.StartInfo.FileName + " with " + process.StartInfo.Arguments);
process.Start();
log.Info("Quitting existing process");
frmProgressReporter.BeginInvoke((Action) delegate {
Application.Exit();
});
}
catch (Exception ex)
{
log.Error("Update Failed", ex);
CustomMessageBox.Show("Update Failed " + ex.Message);
}
}