示例#1
0
 public ServerList(ServerList l1)
 {
     servers = l1.servers;
 }
示例#2
0
 public void GetServers(Action<ServerList, Exception> callback)
 {
     ServerList servers = new ServerList();
     servers = GetServers() as ServerList ;
     callback(servers, null);
 }
示例#3
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);
        }
示例#4
0
        private object GetServers()
        {
            ServerList sl = new ServerList();
            foreach(string server in DataService.Config.NbConfigs.Keys)
            {
                var si = BrokerConnection.InstanceOf().Request(server, "GetServerInfo", null) as ServerInfo;

                ServerInfo info = new ServerInfo();
                if (si != null)
                {
                    info = si;
                }

                sl.Servers.Add(server, info);
            }
            return sl;
        }