コード例 #1
0
ファイル: TencentSocialData.cs プロジェクト: uvbs/MyProjects
 /// <summary>
 /// 发布一条新微博
 /// </summary>
 /// <param name="channelName"></param>
 /// <param name="channelUrl"></param>
 /// <param name="message"></param>
 protected override void SocialSharePublish(string channelName, 
     string channelUrl, string message, SocialBase.SocialShareHandler callBack)
 {
     var social = SocialViewModel.Instance.DataInfos[SocialType.TENCENT];
     OAuthConfigruation.AccessToken = new AccessToken(social.AcessToken);
     var share = new TService();
     var arg = new ServiceArgument()
     {
         Content = message,
         Url = channelUrl
     };
     try
     {
         share.AddVideo(arg, obj =>
         {
             if (obj.Succeed)
                 callBack(true, string.Empty);
             else
                 callBack(false, obj.InnerException.Message);
         });
     }
     catch (Exception ex)
     {
         callBack(false, ex.Message);
     }
 }
コード例 #2
0
        /// <summary>
        /// 发布一条新微博
        /// </summary>
        /// <param name="channelName"></param>
        /// <param name="channelUrl"></param>
        /// <param name="message"></param>
        protected override void SocialSharePublish(string channelName,
                                                   string channelUrl, string message, SocialBase.SocialShareHandler callBack)
        {
            var social = SocialViewModel.Instance.DataInfos[SocialType.TENCENT];

            OAuthConfigruation.AccessToken = new AccessToken(social.AcessToken);
            var share = new TService();
            var arg   = new ServiceArgument()
            {
                Content = message,
                Url     = channelUrl
            };

            try
            {
                share.AddVideo(arg, obj =>
                {
                    if (obj.Succeed)
                    {
                        callBack(true, string.Empty);
                    }
                    else
                    {
                        callBack(false, obj.InnerException.Message);
                    }
                });
            }
            catch (Exception ex)
            {
                callBack(false, ex.Message);
            }
        }