Пример #1
0
 void SendPlanDefUpdated(PlanDef pd)
 {
     foreach (var cl in _server.Clients)
     {
         if (cl.IsGui)
         {
             var m = new Net.PlanDefsMessage(new PlanDef[1] {
                 pd
             }, incremental: true);
             _server.SendToSingle(m, cl.Name);
         }
     }
 }
Пример #2
0
        void FeedGui(ClientIdent ident)
        {
            // send the full list of clients
            {
                foreach ((var id, var state) in _allClientStates.ClientStates)
                {
                    var m = new Net.ClientStateMessage(DateTime.UtcNow, state);
                    _server.SendToSingle(m, ident.Name);
                }
            }

            // send the full list of plans
            {
                var m = new Net.PlanDefsMessage(from p in _plans.Plans.Values select p.Def, incremental: false);
                _server.SendToSingle(m, ident.Name);
            }

            // send the full list of plan states
            {
                var m = new Net.PlansStateMessage(_plans.PlanStates);
                _server.SendToSingle(m, ident.Name);
            }

            // send the full list of app states
            {
                var m = new Net.AppsStateMessage(_allAppStates.AppStates, DateTime.UtcNow);
                _server.SendToSingle(m, ident.Name);
            }

            // send the full list of app defs
            {
                var m = new Net.AppDefsMessage(_allAppDefs.AppDefs.Values, incremental: false);
                _server.SendToSingle(m, ident.Name);
            }

            // send the full list of scripts
            {
                var m = new Net.ScriptDefsMessage(from p in _scripts.Scripts.Values select p.Def, incremental: false);
                _server.SendToSingle(m, ident.Name);
            }

            // send the full list of script states
            {
                var m = new Net.ScriptStateMessage(_scripts.ScriptStates);
                _server.SendToSingle(m, ident.Name);
            }
        }