Пример #1
0
        public static TweetList createList(AccountTwitter account, string name, string description, bool publicVisible)
        {
            CreateListOptions options = new TweetSharp.CreateListOptions();

            options.Name        = name;
            options.Description = description;
            if (publicVisible)
            {
                options.Mode = TweetSharp.TwitterListMode.Public;
            }
            else
            {
                options.Mode = TweetSharp.TwitterListMode.Private;
            }

            TwitterList list = account.twitterService.CreateList(options);


            if (list != null)
            {
                TweetList newList = API.TweetSharpConverter.getTweetListFromList(list, account);
                newList.IsOwnList = true;
                account.Lists.Add(newList);
                return(newList);
            }
            else
            {
                System.Windows.MessageBox.Show("Twitter returned the following info: \"failed\"", "List creation failed");
                return(null);
            }
        }
		public virtual void CreateList(CreateListOptions options, Action<TwitterList, TwitterResponse> action)
		{
			var list_owner = options.ListOwner;
			var name = options.Name;
			var mode = options.Mode;
			var description = options.Description;
			
			WithHammock(WebMethod.Post, action, "lists/create", FormatAsString, "?list_owner=", list_owner, "&name=", name, "&mode=", mode, "&description=", description);
		}
		public virtual IAsyncResult BeginCreateList(CreateListOptions options)
		{
			var list_owner = options.ListOwner;
			var name = options.Name;
			var mode = options.Mode;
			var description = options.Description;
				

			return BeginWithHammock<TwitterList>(WebMethod.Post, "lists/create", FormatAsString, "?list_owner=", list_owner, "&name=", name, "&mode=", mode, "&description=", description);
		}
		public virtual Task<TwitterResponse<TwitterList>> CreateListAsync(CreateListOptions options)
		{
			var list_owner = options.ListOwner;
			var name = options.Name;
			var mode = options.Mode;
			var description = options.Description;
				
			
			return ExecuteRequest<TwitterList>(HttpMethod.Post, "lists/create", FormatAsString, "?list_owner=", list_owner, "&name=", name, "&mode=", mode, "&description=", description);
		}
Пример #5
0
        public virtual IAsyncResult BeginCreateList(CreateListOptions options)
        {
            var name = options.Name;
            var mode = options.Mode == TwitterListMode.Public ? "public" : "private";
            var description = options.Description;


            return BeginWithHammock<TwitterList>(WebMethod.Post, "lists/create", FormatAsString, "&name=", name, "&mode=", mode, "&description=", description);
        }