Beispiel #1
0
        /// <summary>
        /// 熄灭屏幕
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnPanelOff_Click(object sender, EventArgs e)
        {
            try
            {
                var tasks = new List <Task>();

                foreach (var iixServer in Global.ListIIXSerevr)
                {
                    if (iixServer.IsEnable == false)
                    {
                        continue;
                    }

                    if (iixServer.SvrType == SvrType.Right)
                    {
                        tasks.Add(Task.Factory.StartNew(() =>
                        {
                            if (IIXExecute.PanelOff(iixServer, PgSelectCode.Primary) == CmdResultCode.Success)
                            {
                                Log.GetInstance().NormalWrite(string.Format("屏幕[{0}]Demura作业成功", iixServer.AssociatedPanelPos));
                            }
                            else
                            {
                                Log.GetInstance().ErrorWrite(string.Format("屏幕[{0}]Demura作业失败", iixServer.AssociatedPanelPos));
                            }
                        }));
                    }
                }

                Task.WaitAll(tasks.ToArray());
            }
            catch (Exception ex)
            {
                Log.WriterExceptionLog(ex.ToString());
            }
        }