Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public ViewModel(IDataService dataService)
        {
            _dataService = dataService;

            _dataService.Initialize();

            _dataService.GetNbConfigNamesHandler(
                (item, error) =>
                {
                    if (error != null)
                        return;

                    NbConfigNames = item;
                    nbSelection = DataService.Config.NbDefaultInstanceName;
                });

            monitorServersThread = new Thread(monitorServersThreadRun);
            monitorServersThread.Start();
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel(IDataService dataService)
        {
            _dataService = dataService;

            _dataService.Initialize();

            _dataService.GetNbConfigNamesHandler(
                (item, error) =>
                {
                    if (error != null)
                        return;

                    NbConfigNames = item;
                    nbSelection = DataService.Config.NbDefaultInstanceName;
                });

            _dataService.GetJobsHandler(
                (item, error) =>
                {
                    if (error != null)
                    {
                        // Report error here
                        return;
                    }
                    JobList = item;
                });

            _dataService.GetServers(
                (item, error) =>
                {
                    if (error != null)
                    {
                        // Report error here
                        return;
                    }
                    ServerList = item;
                });

            _dataService.StartMonitoring(this);
        }