Beispiel #1
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)
        {
            try
            {
                var social = SocialViewModel.Instance.DataInfos[SocialType.SINA];
                var netEngine = new SdkNetEngine();
                var cmdBase = new cmdUploadMessage
                {
                    status = message,
                    acessToken = social.AcessToken,
                    acessTokenSecret = social.RefreshToken
                };

                netEngine.RequestCmd(SdkRequestType.UPLOAD_MESSAGE, cmdBase, (type, response) =>
                {
                    if (response.errCode == SdkErrCode.SUCCESS)
                    {
                        callBack(true, response.content);
                    }
                    else
                    {
                        callBack(false, response.content);
                    }
                });
            }
            catch(Exception ex)
            {
                callBack(false, ex.Message);
            }
        }
Beispiel #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)
        {
            try
            {
                var social    = SocialViewModel.Instance.DataInfos[SocialType.SINA];
                var netEngine = new SdkNetEngine();
                var cmdBase   = new cmdUploadMessage
                {
                    status           = message,
                    acessToken       = social.AcessToken,
                    acessTokenSecret = social.RefreshToken
                };

                netEngine.RequestCmd(SdkRequestType.UPLOAD_MESSAGE, cmdBase, (type, response) =>
                {
                    if (response.errCode == SdkErrCode.SUCCESS)
                    {
                        callBack(true, response.content);
                    }
                    else
                    {
                        callBack(false, response.content);
                    }
                });
            }
            catch (Exception ex)
            {
                callBack(false, ex.Message);
            }
        }