示例#1
0
        /// <summary>
        ///  Creates a new Trello list object, with the current board id.
        ///  It does not upload the list.
        /// </summary>
        /// <returns>The list object.</returns>
        public TrelloList NewList()
        {
            if (currentBoardId == "")
            {
                throw new TrelloException("Cannot create a list if there is no board selected.");
            }

            var list = new TrelloList();

            list.idBoard = currentBoardId;
            return(list);
        }
示例#2
0
        /// <summary>
        ///  Async uploads a given TrelloList object to the currently selected board.
        /// </summary>
        /// <returns>Your list ID.</returns>
        /// <param name="list">the list to upload.</param>
        public IEnumerator UploadListRoutine(TrelloList list)
        {
            WWWForm post = new WWWForm();

            post.AddField("name", list.name);
            post.AddField("idBoard", list.idBoard);
            post.AddField("pos", list.pos);

            WWW www = new WWW(listBaseUrl + "?" + "key=" + key + "&token=" + token, post);

            yield return(www);

            CheckWwwStatus("Could not upload the new list to Trello", www);

            var dict = Json.Deserialize(www.text) as Dictionary <string, object>;

            yield return((string)dict["id"]);
        }