Exemple #1
0
        void bgwoker(object sender, EventArgs arg)
        {
            if (printKeys.Count >= DicPrintQueue.Count)
            {
                return;
            }

            foreach (KeyValuePair <int, string> kvp in DicPrintQueue)
            {
                if (printKeys.Contains(kvp.Key))
                {
                    continue;
                }

                printKeys.Add(kvp.Key);

                QuestionWorkflow qwf = qns[kvp.Key];

                var result = qwf.CreateResultPage();

                if (!string.IsNullOrEmpty(result))
                {
                    DicPrintQueue[kvp.Key] = result;

                    try
                    {
                        this.lv_result.Invoke(new Action(() => {
                            lv_result.Items[kvp.Key].SubItems[6].Text = "预览";
                        }));

                        System.Threading.Thread.Sleep(1000);
                    }
                    catch (Exception ex)
                    {
                        //
                    }
                }
            }
        }