Esempio n. 1
0
        private async void MainForm_Load(object sender, EventArgs e)
        {
            pnMonitoring.Visible = true;
            var _loader = Program.Container.Resolve <HttpDataLoader>();
            await _loader.LoadData <ApparatusModel>(
                (x) =>
            {
                if (x == null)
                {
                    return;
                }
                _tmpApparatus.Clear();
                _tmpApparatus.AddRange(x);
                var converter = new TreeNodesConverter();
                var nodes     = converter.GetNodes(x);

                treeMain.Nodes.AddRange(nodes.ToArray());
            }, HttpApiRes.Apparatuses,
                HttpApiRes.Host,
                HttpApiRes.Port
                );
        }
Esempio n. 2
0
        private async void AdminModule_Load(object sender, EventArgs e)
        {
            await _loader.LoadData <ApparatusModel>(
                (x) =>
            {
                if (x == null)
                {
                    return;
                }
                _tmpApparatus.Clear();
                _tmpApparatus.AddRange(x);
                var converter = new TreeNodesConverter();
                var nodes     = converter.GetNodes(x);

                treeObjects.Nodes.AddRange(nodes.ToArray());
            }, HttpApiRes.Apparatuses,
                HttpApiRes.Host,
                HttpApiRes.Port
                );

            _tmpActiveDataGrid = dgSensorRules;
        }