本文整理汇总了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();
}
示例2: Jira
public Jira(string jiraBaseAddress, OAuthInfo oauth, string jiraIssuePrefix = null)
{
_jiraBaseAddress = jiraBaseAddress;
AuthInfo = oauth;
_jiraIssuePrefix = jiraIssuePrefix;
InitUris();
}
示例3: Jira
public Jira(string jiraHost, OAuthInfo oauth, string jiraIssuePrefix = null)
{
_jiraHost = new Uri(jiraHost);
AuthInfo = oauth;
_jiraIssuePrefix = jiraIssuePrefix;
InitUris();
}
示例4: TwitPicUploader
public TwitPicUploader(string key, OAuthInfo oauth)
{
APIKey = key;
AuthInfo = oauth;
TwitPicUploadType = TwitPicUploadType.UPLOAD_IMAGE_ONLY;
ShowFull = false;
TwitPicThumbnailMode = TwitPicThumbnailType.Thumb;
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例8: TwitterAccountAddButton_Click
private void TwitterAccountAddButton_Click(object sender, EventArgs e)
{
OAuthInfo acc = new OAuthInfo();
Config.TwitterOAuthInfoList.Add(acc);
ucTwitterAccounts.AddItem(acc);
}
示例9: Twitter
public Twitter(OAuthInfo oauth)
{
AuthInfo = oauth;
}
示例10: TwitterTweetForm
public TwitterTweetForm(OAuthInfo oauth)
: this()
{
AuthInfo = oauth;
}
示例11: Dropbox
public Dropbox(OAuthInfo oauth, string uploadPath, DropboxAccountInfo accountInfo)
: this(oauth)
{
UploadPath = uploadPath;
AccountInfo = accountInfo;
}
示例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);
}
}
示例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;
}
}
}
示例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);
}
}
示例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;
}