/// <summary>
        /// Ctor, we need the client to subscribe all the events in here
        /// </summary>
        public DiPSController(DiPSClient client)
        {
            DiPSClient = client;
            var myType = this.GetType();
            //get all the methods
            var methods = myType.GetMethods();
            foreach (var m in methods)
            {
                //register only public methods
                if (!m.IsPublic)
                    continue;

                client.Subscribe(myType.Name + "." + m.Name, (param) =>
                {
                    try
                    {
                        var pars = new List<object>();
                        pars.Add(param);
                        m.Invoke(this, pars.ToArray());
                    }
                    catch (Exception e)
                    {
                        Console.ForegroundColor = ConsoleColor.Red;
                        Console.WriteLine(e);
                        Console.ForegroundColor = ConsoleColor.White;
                    }
                });
            }
        }
 /// <summary>
 /// Subscribe to the events
 /// </summary>
 public UserController(DiPSClient client)
 {
     Client = client;
     Client.Subscribe("login", (u) =>
     {
         Login(u.UserName.ToString());
     });
 }
        /// <summary>
        /// Ctor:
        /// Subscribe to the Events
        /// </summary>
        public TaskController(DiPSClient client)
        {
            Client = client;
            Client.Subscribe("GetTasks", (t) =>
            {
                GetTasks(Guid.Parse(t.UserId.ToString()));
            });

            Client.Subscribe("InsertTask", (t) =>
            {
                InsertTask(new Task {  Completed = t.Completed, OwnerId = t.OwnerId, Description = t.Description, ViewOrder = t.Order });
            });

            Client.Subscribe("DeleteTask", (t) =>
            {
                DeleteTask(Guid.Parse(t.Id.ToString()));
            });

            Client.Subscribe("UpdateTask", (t) =>
            {
                UpdateTask(new Task { Id = t.Id, Completed = t.Completed, OwnerId = t.OwnerId, Description = t.Description });
            });
        }