Пример #1
0
        public static void Init(MainForm mf)
        {
            _mainForm = mf;

            string logDir = System.IO.Directory.GetCurrentDirectory() + @"/Log";

            if (System.IO.Directory.Exists(logDir) == false)
            {
                System.IO.Directory.CreateDirectory(logDir);
            }

            LOG.SetInit(logDir);

            Task.Factory.StartNew(() =>
            {
                while (!_serverStatusQ.IsCompleted)
                {
                    bool status = _serverStatusQ.Take();

                    if (status == true)
                    {
                        BlinkTile(_mainForm.GetServerStatusTile(), Color.LawnGreen, Color.Orange);
                    }
                    else
                    {
                        BlinkTile(_mainForm.GetServerStatusTile(), Color.Tomato, Color.White);
                    }
                }
            });

            Task.Factory.StartNew(() =>
            {
                while (!_machineStatusQ.IsCompleted)
                {
                    bool status = _machineStatusQ.Take();

                    if (status == true)
                    {
                        BlinkTile(_mainForm.GetMachineStatusTile(), Color.Aqua, Color.Orange);
                    }
                    else
                    {
                        BlinkTile(_mainForm.GetMachineStatusTile(), Color.Tomato, Color.White);
                    }
                }
            });
        }