Пример #1
0
        public bool GetDevicesList(PlanControl planControl)
        {
            this.planControl = planControl;
            if (!Global_Object.ServerAlive())
            {
                return(false);
            }
            try
            {
                workerLoadDevice = new BackgroundWorker();
                workerLoadDevice.WorkerSupportsCancellation = true;
                workerLoadDevice.WorkerReportsProgress      = true;
                workerLoadDevice.DoWork             += WorkerLoadDevice_DoWork;
                workerLoadDevice.ProgressChanged    += WorkerLoadDevice_ProgressChanged;
                workerLoadDevice.RunWorkerCompleted += WorkerLoadDevice_RunWorkerCompleted;
                workerLoadDevice.RunWorkerAsync();

                return(true);
            }
            catch (Exception exc)
            {
                Console.WriteLine(exc.Message);
                return(false);
            }
        }
Пример #2
0
        public PlanControlModel(PlanControl planControl)
        {
            this.planControl = planControl;

            deviceList = new DeviceList();

            BasePlans1        = new List <Plan>();
            GroupedDevices_S1 = (ListCollectionView)CollectionViewSource.GetDefaultView(BasePlans1);
        }