Esempio n. 1
0
        public bool Init(ref ConfigModel config)
        {
            try
            {
                Helper.ToConsole("=> Reco3Simulator.Init");
                _config = config;

                m_ClientInfo = new Reco3ClientInfo();
                m_ClientInfo.Initialize();
                PostMessage(m_ClientInfo, "Signing in.", false);
                _worker.DoWork                    += _worker_DoWork;
                _worker.ProgressChanged           += backgroundWorker1_ProgressChanged;
                _worker.RunWorkerCompleted        += backgroundWorker1_RunWorkerCompleted;
                _worker.WorkerReportsProgress      = true;
                _worker.WorkerSupportsCancellation = true;

                return(true);
            }
            catch (Exception e)
            {
                Helper.ToConsole(string.Format("!! Reco3Simulator.Init: {0}", e.Message));
            }

            return(false);
        }
Esempio n. 2
0
        public void PostMessage(Reco3ClientInfo info, string strText, bool bFailure = false)
        {
            if (MsTeamsUrl.Length > 0)
            {
                string strTitle = "";
                if (bFailure == true)
                {
                    strTitle = string.Format("Reco3-Client-Failure: {0}:{1}:{2}", info.NodeName, info.ProcId, strText);
                }
                else
                {
                    strTitle = string.Format("Reco3-Client: {0}:{1}:{2}", info.NodeName, info.ProcId, strText);
                }

                teams.PostMessage(MsTeamsUrl, strTitle, strText);
            }
        }