当前位置: 首页>>代码示例>>C#>>正文


C# TwitterContext.UpdateAccountBackgroundImage方法代码示例

本文整理汇总了C#中LinqToTwitter.TwitterContext.UpdateAccountBackgroundImage方法的典型用法代码示例。如果您正苦于以下问题:C# TwitterContext.UpdateAccountBackgroundImage方法的具体用法?C# TwitterContext.UpdateAccountBackgroundImage怎么用?C# TwitterContext.UpdateAccountBackgroundImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LinqToTwitter.TwitterContext的用法示例。


在下文中一共展示了TwitterContext.UpdateAccountBackgroundImage方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UpdateAccountBackgroundImageBytes

        /// <summary>
        /// Shows how to update the background image in an account
        /// </summary>
        /// <param name="twitterCtx">TwitterContext</param>
        private static void UpdateAccountBackgroundImageBytes(TwitterContext twitterCtx)
        {
            byte[] fileBytes = Utilities.GetFileBytes(@"C:\Users\jmayo\Documents\linq2twitter\linq2twitter\200xColor_2.png");
            var user = twitterCtx.UpdateAccountBackgroundImage(fileBytes, "200xColor_2.png", "png", false);

            Console.WriteLine("User Image: " + user.ProfileBackgroundImageUrl);
        }
开发者ID:giggio,项目名称:tweetercloud,代码行数:11,代码来源:AccountDemos.cs

示例2: UpdateAccountBackgroundImageAndTileDemo

        /// <summary>
        /// Shows how to update the background image in an account and tiles the image
        /// </summary>
        /// <param name="twitterCtx">TwitterContext</param>
        static void UpdateAccountBackgroundImageAndTileDemo(TwitterContext twitterCtx)
        {
            byte[] fileBytes = Utilities.GetFileBytes(@"..\..\images\200xColor_2.png");
            var user = twitterCtx.UpdateAccountBackgroundImage(fileBytes, "200xColor_2.png", "png", true, true, true, true);

            Console.WriteLine("User Image: " + user.ProfileBackgroundImageUrl);
        }
开发者ID:prog-moh,项目名称:LinqToTwitter,代码行数:11,代码来源:AccountDemos.cs

示例3: UpdateAccountBackgroundImageAndTileDemo

        /// <summary>
        /// Shows how to update the background image in an account and tiles the image
        /// </summary>
        /// <param name="twitterCtx">TwitterContext</param>
        private static void UpdateAccountBackgroundImageAndTileDemo(TwitterContext twitterCtx)
        {
            byte[] fileBytes = Utilities.GetFileBytes(@"C:\Users\jmayo\Documents\linq2twitter\linq2twitter\linq2twitter_v3_300x90.png");
            var user = twitterCtx.UpdateAccountBackgroundImage(fileBytes, "linq2twitter_v3_300x90.png", "png", true);

            Console.WriteLine("User Image: " + user.ProfileBackgroundImageUrl);
        }
开发者ID:giggio,项目名称:tweetercloud,代码行数:11,代码来源:AccountDemos.cs

示例4: HandleOAuthFilePostDemo

        /// <summary>
        /// hows how to use OAuth to post a file to Twitter
        /// </summary>
        /// <param name="twitterCtx">TwitterContext</param>
        private static void HandleOAuthFilePostDemo(TwitterContext twitterCtx)
        {
            if (twitterCtx.AuthorizedClient.IsAuthorized)
            {
                var user = twitterCtx.UpdateAccountBackgroundImage(
                    @"C:\Users\jmayo\Documents\linq2twitter\linq2twitter\200xColor_2.png", false);

                Console.WriteLine(
                    "Name: {0}\nImage: {1}\n",
                    user.Name,
                    user.ProfileBackgroundImageUrl);
            }
        }
开发者ID:giggio,项目名称:tweetercloud,代码行数:17,代码来源:OAuthDemos.cs

示例5: UpdateAccountBackgroundImage

        /// <summary>
        /// Shows how to update the background image in an account
        /// </summary>
        /// <param name="twitterCtx">TwitterContext</param>
        static void UpdateAccountBackgroundImage(TwitterContext twitterCtx)
        {
            var user = twitterCtx.UpdateAccountBackgroundImage(@"..\..\images\200xColor_2.png", false, true, true, true);

            Console.WriteLine("User Image: " + user.ProfileBackgroundImageUrl);
        }
开发者ID:prog-moh,项目名称:LinqToTwitter,代码行数:10,代码来源:AccountDemos.cs

