ClearItemsInList() public static méthode

Temporarily clears all items in a list Next time list contents will be refereshed online
public static ClearItemsInList ( string username, int id ) : void
username string
id int
Résultat void
Exemple #1
0
        internal static void AddRemoveItemInList(List <string> slugs, List <TraktListItem> items, bool remove)
        {
            Thread listThread = new Thread(delegate(object obj)
            {
                foreach (var slug in slugs)
                {
                    TraktList list = new TraktList
                    {
                        UserName = TraktSettings.Username,
                        Password = TraktSettings.Password,
                        Slug     = slug,
                        Items    = items
                    };
                    TraktSyncResponse response = null;
                    if (!remove)
                    {
                        response = TraktAPI.TraktAPI.ListAddItems(list);
                    }
                    else
                    {
                        response = TraktAPI.TraktAPI.ListDeleteItems(list);
                    }

                    TraktAPI.TraktAPI.LogTraktResponse <TraktSyncResponse>(response);
                    if (response.Status == "success")
                    {
                        // clear current items in any lists
                        // list items will be refreshed online if we try to request them
                        TraktLists.ClearItemsInList(TraktSettings.Username, slug);
                    }
                }
            })
            {
                Name         = remove ? "RemoveList" : "AddList",
                IsBackground = true
            };

            listThread.Start();
        }