Exemplo n.º 1
0
        public static bool deleteList(AccountTwitter account, TweetList list)
        {
            DeleteListOptions options = new TweetSharp.DeleteListOptions();

            options.ListId          = Convert.ToInt64(list.Id);
            options.OwnerScreenName = account.Login.Username;
            options.Slug            = list.Slug;

            TwitterList tlist = null;

            if (list.IsOwnList)
            {
                IAsyncResult result = account.twitterService.BeginDeleteList(options);
                tlist = account.twitterService.EndDeleteList(result);
            }
            else
            {
                // xxx hä? wie kann man eine Liste unsubscriben...?
            }
            if (tlist != null)
            {
                account.Lists.Remove(list);
                AppController.Current.AllLists.Remove(list);
                list = null;
                return(true);
            }
            else
            {
                return(false);
            }
        }
		public virtual void DeleteList(DeleteListOptions options, Action<TwitterList, TwitterResponse> action)
		{
			var owner_screen_name = options.OwnerScreenName;
			var owner_id = options.OwnerId;
			var list_id = options.ListId;
			var slug = options.Slug;
			
			WithHammock(WebMethod.Post, action, "lists/destroy", FormatAsString, "?owner_screen_name=", owner_screen_name, "&owner_id=", owner_id, "&list_id=", list_id, "&slug=", slug);
		}
		public virtual IAsyncResult BeginDeleteList(DeleteListOptions options)
		{
			var owner_screen_name = options.OwnerScreenName;
			var owner_id = options.OwnerId;
			var list_id = options.ListId;
			var slug = options.Slug;
				

			return BeginWithHammock<TwitterList>(WebMethod.Post, "lists/destroy", FormatAsString, "?owner_screen_name=", owner_screen_name, "&owner_id=", owner_id, "&list_id=", list_id, "&slug=", slug);
		}
		public virtual Task<TwitterResponse<TwitterList>> DeleteListAsync(DeleteListOptions options)
		{
			var owner_screen_name = options.OwnerScreenName;
			var owner_id = options.OwnerId;
			var list_id = options.ListId;
			var slug = options.Slug;
				
			
			return ExecuteRequest<TwitterList>(HttpMethod.Post, "lists/destroy", FormatAsString, "?owner_screen_name=", owner_screen_name, "&owner_id=", owner_id, "&list_id=", list_id, "&slug=", slug);
		}