示例#1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            var source = new Dictionary <string, List <BoardView> >();

            MainActivity.TrelloUserInfoProxy.LoadOrganizations();
            MainActivity.TrelloUserInfoProxy.LoadBoardsUserIsMemberOf();

            //TODO: Colocar texto de info de usuario y algo de estadísticas

            foreach (var organization in MainActivity.TrelloUserInfoProxy.OrganizationsUserBelongsTo)
            {
                foreach (var idBoard in organization.IdBoards)
                {
                    var boards = (from board in MainActivity.TrelloUserInfoProxy.BoardsUserIsMemberOf
                                  where board.Id == idBoard
                                  select new BoardView(board.Name, board.Id, typeof(BoardActivity))).ToList();

                    source.Add(organization.DisplayName, boards);
                }
            }

            var mainBoards = (from board in MainActivity.TrelloUserInfoProxy.BoardsUserIsMemberOf
                              where string.IsNullOrEmpty(board.IdOrganization)
                              select new BoardView(board.Name, board.Id, typeof(BoardActivity))).ToList();

            source.Add("Boards", mainBoards);

            this.adapter = new BoardAdapter(this, source);

            this.ListAdapter = this.adapter;
        }
示例#2
0
        //Parse json from a file and run it through BoardWrapper
        //Returns output of BoardWrapper.JsonCommand
        private string TestJson(string filePath)
        {
            List <JToken> jTokenList   = new List <JToken>();
            string        brokenObject = "";

            string json = ParseJson(filePath);

            //Parse console input
            foreach (char character in json)
            {
                brokenObject += character;
                try
                {
                    jTokenList.Add(JToken.Parse(brokenObject));
                    brokenObject = "";
                }
                catch { }
            }

            List <JToken> finalList = new List <JToken>();

            foreach (JToken jtoken in jTokenList)
            {
                BoardAdapter boardWrapper = new BoardAdapter();
                finalList.Add(boardWrapper.JsonCommand(jtoken));
            }

            return(JsonConvert.SerializeObject(finalList));
        }