//RUN IMPORT DELAY internal bool RunImportDelay(string CurDir, IMeedioSystem MeedioSystem) { bool ImportAborted = false; try { int firstCount = RunCount; double Delay = Convert.ToDouble(ImportDelay); DateTime startTime = DateTime.Now; DateTime stopTime = startTime.AddMinutes(Delay); ToolBox.MeedioUtils.LogEntry(Log, swWriteLog, "[MAIN CODE] - Running import delay for " + ImportDelay + " minutes."); string PopUpScreenPath = Path.Combine(CurDir, "PopUp.screen"); IMeedioScreen PopUp = MeedioSystem.NewPopupScreen(PopUpScreenPath, null, 0, .05, "center", vAlign); string caption = "Running import in " + (stopTime.Subtract(DateTime.Now).Minutes) + " minutes."; PopUp.Data["caption"] = caption; PopUp.AutoCloseTime = Convert.ToInt32(ImportDelay) * 60; PopUp.Show(); IDelay = true; while (DateTime.Now <= stopTime) { caption = "Running import in " + (stopTime.Subtract(DateTime.Now).Minutes) + ":" + (stopTime.Subtract(DateTime.Now).Seconds).ToString().PadLeft(2, '0'); PopUp.Data["caption"] = caption; PopUp.Repaint(); try { if (RunCount > firstCount) { PopUp.Close(false); ToolBox.MeedioUtils.LogEntry(Log, swWriteLog, "[MAIN CODE] - Import delay cancelled"); ToolBox.MeedioUtils.LogEntry(Log, swWriteLog, "[MAIN CODE] - Starting new disc processing thread"); ToolBox.MeedioUtils.LogEntry(Log, swWriteLog, "[MAIN CODE] - Ending old disc processing thread"); ImportAborted = true; return ImportAborted; } } catch { } } } catch (Exception e) { ToolBox.MeedioUtils.LogEntry(Log, swWriteLog, "[MAIN CODE] - Error on import delay: " + e.ToString()); } return ImportAborted; }
public static void ShowPopUpScreen(string PluginDirectory, IMeedioSystem MeedioSystem, IMeedioMessage Message, string caption, double Width, double Height, string HAlign, string VAlign, Int32 Time) { if (VAlign != "") { string PopUpScreenPath = Path.Combine(PluginDirectory, "PopUp.screen"); IMeedioScreen PopUp = MeedioSystem.NewPopupScreen(PopUpScreenPath, null, Width, Height, HAlign, VAlign); PopUp.Data["caption"] = caption; PopUp.AutoCloseTime = Time; PopUp.Show(); } }