예제 #1
0
        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);
                }
            }

            //if (Processing != null)
            //{
            //    Processing(this, e);
            //}
        }
예제 #2
0
        public void Process(Document doc)
        {
            ProcessEventArgs       e  = new ProcessEventArgs(doc);
            ProcessCancelEventArgs ce = new ProcessCancelEventArgs(doc);

            OnProcessing(ce);
            if (ce.Cancel)
            {
                Console.WriteLine("Proces zostal anulowany.");
                if (LogTextProvider != null)
                {
                    Console.WriteLine(LogTextProvider(doc));
                }
                return;
            }
            foreach (ActionCheckPair process in processes)
            {
                if (process.QuickCheck != null && !process.QuickCheck(doc))
                {
                    Console.WriteLine("Przetwarzanie nie zakonczy sie pomyslnie.");
                    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);
        }
예제 #3
0
 void processor_Processing(object sender, ProcessCancelEventArgs e)
 {
     Console.WriteLine("Narzedzie 1. - zarejestrowano przetwarzanie, wykonanie nie zostalo anulowane");
 }