Exemplo n.º 1
0
 private void OnSendTaskCompletedCallback(NetResponse response)
 {
     if (!response.IsError)
     {
         if (response.IsContainsKey("task"))
         {
             var            taskText     = response.GetValue("task");
             var            taskRank     = double.Parse(response.GetValue("rank"));
             byte           taskUserRank = 0;//load from localStorage
             List <Comment> taskComments = null;
             //if (response.IsContainsKey("comments"))
             //{
             //    taskComments = new List<Comment>();
             //    var comments = response.GetValue("comments").Split(new char[]{'|'});
             //    foreach(var comm in comments)
             //    {
             //        var commParam = comm.Split(new string[]{";1;"},StringSplitOptions.RemoveEmptyEntries);
             //    }
             //}
             _currentTask = new GameTask(taskText, taskRank, taskComments, taskUserRank);
         }
         else
         {
             _currentTask = null;
         }
         //CallDataUpdate();
     }
 }
Exemplo n.º 2
0
 private void OnSendTaskCompletedCallback(NetResponse response)
 {
     if (!response.IsError)
     {
         if (response.IsContainsKey("task"))
         {
             var taskText = response.GetValue("task");
             var taskRank = double.Parse(response.GetValue("rank"));
             byte taskUserRank = 0;//load from localStorage
             List<Comment> taskComments = null;
             //if (response.IsContainsKey("comments"))
             //{
             //    taskComments = new List<Comment>();
             //    var comments = response.GetValue("comments").Split(new char[]{'|'});
             //    foreach(var comm in comments)
             //    {
             //        var commParam = comm.Split(new string[]{";1;"},StringSplitOptions.RemoveEmptyEntries);
             //    }
             //}
             _currentTask = new GameTask(taskText, taskRank, taskComments, taskUserRank);
         }
         else
         {
             _currentTask = null;
         }
         //CallDataUpdate();
     }
 }