internal LauncherClient(Finsemble bridge) { this.bridge = bridge; routerClient = bridge.RouterClient; windowClient = bridge.WindowClient; // Window Groups windowClient.GetComponentState(new JObject { ["field"] = "finsemble:windowGroups" }, (err, groups) => { if (groups.response != null) { AddToGroups(new JObject { ["groupNames"] = groups.response }, SubscribeToGroupUpdates); } }); // Heartbeat timer.Interval = 1000; timer.Elapsed += (sender, e) => { routerClient.Transmit("Finsemble.heartbeat", new JObject { ["type"] = "component", ["componentType"] = "finsemble", ["windowName"] = bridge.windowName }); }; timer.Enabled = true; }
/// <summary> /// Gets window groups for current window /// </summary> /// <param name="callback"></param> public void GetGroupsForWindow(EventHandler <FinsembleEventArgs> callback) { windowClient.GetComponentState(new JObject { ["field"] = "finsemble:windowGroups" }, callback); }