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


C# HelperClasses.OAuthInfo类代码示例

本文整理汇总了C#中UploadersLib.HelperClasses.OAuthInfo的典型用法代码示例。如果您正苦于以下问题:C# OAuthInfo类的具体用法?C# OAuthInfo怎么用?C# OAuthInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


OAuthInfo类属于UploadersLib.HelperClasses命名空间,在下文中一共展示了OAuthInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TwitterMsg

 public TwitterMsg(OAuthInfo oauth, string title)
 {
     InitializeComponent();
     AuthInfo = oauth;
     Text = title;
     Config = new TwitterClientSettings();
 }
开发者ID:modulexcite,项目名称:ZScreen_Google_Code,代码行数:7,代码来源:TwitterMsg.cs

示例2: Jira

        public Jira(string jiraBaseAddress, OAuthInfo oauth, string jiraIssuePrefix = null)
        {
            _jiraBaseAddress = jiraBaseAddress;
            AuthInfo = oauth;
            _jiraIssuePrefix = jiraIssuePrefix;

            InitUris();
        }
开发者ID:kennethisom,项目名称:ShareX,代码行数:8,代码来源:Jira.cs

示例3: Jira

        public Jira(string jiraHost, OAuthInfo oauth, string jiraIssuePrefix = null)
        {
            _jiraHost = new Uri(jiraHost);
            AuthInfo = oauth;
            _jiraIssuePrefix = jiraIssuePrefix;

            InitUris();
        }
开发者ID:modulexcite,项目名称:ShareX_Google_Code,代码行数:8,代码来源:Jira.cs

示例4: TwitPicUploader

 public TwitPicUploader(string key, OAuthInfo oauth)
 {
     APIKey = key;
     AuthInfo = oauth;
     TwitPicUploadType = TwitPicUploadType.UPLOAD_IMAGE_ONLY;
     ShowFull = false;
     TwitPicThumbnailMode = TwitPicThumbnailType.Thumb;
 }
开发者ID:Edison6351,项目名称:ShareX,代码行数:8,代码来源:TwitPicUploader.cs

示例5: DropboxFilesForm

        public DropboxFilesForm(OAuthInfo oauth, string path = null)
        {
            InitializeComponent();
            dropbox = new Dropbox(oauth);
            ilm = new ImageListManager(lvDropboxFiles);

            if (path != null)
            {
                Shown += (sender, e) => OpenDirectory(path);
            }
        }
开发者ID:modulexcite,项目名称:ZScreen_Google_Code,代码行数:11,代码来源:DropboxFilesForm.cs

示例6: DropboxFilesForm

        public DropboxFilesForm(OAuthInfo oauth, string path, DropboxAccountInfo accountInfo)
        {
            InitializeComponent();
            Icon = Resources.Dropbox;

            dropbox = new Dropbox(oauth);
            dropboxAccountInfo = accountInfo;
            ilm = new ImageListManager(lvDropboxFiles);

            if (path != null)
            {
                Shown += (sender, e) => OpenDirectory(path);
            }
        }
开发者ID:petronas,项目名称:ShareX,代码行数:14,代码来源:DropboxFilesForm.cs

示例7: GenerateQuery

        public static string GenerateQuery(string url, Dictionary<string, string> args, HttpMethod httpMethod, OAuthInfo oauth)
        {
            if (string.IsNullOrEmpty(oauth.ConsumerKey) || string.IsNullOrEmpty(oauth.ConsumerSecret))
            {
                throw new Exception("ConsumerKey or ConsumerSecret empty.");
            }

            Dictionary<string, string> parameters = new Dictionary<string, string>();
            parameters.Add(ParameterVersion, oauth.OAuthVersion);
            parameters.Add(ParameterNonce, GenerateNonce());
            parameters.Add(ParameterTimestamp, GenerateTimestamp());
            parameters.Add(ParameterSignatureMethod, HMACSHA1SignatureType);
            parameters.Add(ParameterConsumerKey, oauth.ConsumerKey);

            string secret = null;

            if (!string.IsNullOrEmpty(oauth.UserToken) && !string.IsNullOrEmpty(oauth.UserSecret))
            {
                secret = oauth.UserSecret;
                parameters.Add(ParameterToken, oauth.UserToken);
            }
            else if (!string.IsNullOrEmpty(oauth.AuthToken) && !string.IsNullOrEmpty(oauth.AuthSecret))
            {
                secret = oauth.AuthSecret;
                parameters.Add(ParameterToken, oauth.AuthToken);

                if (!string.IsNullOrEmpty(oauth.AuthVerifier))
                {
                    parameters.Add(ParameterVerifier, oauth.AuthVerifier);
                }
            }

            if (args != null)
            {
                foreach (KeyValuePair<string, string> arg in args)
                {
                    parameters.Add(arg.Key, arg.Value);
                }
            }

            string normalizedUrl = NormalizeUrl(url);
            string normalizedParameters = NormalizeParameters(parameters);
            string signatureBase = GenerateSignatureBase(httpMethod, normalizedUrl, normalizedParameters);
            string signature = GenerateSignature(signatureBase, oauth.ConsumerSecret, secret);

            return string.Format("{0}?{1}&{2}={3}", normalizedUrl, normalizedParameters, ParameterSignature, signature);
        }
