Exemplo n.º 1
0
        /// <summary>
        /// 设置Panel显示Raster图像
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSetRaster_Click(object sender, EventArgs e)
        {
            try
            {
                FormImageColor formImageColor = new FormImageColor();

                if (formImageColor.ShowDialog() == DialogResult.OK)
                {
                    Color color = formImageColor.Color;
                    this.txtSetRaster.Text  = string.Format("R:{0:D3}, G:{1:D3}, B:{2:D3}", color.R, color.G, color.B);
                    this.pnlColor.BackColor = color;

                    var tasks = new List <Task>();

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

                        tasks.Add(Task.Factory.StartNew(() =>
                        {
                            PgSelectCode pg = iixServer.SvrType == SvrType.Left ? PgSelectCode.Primary : PgSelectCode.Secondary;
                            IIXExecute.SetRasterImage(iixServer, pg, color, formImageColor.IsFactory);
                        }));
                    }

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