示例6: UpdateAccountBackgroundImageWithProgressUpdates

        /// <summary>
        /// Shows how to update the background image in an account
        /// </summary>
        /// <param name="twitterCtx">TwitterContext</param>
        static void UpdateAccountBackgroundImageWithProgressUpdates(TwitterContext twitterCtx)
        {
            twitterCtx.UploadProgressChanged +=
                (sender, e) =>
                {
                    Console.WriteLine("Progress: {0}%", e.PercentComplete);
                };
            byte[] fileBytes = Utilities.GetFileBytes(@"..\..\images\200xColor_2.png");
            var user = twitterCtx.UpdateAccountBackgroundImage(fileBytes, "200xColor_2.png", "png", false, true, true, true);

            Console.WriteLine("User Image: " + user.ProfileBackgroundImageUrl);
        }
开发者ID:prog-moh,项目名称:LinqToTwitter,代码行数:16,代码来源:AccountDemos.cs

示例7: UpdateAccountBackgroundImage

        /// <summary>
        /// Shows how to update the background image in an account
        /// </summary>
        /// <param name="twitterCtx">TwitterContext</param>
        private static void UpdateAccountBackgroundImage(TwitterContext twitterCtx)
        {
            var user = twitterCtx.UpdateAccountBackgroundImage(@"C:\Users\jmayo\Documents\linq2twitter\linq2twitter\linq2twitter_v3_300x90.png", false);

            Console.WriteLine("User Image: " + user.ProfileBackgroundImageUrl);
        }
开发者ID:giggio,项目名称:tweetercloud,代码行数:10,代码来源:AccountDemos.cs

示例8: HandleOAuthUpdateAccountBackgroundImageWithProgressUpdatesDemo

        /// <summary>
        /// Shows how to update the background image with OAuth
        /// </summary>
        /// <param name="twitterCtx">TwitterContext</param>
        private static void HandleOAuthUpdateAccountBackgroundImageWithProgressUpdatesDemo(TwitterContext twitterCtx)
        {
            if (twitterCtx.AuthorizedClient.IsAuthorized)
            {
                twitterCtx.UploadProgressChanged +=
                        (sender, e) =>
                        {
                            Console.WriteLine("Progress: {0}%", e.PercentComplete);
                        };
                byte[] fileBytes = Utilities.GetFileBytes(@"C:\Users\jmayo\Documents\linq2twitter\linq2twitter\200xColor_2.png");
                var user = twitterCtx.UpdateAccountBackgroundImage(fileBytes, "200xColor_2.png", "png", true, true, true, true);

                Console.WriteLine("User Image: " + user.ProfileBackgroundImageUrl);
            }
        }
开发者ID:prog-moh,项目名称:LinqToTwitter,代码行数:19,代码来源:OAuthDemos.cs

示例9: UpdateAccountBackgroundImage_Invokes_Executor_PostTwitterFile

        public void UpdateAccountBackgroundImage_Invokes_Executor_PostTwitterFile()
        {
            const string ImageFilePath = "C:\\image.png";
            const bool Tile = false;
            const bool Use = false;
            const string ExpectedName = "Twitter API";
            const bool SkipStatus = true;
            execMock.SetupGet(exec => exec.AuthorizedClient).Returns(authMock.Object);
            execMock.Setup(exec =>
                exec.PostTwitterFile(
                    It.IsAny<string>(),
                    It.IsAny<Dictionary<string, string>>(),
                    It.IsAny<string>(),
                    It.IsAny<IRequestProcessor<User>>()))
                .Returns(SingleUserResponse);
            var ctx = new TwitterContext(authMock.Object, execMock.Object, "https://api.twitter.com/1.1/", "");

            User actual = ctx.UpdateAccountBackgroundImage(ImageFilePath, Tile, Use, true, SkipStatus);

            execMock.Verify(exec =>
                exec.PostTwitterFile(
                    "https://api.twitter.com/1.1/account/update_profile_background_image.json",
                    It.IsAny<Dictionary<string, string>>(),
                    It.IsAny<string>(),
                    It.IsAny<IRequestProcessor<User>>()),
                Times.Once());
            Assert.Equal(ExpectedName, actual.Name);
        }
开发者ID:CheyPMK,项目名称:linqtotwitter,代码行数:28,代码来源:AccountExtensionsTests.cs


注:本文中的LinqToTwitter.TwitterContext.UpdateAccountBackgroundImage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。