private void AddProcess(ProcessViewModel process)
 {
     RunOnUIDespatcher((Action)(() =>
     {
         _processes.Add(process);
     }));
 }
        public void Show(ProcessViewModel process)
        {
            if (process == null)
            {
                throw new ArgumentNullException(nameof(process));
            }

            this.Process = process;
            this.Initialize(process);
        }
        private void Initialize(ProcessViewModel process)
        {
            var robots = ApiHelper.Fetch_all_Robots_by_Environment(process.ProcessEnvironment);

            _robots.Clear();

            foreach (var robot in robots)
            {
                var _robot = new RobotViewModel(robot);
                this.Robots.Add(_robot);
            }

            this.QueueItemForm = new QueueItemFormViewModel(process.RobotInfo.QueueItemJSON);
        }
        private void ShowAllRobots()
        {
            IsBusy = true;

            ClearProcess();
            var       releases    = ApiHelper.Fetch_all_Processes();
            RobotInfo processInfo = new RobotInfo()
            {
                ProcessName = null, QueueItemJSON = "Some JSON String"
            };

            foreach (var release in releases)
            {
                var process = new ProcessViewModel(processInfo, release);
                AddProcess(process);
                Thread.Sleep(100);
            }

            IsBusy = false;
        }
        private void Initialize()
        {
            IsBusy = true;

            var releases = ApiHelper.Fetch_all_Processes();

            var robotInfos = MiUtility.GetRobotInfos();

            foreach (var robotInfo in robotInfos)
            {
                var release = releases.SingleOrDefault(r => r.Id == int.Parse(robotInfo.ProcessID));
                if (release != null)
                {
                    var process = new ProcessViewModel(robotInfo, release);
                    AddProcess(process);
                    Thread.Sleep(100);
                }
            }

            IsBusy = false;
        }