Esempio n. 1
0
    public static AgentControlTask Start(IApplicationContext C, IServiceAgent Agent)
    {
        var systemTask = task(() =>
        {
            try
            {
                Agent.Start();
            }
            catch (Exception e)
            {
                var message = AppMessage.Error(e);
                C.Notify(message);
                return(message);
            }

            return(inform("Complete"));
        });

        return(new AgentControlTask(C, Agent, systemTask));
    }