开发者ID:modulexcite,项目名称:ZScreen_Google_Code,代码行数:47,代码来源:OAuthManager.cs

示例8: TwitterAccountAddButton_Click

 private void TwitterAccountAddButton_Click(object sender, EventArgs e)
 {
     OAuthInfo acc = new OAuthInfo();
     Config.TwitterOAuthInfoList.Add(acc);
     ucTwitterAccounts.AddItem(acc);
 }
开发者ID:nsdown,项目名称:ShareX,代码行数:6,代码来源:UploadersConfigForm.cs

示例9: Twitter

 public Twitter(OAuthInfo oauth)
 {
     AuthInfo = oauth;
 }
开发者ID:TreeSeed,项目名称:ShareX,代码行数:4,代码来源:Twitter.cs

示例10: TwitterTweetForm

 public TwitterTweetForm(OAuthInfo oauth)
     : this()
 {
     AuthInfo = oauth;
 }
开发者ID:barsv,项目名称:ShareX,代码行数:5,代码来源:TwitterTweetForm.cs

示例11: Dropbox

 public Dropbox(OAuthInfo oauth, string uploadPath, DropboxAccountInfo accountInfo)
     : this(oauth)
 {
     UploadPath = uploadPath;
     AccountInfo = accountInfo;
 }
开发者ID:modulexcite,项目名称:ZScreen_Google_Code,代码行数:6,代码来源:Dropbox.cs

示例12: CopyAuthOpen

        public void CopyAuthOpen()
        {
            try
            {
                OAuthInfo oauth = new OAuthInfo(APIKeys.CopyConsumerKey, APIKeys.CopyConsumerSecret);

                string url = new Copy(oauth).GetAuthorizationURL();

                if (!string.IsNullOrEmpty(url))
                {
                    Config.CopyOAuthInfo = oauth;
                    URLHelpers.OpenURL(url);
                    DebugHelper.WriteLine("CopyAuthOpen - Authorization URL is opened: " + url);
                }
                else
                {
                    DebugHelper.WriteLine("CopyAuthOpen - Authorization URL is empty.");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
开发者ID:jakesyl,项目名称:ShareX,代码行数:24,代码来源:UploadersConfigFormHelper.cs

示例13: TwitterAuthOpen

        public void TwitterAuthOpen()
        {
            if (CheckTwitterAccounts())
            {
                OAuthInfo acc = new OAuthInfo(APIKeys.TwitterConsumerKey, APIKeys.TwitterConsumerSecret);
                Twitter twitter = new Twitter(acc);
                string url = twitter.GetAuthorizationURL();

                if (!string.IsNullOrEmpty(url))
                {
                    acc.Description = Config.TwitterOAuthInfoList[Config.TwitterSelectedAccount].Description;
                    Config.TwitterOAuthInfoList[Config.TwitterSelectedAccount] = acc;
                    ucTwitterAccounts.pgSettings.SelectedObject = acc;
                    URLHelpers.OpenURL(url);
                    btnTwitterLogin.Enabled = true;
                }
            }
        }
开发者ID:jakesyl,项目名称:ShareX,代码行数:18,代码来源:UploadersConfigFormHelper.cs

示例14: JiraAuthOpen

        public void JiraAuthOpen()
        {
            try
            {
                OAuthInfo oauth = new OAuthInfo(APIKeys.JiraConsumerKey);
                oauth.SignatureMethod = OAuthInfo.OAuthInfoSignatureMethod.RSA_SHA1;
                oauth.ConsumerPrivateKey = Jira.PrivateKey;

                string url = new Jira(Config.JiraHost, oauth).GetAuthorizationURL();

                if (!string.IsNullOrEmpty(url))
                {
                    Config.JiraOAuthInfo = oauth;
                    Helpers.OpenURL(url);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
开发者ID:rushil33d,项目名称:ShareX,代码行数:21,代码来源:UploadersConfigFormHelper.cs

示例15: GetAuthorizationURL

        protected string GetAuthorizationURL(string requestTokenURL, string authorizeURL, OAuthInfo authInfo,
            Dictionary<string, string> customParameters = null, HttpMethod httpMethod = HttpMethod.GET)
        {
            string url = OAuthManager.GenerateQuery(requestTokenURL, customParameters, httpMethod, authInfo);

            string response = SendRequest(httpMethod, url);

            if (!string.IsNullOrEmpty(response))
            {
                return OAuthManager.GetAuthorizationURL(response, authInfo, authorizeURL);
            }

            return null;
        }
开发者ID:Z1ni,项目名称:ShareX,代码行数:14,代码来源:Uploader.cs


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