public ServerList(ServerList l1) { servers = l1.servers; }
public void GetServers(Action<ServerList, Exception> callback) { ServerList servers = new ServerList(); servers = GetServers() as ServerList ; callback(servers, null); }
/// <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); }
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; }