public void Process(Document doc) { ProcessEventArgs e = new ProcessEventArgs(doc); ProcessCancelEventArgs ce = new ProcessCancelEventArgs(doc); OnProcessing(ce); if (ce.Cancel) { Console.WriteLine("処理はキャンセルされました。"); if (LogTextProvider != null) { Console.WriteLine(LogTextProvider(doc)); } return; } foreach (ActionCheckPair process in processes) { if (process.QuickCheck != null && !process.QuickCheck(doc)) { Console.WriteLine("処理は成功しないでしょう。"); if (LogTextProvider != null) { Console.WriteLine(LogTextProvider(doc)); } OnProcessed(e); return; } } foreach (ActionCheckPair process in processes) { process.Action(doc); if (LogTextProvider != null) { Console.WriteLine(LogTextProvider(doc)); } } OnProcessed(e); }
private void processor_Processing(object sender, ProcessCancelEventArgs e) { Console.WriteLine("ツール1が処理の開始を確認しました。処理を続行します。"); }
private void OnProcessing(ProcessCancelEventArgs e) { Delegate eh = null; if(events != null && events.TryGetValue("Processing", out eh)) { EventHandler<ProcessCancelEventArgs> pceh = eh as EventHandler<ProcessCancelEventArgs>; if (pceh != null) { pceh(this, e); } } }