Use OAuthLoopbackControl for Google Photos

This commit is contained in:
Jaex 2022-12-10 12:51:49 +03:00
parent f8df95df1b
commit 7fb9ad6b60
7 changed files with 2281 additions and 8404 deletions

View file

@ -122,6 +122,9 @@
<value>Top, Left, Right</value> <value>Top, Left, Right</value>
</data> </data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnConnect.Font" type="System.Drawing.Font, System.Drawing">
<value>Microsoft Sans Serif, 9.75pt</value>
</data>
<data name="btnConnect.Location" type="System.Drawing.Point, System.Drawing"> <data name="btnConnect.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 32</value> <value>8, 32</value>
</data> </data>
@ -150,6 +153,9 @@
<data name="lblStatus.AutoSize" type="System.Boolean, mscorlib"> <data name="lblStatus.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
</data> </data>
<data name="lblStatus.Font" type="System.Drawing.Font, System.Drawing">
<value>Microsoft Sans Serif, 9.75pt</value>
</data>
<data name="lblStatus.Location" type="System.Drawing.Point, System.Drawing"> <data name="lblStatus.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value> <value>0, 0</value>
</data> </data>
@ -157,7 +163,7 @@
<value>0, 0, 0, 0</value> <value>0, 0, 0, 0</value>
</data> </data>
<data name="lblStatus.Size" type="System.Drawing.Size, System.Drawing"> <data name="lblStatus.Size" type="System.Drawing.Size, System.Drawing">
<value>40, 13</value> <value>47, 16</value>
</data> </data>
<data name="lblStatus.TabIndex" type="System.Int32, mscorlib"> <data name="lblStatus.TabIndex" type="System.Int32, mscorlib">
<value>0</value> <value>0</value>
@ -183,14 +189,17 @@
<data name="lblStatusValue.AutoSize" type="System.Boolean, mscorlib"> <data name="lblStatusValue.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
</data> </data>
<data name="lblStatusValue.Font" type="System.Drawing.Font, System.Drawing">
<value>Microsoft Sans Serif, 9.75pt</value>
</data>
<data name="lblStatusValue.Location" type="System.Drawing.Point, System.Drawing"> <data name="lblStatusValue.Location" type="System.Drawing.Point, System.Drawing">
<value>40, 0</value> <value>47, 0</value>
</data> </data>
<data name="lblStatusValue.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms"> <data name="lblStatusValue.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 0, 0, 0</value> <value>0, 0, 0, 0</value>
</data> </data>
<data name="lblStatusValue.Size" type="System.Drawing.Size, System.Drawing"> <data name="lblStatusValue.Size" type="System.Drawing.Size, System.Drawing">
<value>0, 13</value> <value>0, 16</value>
</data> </data>
<data name="lblStatusValue.TabIndex" type="System.Int32, mscorlib"> <data name="lblStatusValue.TabIndex" type="System.Int32, mscorlib">
<value>1</value> <value>1</value>

View file

@ -57,13 +57,12 @@ public override GenericUploader CreateUploader(UploadersConfig config, TaskRefer
public sealed class YouTube : FileUploader, IOAuth2 public sealed class YouTube : FileUploader, IOAuth2
{ {
public GoogleOAuth2 OAuth2 { get; private set; }
public OAuth2Info AuthInfo => OAuth2.AuthInfo; public OAuth2Info AuthInfo => OAuth2.AuthInfo;
public YouTubeVideoPrivacy PrivacyType { get; set; } public YouTubeVideoPrivacy PrivacyType { get; set; }
public bool UseShortenedLink { get; set; } public bool UseShortenedLink { get; set; }
public bool ShowDialog { get; set; } public bool ShowDialog { get; set; }
public GoogleOAuth2 OAuth2 { get; private set; }
public YouTube(OAuth2Info oauth) public YouTube(OAuth2Info oauth)
{ {
OAuth2 = new GoogleOAuth2(oauth, this) OAuth2 = new GoogleOAuth2(oauth, this)

View file

@ -71,7 +71,6 @@ private void InitializeComponent()
this.lblTwitterDefaultMessage = new System.Windows.Forms.Label(); this.lblTwitterDefaultMessage = new System.Windows.Forms.Label();
this.txtTwitterDefaultMessage = new System.Windows.Forms.TextBox(); this.txtTwitterDefaultMessage = new System.Windows.Forms.TextBox();
this.cbTwitterSkipMessageBox = new System.Windows.Forms.CheckBox(); this.cbTwitterSkipMessageBox = new System.Windows.Forms.CheckBox();
this.oauthTwitter = new ShareX.UploadersLib.OAuthControl();
this.txtTwitterDescription = new System.Windows.Forms.TextBox(); this.txtTwitterDescription = new System.Windows.Forms.TextBox();
this.lblTwitterDescription = new System.Windows.Forms.Label(); this.lblTwitterDescription = new System.Windows.Forms.Label();
this.btnTwitterRemove = new System.Windows.Forms.Button(); this.btnTwitterRemove = new System.Windows.Forms.Button();
@ -81,7 +80,6 @@ private void InitializeComponent()
this.tpBitly = new System.Windows.Forms.TabPage(); this.tpBitly = new System.Windows.Forms.TabPage();
this.txtBitlyDomain = new System.Windows.Forms.TextBox(); this.txtBitlyDomain = new System.Windows.Forms.TextBox();
this.lblBitlyDomain = new System.Windows.Forms.Label(); this.lblBitlyDomain = new System.Windows.Forms.Label();
this.oauth2Bitly = new ShareX.UploadersLib.OAuthControl();
this.tpYourls = new System.Windows.Forms.TabPage(); this.tpYourls = new System.Windows.Forms.TabPage();
this.txtYourlsPassword = new System.Windows.Forms.TextBox(); this.txtYourlsPassword = new System.Windows.Forms.TextBox();
this.txtYourlsUsername = new System.Windows.Forms.TextBox(); this.txtYourlsUsername = new System.Windows.Forms.TextBox();
@ -189,12 +187,10 @@ private void InitializeComponent()
this.cbDropboxAutoCreateShareableLink = new System.Windows.Forms.CheckBox(); this.cbDropboxAutoCreateShareableLink = new System.Windows.Forms.CheckBox();
this.lblDropboxPath = new System.Windows.Forms.Label(); this.lblDropboxPath = new System.Windows.Forms.Label();
this.txtDropboxPath = new System.Windows.Forms.TextBox(); this.txtDropboxPath = new System.Windows.Forms.TextBox();
this.oauth2Dropbox = new ShareX.UploadersLib.OAuthControl();
this.tpOneDrive = new System.Windows.Forms.TabPage(); this.tpOneDrive = new System.Windows.Forms.TabPage();
this.tvOneDrive = new System.Windows.Forms.TreeView(); this.tvOneDrive = new System.Windows.Forms.TreeView();
this.lblOneDriveFolderID = new System.Windows.Forms.Label(); this.lblOneDriveFolderID = new System.Windows.Forms.Label();
this.cbOneDriveCreateShareableLink = new System.Windows.Forms.CheckBox(); this.cbOneDriveCreateShareableLink = new System.Windows.Forms.CheckBox();
this.oAuth2OneDrive = new ShareX.UploadersLib.OAuthControl();
this.tpGoogleDrive = new System.Windows.Forms.TabPage(); this.tpGoogleDrive = new System.Windows.Forms.TabPage();
this.cbGoogleDriveSharedDrive = new System.Windows.Forms.ComboBox(); this.cbGoogleDriveSharedDrive = new System.Windows.Forms.ComboBox();
this.cbGoogleDriveDirectLink = new System.Windows.Forms.CheckBox(); this.cbGoogleDriveDirectLink = new System.Windows.Forms.CheckBox();
@ -206,7 +202,6 @@ private void InitializeComponent()
this.chGoogleDriveDescription = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.chGoogleDriveDescription = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.btnGoogleDriveRefreshFolders = new System.Windows.Forms.Button(); this.btnGoogleDriveRefreshFolders = new System.Windows.Forms.Button();
this.cbGoogleDriveIsPublic = new System.Windows.Forms.CheckBox(); this.cbGoogleDriveIsPublic = new System.Windows.Forms.CheckBox();
this.oauth2GoogleDrive = new ShareX.UploadersLib.OAuthControl();
this.tpPuush = new System.Windows.Forms.TabPage(); this.tpPuush = new System.Windows.Forms.TabPage();
this.lblPuushAPIKey = new System.Windows.Forms.Label(); this.lblPuushAPIKey = new System.Windows.Forms.Label();
this.txtPuushAPIKey = new System.Windows.Forms.TextBox(); this.txtPuushAPIKey = new System.Windows.Forms.TextBox();
@ -225,7 +220,6 @@ private void InitializeComponent()
this.chBoxFoldersName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.chBoxFoldersName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.lblBoxFolderID = new System.Windows.Forms.Label(); this.lblBoxFolderID = new System.Windows.Forms.Label();
this.btnBoxRefreshFolders = new System.Windows.Forms.Button(); this.btnBoxRefreshFolders = new System.Windows.Forms.Button();
this.oauth2Box = new ShareX.UploadersLib.OAuthControl();
this.tpAmazonS3 = new System.Windows.Forms.TabPage(); this.tpAmazonS3 = new System.Windows.Forms.TabPage();
this.gbAmazonS3Advanced = new System.Windows.Forms.GroupBox(); this.gbAmazonS3Advanced = new System.Windows.Forms.GroupBox();
this.cbAmazonS3SignedPayload = new System.Windows.Forms.CheckBox(); this.cbAmazonS3SignedPayload = new System.Windows.Forms.CheckBox();
@ -272,7 +266,6 @@ private void InitializeComponent()
this.txtGoogleCloudStorageDomain = new System.Windows.Forms.TextBox(); this.txtGoogleCloudStorageDomain = new System.Windows.Forms.TextBox();
this.lblGoogleCloudStorageBucket = new System.Windows.Forms.Label(); this.lblGoogleCloudStorageBucket = new System.Windows.Forms.Label();
this.txtGoogleCloudStorageBucket = new System.Windows.Forms.TextBox(); this.txtGoogleCloudStorageBucket = new System.Windows.Forms.TextBox();
this.oauth2GoogleCloudStorage = new ShareX.UploadersLib.OAuthControl();
this.tpAzureStorage = new System.Windows.Forms.TabPage(); this.tpAzureStorage = new System.Windows.Forms.TabPage();
this.lblAzureStorageURLPreview = new System.Windows.Forms.Label(); this.lblAzureStorageURLPreview = new System.Windows.Forms.Label();
this.lblAzureStorageURLPreviewLabel = new System.Windows.Forms.Label(); this.lblAzureStorageURLPreviewLabel = new System.Windows.Forms.Label();
@ -302,8 +295,6 @@ private void InitializeComponent()
this.lblGfycatTitle = new System.Windows.Forms.Label(); this.lblGfycatTitle = new System.Windows.Forms.Label();
this.cbGfycatKeepAudio = new System.Windows.Forms.CheckBox(); this.cbGfycatKeepAudio = new System.Windows.Forms.CheckBox();
this.cbGfycatIsPublic = new System.Windows.Forms.CheckBox(); this.cbGfycatIsPublic = new System.Windows.Forms.CheckBox();
this.atcGfycatAccountType = new ShareX.UploadersLib.AccountTypeControl();
this.oauth2Gfycat = new ShareX.UploadersLib.OAuthControl();
this.tpMega = new System.Windows.Forms.TabPage(); this.tpMega = new System.Windows.Forms.TabPage();
this.btnMegaRefreshFolders = new System.Windows.Forms.Button(); this.btnMegaRefreshFolders = new System.Windows.Forms.Button();
this.lblMegaStatus = new System.Windows.Forms.Label(); this.lblMegaStatus = new System.Windows.Forms.Label();
@ -354,7 +345,6 @@ private void InitializeComponent()
this.lblSendSpaceUsername = new System.Windows.Forms.Label(); this.lblSendSpaceUsername = new System.Windows.Forms.Label();
this.txtSendSpacePassword = new System.Windows.Forms.TextBox(); this.txtSendSpacePassword = new System.Windows.Forms.TextBox();
this.txtSendSpaceUserName = new System.Windows.Forms.TextBox(); this.txtSendSpaceUserName = new System.Windows.Forms.TextBox();
this.atcSendSpaceAccountType = new ShareX.UploadersLib.AccountTypeControl();
this.tpHostr = new System.Windows.Forms.TabPage(); this.tpHostr = new System.Windows.Forms.TabPage();
this.cbLocalhostrDirectURL = new System.Windows.Forms.CheckBox(); this.cbLocalhostrDirectURL = new System.Windows.Forms.CheckBox();
this.lblLocalhostrPassword = new System.Windows.Forms.Label(); this.lblLocalhostrPassword = new System.Windows.Forms.Label();
@ -368,7 +358,6 @@ private void InitializeComponent()
this.txtJiraConfigHelp = new System.Windows.Forms.TextBox(); this.txtJiraConfigHelp = new System.Windows.Forms.TextBox();
this.txtJiraHost = new System.Windows.Forms.TextBox(); this.txtJiraHost = new System.Windows.Forms.TextBox();
this.lblJiraHost = new System.Windows.Forms.Label(); this.lblJiraHost = new System.Windows.Forms.Label();
this.oAuthJira = new ShareX.UploadersLib.OAuthControl();
this.tpLambda = new System.Windows.Forms.TabPage(); this.tpLambda = new System.Windows.Forms.TabPage();
this.lblLambdaInfo = new System.Windows.Forms.Label(); this.lblLambdaInfo = new System.Windows.Forms.Label();
this.lblLambdaApiKey = new System.Windows.Forms.Label(); this.lblLambdaApiKey = new System.Windows.Forms.Label();
@ -389,7 +378,6 @@ private void InitializeComponent()
this.cbTeknikEncrypt = new System.Windows.Forms.CheckBox(); this.cbTeknikEncrypt = new System.Windows.Forms.CheckBox();
this.lblTeknikUploadAPIUrl = new System.Windows.Forms.Label(); this.lblTeknikUploadAPIUrl = new System.Windows.Forms.Label();
this.tbTeknikUploadAPIUrl = new System.Windows.Forms.TextBox(); this.tbTeknikUploadAPIUrl = new System.Windows.Forms.TextBox();
this.oauthTeknik = new ShareX.UploadersLib.OAuthControl();
this.tpPomf = new System.Windows.Forms.TabPage(); this.tpPomf = new System.Windows.Forms.TabPage();
this.txtPomfResultURL = new System.Windows.Forms.TextBox(); this.txtPomfResultURL = new System.Windows.Forms.TextBox();
this.txtPomfUploadURL = new System.Windows.Forms.TextBox(); this.txtPomfUploadURL = new System.Windows.Forms.TextBox();
@ -474,7 +462,6 @@ private void InitializeComponent()
this.txtPlikPassword = new System.Windows.Forms.TextBox(); this.txtPlikPassword = new System.Windows.Forms.TextBox();
this.txtPlikLogin = new System.Windows.Forms.TextBox(); this.txtPlikLogin = new System.Windows.Forms.TextBox();
this.tpYouTube = new System.Windows.Forms.TabPage(); this.tpYouTube = new System.Windows.Forms.TabPage();
this.oauth2YouTube = new ShareX.UploadersLib.OAuthLoopbackControl();
this.llYouTubePermissionsLink = new System.Windows.Forms.LinkLabel(); this.llYouTubePermissionsLink = new System.Windows.Forms.LinkLabel();
this.lblYouTubePermissionsTip = new System.Windows.Forms.Label(); this.lblYouTubePermissionsTip = new System.Windows.Forms.Label();
this.cbYouTubeShowDialog = new System.Windows.Forms.CheckBox(); this.cbYouTubeShowDialog = new System.Windows.Forms.CheckBox();
@ -540,7 +527,6 @@ private void InitializeComponent()
this.txtGistCustomURL = new System.Windows.Forms.TextBox(); this.txtGistCustomURL = new System.Windows.Forms.TextBox();
this.cbGistUseRawURL = new System.Windows.Forms.CheckBox(); this.cbGistUseRawURL = new System.Windows.Forms.CheckBox();
this.cbGistPublishPublic = new System.Windows.Forms.CheckBox(); this.cbGistPublishPublic = new System.Windows.Forms.CheckBox();
this.oAuth2Gist = new ShareX.UploadersLib.OAuthControl();
this.tpUpaste = new System.Windows.Forms.TabPage(); this.tpUpaste = new System.Windows.Forms.TabPage();
this.cbUpasteIsPublic = new System.Windows.Forms.CheckBox(); this.cbUpasteIsPublic = new System.Windows.Forms.CheckBox();
this.lblUpasteUserKey = new System.Windows.Forms.Label(); this.lblUpasteUserKey = new System.Windows.Forms.Label();
@ -564,8 +550,6 @@ private void InitializeComponent()
this.cbImgurUseGIFV = new System.Windows.Forms.CheckBox(); this.cbImgurUseGIFV = new System.Windows.Forms.CheckBox();
this.cbImgurUploadSelectedAlbum = new System.Windows.Forms.CheckBox(); this.cbImgurUploadSelectedAlbum = new System.Windows.Forms.CheckBox();
this.cbImgurDirectLink = new System.Windows.Forms.CheckBox(); this.cbImgurDirectLink = new System.Windows.Forms.CheckBox();
this.atcImgurAccountType = new ShareX.UploadersLib.AccountTypeControl();
this.oauth2Imgur = new ShareX.UploadersLib.OAuthControl();
this.lvImgurAlbumList = new ShareX.HelpersLib.MyListView(); this.lvImgurAlbumList = new ShareX.HelpersLib.MyListView();
this.chImgurID = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.chImgurID = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chImgurTitle = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.chImgurTitle = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
@ -584,7 +568,6 @@ private void InitializeComponent()
this.lblImageShackPassword = new System.Windows.Forms.Label(); this.lblImageShackPassword = new System.Windows.Forms.Label();
this.tpFlickr = new System.Windows.Forms.TabPage(); this.tpFlickr = new System.Windows.Forms.TabPage();
this.cbFlickrDirectLink = new System.Windows.Forms.CheckBox(); this.cbFlickrDirectLink = new System.Windows.Forms.CheckBox();
this.oauthFlickr = new ShareX.UploadersLib.OAuthControl();
this.tpPhotobucket = new System.Windows.Forms.TabPage(); this.tpPhotobucket = new System.Windows.Forms.TabPage();
this.gbPhotobucketAlbumPath = new System.Windows.Forms.GroupBox(); this.gbPhotobucketAlbumPath = new System.Windows.Forms.GroupBox();
this.btnPhotobucketAddAlbum = new System.Windows.Forms.Button(); this.btnPhotobucketAddAlbum = new System.Windows.Forms.Button();
@ -616,7 +599,6 @@ private void InitializeComponent()
this.chPicasaName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.chPicasaName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chPicasaDescription = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.chPicasaDescription = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.btnPicasaRefreshAlbumList = new System.Windows.Forms.Button(); this.btnPicasaRefreshAlbumList = new System.Windows.Forms.Button();
this.oauth2Picasa = new ShareX.UploadersLib.OAuthControl();
this.tpChevereto = new System.Windows.Forms.TabPage(); this.tpChevereto = new System.Windows.Forms.TabPage();
this.lblCheveretoUploadURLExample = new System.Windows.Forms.Label(); this.lblCheveretoUploadURLExample = new System.Windows.Forms.Label();
this.cbCheveretoDirectURL = new System.Windows.Forms.CheckBox(); this.cbCheveretoDirectURL = new System.Windows.Forms.CheckBox();
@ -630,6 +612,24 @@ private void InitializeComponent()
this.lvlVgymeUserKey = new System.Windows.Forms.Label(); this.lvlVgymeUserKey = new System.Windows.Forms.Label();
this.tcUploaders = new System.Windows.Forms.TabControl(); this.tcUploaders = new System.Windows.Forms.TabControl();
this.tttvMain = new ShareX.HelpersLib.TabToTreeView(); this.tttvMain = new ShareX.HelpersLib.TabToTreeView();
this.atcImgurAccountType = new ShareX.UploadersLib.AccountTypeControl();
this.oauth2Imgur = new ShareX.UploadersLib.OAuthControl();
this.oauthFlickr = new ShareX.UploadersLib.OAuthControl();
this.oauth2GooglePhotos = new ShareX.UploadersLib.OAuthLoopbackControl();
this.oAuth2Gist = new ShareX.UploadersLib.OAuthControl();
this.oauth2Dropbox = new ShareX.UploadersLib.OAuthControl();
this.oAuth2OneDrive = new ShareX.UploadersLib.OAuthControl();
this.oauth2GoogleDrive = new ShareX.UploadersLib.OAuthControl();
this.oauth2Box = new ShareX.UploadersLib.OAuthControl();
this.oauth2GoogleCloudStorage = new ShareX.UploadersLib.OAuthControl();
this.oauthTwitter = new ShareX.UploadersLib.OAuthControl();
this.oauth2Bitly = new ShareX.UploadersLib.OAuthControl();
this.atcGfycatAccountType = new ShareX.UploadersLib.AccountTypeControl();
this.oauth2Gfycat = new ShareX.UploadersLib.OAuthControl();
this.atcSendSpaceAccountType = new ShareX.UploadersLib.AccountTypeControl();
this.oAuthJira = new ShareX.UploadersLib.OAuthControl();
this.oauthTeknik = new ShareX.UploadersLib.OAuthControl();
this.oauth2YouTube = new ShareX.UploadersLib.OAuthLoopbackControl();
this.actRapidShareAccountType = new ShareX.UploadersLib.AccountTypeControl(); this.actRapidShareAccountType = new ShareX.UploadersLib.AccountTypeControl();
this.tpOtherUploaders.SuspendLayout(); this.tpOtherUploaders.SuspendLayout();
this.tcOtherUploaders.SuspendLayout(); this.tcOtherUploaders.SuspendLayout();
@ -840,16 +840,6 @@ private void InitializeComponent()
this.cbTwitterSkipMessageBox.UseVisualStyleBackColor = true; this.cbTwitterSkipMessageBox.UseVisualStyleBackColor = true;
this.cbTwitterSkipMessageBox.CheckedChanged += new System.EventHandler(this.cbTwitterSkipMessageBox_CheckedChanged); this.cbTwitterSkipMessageBox.CheckedChanged += new System.EventHandler(this.cbTwitterSkipMessageBox_CheckedChanged);
// //
// oauthTwitter
//
resources.ApplyResources(this.oauthTwitter, "oauthTwitter");
this.oauthTwitter.IsRefreshable = false;
this.oauthTwitter.Name = "oauthTwitter";
this.oauthTwitter.UserInfo = null;
this.oauthTwitter.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauthTwitter_OpenButtonClicked);
this.oauthTwitter.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauthTwitter_CompleteButtonClicked);
this.oauthTwitter.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauthTwitter_ClearButtonClicked);
//
// txtTwitterDescription // txtTwitterDescription
// //
resources.ApplyResources(this.txtTwitterDescription, "txtTwitterDescription"); resources.ApplyResources(this.txtTwitterDescription, "txtTwitterDescription");
@ -914,16 +904,6 @@ private void InitializeComponent()
resources.ApplyResources(this.lblBitlyDomain, "lblBitlyDomain"); resources.ApplyResources(this.lblBitlyDomain, "lblBitlyDomain");
this.lblBitlyDomain.Name = "lblBitlyDomain"; this.lblBitlyDomain.Name = "lblBitlyDomain";
// //
// oauth2Bitly
//
this.oauth2Bitly.IsRefreshable = false;
resources.ApplyResources(this.oauth2Bitly, "oauth2Bitly");
this.oauth2Bitly.Name = "oauth2Bitly";
this.oauth2Bitly.UserInfo = null;
this.oauth2Bitly.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2Bitly_OpenButtonClicked);
this.oauth2Bitly.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2Bitly_CompleteButtonClicked);
this.oauth2Bitly.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2Bitly_ClearButtonClicked);
//
// tpYourls // tpYourls
// //
this.tpYourls.BackColor = System.Drawing.SystemColors.Window; this.tpYourls.BackColor = System.Drawing.SystemColors.Window;
@ -1720,16 +1700,6 @@ private void InitializeComponent()
this.txtDropboxPath.Name = "txtDropboxPath"; this.txtDropboxPath.Name = "txtDropboxPath";
this.txtDropboxPath.TextChanged += new System.EventHandler(this.txtDropboxPath_TextChanged); this.txtDropboxPath.TextChanged += new System.EventHandler(this.txtDropboxPath_TextChanged);
// //
// oauth2Dropbox
//
this.oauth2Dropbox.IsRefreshable = false;
resources.ApplyResources(this.oauth2Dropbox, "oauth2Dropbox");
this.oauth2Dropbox.Name = "oauth2Dropbox";
this.oauth2Dropbox.UserInfo = null;
this.oauth2Dropbox.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2Dropbox_OpenButtonClicked);
this.oauth2Dropbox.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2Dropbox_CompleteButtonClicked);
this.oauth2Dropbox.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2Dropbox_ClearButtonClicked);
//
// tpOneDrive // tpOneDrive
// //
this.tpOneDrive.BackColor = System.Drawing.SystemColors.Window; this.tpOneDrive.BackColor = System.Drawing.SystemColors.Window;
@ -1759,16 +1729,6 @@ private void InitializeComponent()
this.cbOneDriveCreateShareableLink.UseVisualStyleBackColor = true; this.cbOneDriveCreateShareableLink.UseVisualStyleBackColor = true;
this.cbOneDriveCreateShareableLink.CheckedChanged += new System.EventHandler(this.cbOneDriveCreateShareableLink_CheckedChanged); this.cbOneDriveCreateShareableLink.CheckedChanged += new System.EventHandler(this.cbOneDriveCreateShareableLink_CheckedChanged);
// //
// oAuth2OneDrive
//
resources.ApplyResources(this.oAuth2OneDrive, "oAuth2OneDrive");
this.oAuth2OneDrive.Name = "oAuth2OneDrive";
this.oAuth2OneDrive.UserInfo = null;
this.oAuth2OneDrive.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oAuth2OneDrive_OpenButtonClicked);
this.oAuth2OneDrive.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oAuth2OneDrive_CompleteButtonClicked);
this.oAuth2OneDrive.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oAuth2OneDrive_ClearButtonClicked);
this.oAuth2OneDrive.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oAuth2OneDrive_RefreshButtonClicked);
//
// tpGoogleDrive // tpGoogleDrive
// //
this.tpGoogleDrive.BackColor = System.Drawing.SystemColors.Window; this.tpGoogleDrive.BackColor = System.Drawing.SystemColors.Window;
@ -1854,16 +1814,6 @@ private void InitializeComponent()
this.cbGoogleDriveIsPublic.UseVisualStyleBackColor = true; this.cbGoogleDriveIsPublic.UseVisualStyleBackColor = true;
this.cbGoogleDriveIsPublic.CheckedChanged += new System.EventHandler(this.cbGoogleDriveIsPublic_CheckedChanged); this.cbGoogleDriveIsPublic.CheckedChanged += new System.EventHandler(this.cbGoogleDriveIsPublic_CheckedChanged);
// //
// oauth2GoogleDrive
//
resources.ApplyResources(this.oauth2GoogleDrive, "oauth2GoogleDrive");
this.oauth2GoogleDrive.Name = "oauth2GoogleDrive";
this.oauth2GoogleDrive.UserInfo = null;
this.oauth2GoogleDrive.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2GoogleDrive_OpenButtonClicked);
this.oauth2GoogleDrive.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2GoogleDrive_CompleteButtonClicked);
this.oauth2GoogleDrive.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2GoogleDrive_ClearButtonClicked);
this.oauth2GoogleDrive.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oauth2GoogleDrive_RefreshButtonClicked);
//
// tpPuush // tpPuush
// //
this.tpPuush.BackColor = System.Drawing.SystemColors.Window; this.tpPuush.BackColor = System.Drawing.SystemColors.Window;
@ -1994,16 +1944,6 @@ private void InitializeComponent()
this.btnBoxRefreshFolders.UseVisualStyleBackColor = true; this.btnBoxRefreshFolders.UseVisualStyleBackColor = true;
this.btnBoxRefreshFolders.Click += new System.EventHandler(this.btnBoxRefreshFolders_Click); this.btnBoxRefreshFolders.Click += new System.EventHandler(this.btnBoxRefreshFolders_Click);
// //
// oauth2Box
//
resources.ApplyResources(this.oauth2Box, "oauth2Box");
this.oauth2Box.Name = "oauth2Box";
this.oauth2Box.UserInfo = null;
this.oauth2Box.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2Box_OpenButtonClicked);
this.oauth2Box.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2Box_CompleteButtonClicked);
this.oauth2Box.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2Box_ClearButtonClicked);
this.oauth2Box.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oauth2Box_RefreshButtonClicked);
//
// tpAmazonS3 // tpAmazonS3
// //
this.tpAmazonS3.BackColor = System.Drawing.SystemColors.Window; this.tpAmazonS3.BackColor = System.Drawing.SystemColors.Window;
@ -2327,16 +2267,6 @@ private void InitializeComponent()
this.txtGoogleCloudStorageBucket.Name = "txtGoogleCloudStorageBucket"; this.txtGoogleCloudStorageBucket.Name = "txtGoogleCloudStorageBucket";
this.txtGoogleCloudStorageBucket.TextChanged += new System.EventHandler(this.txtGoogleCloudStorageBucket_TextChanged); this.txtGoogleCloudStorageBucket.TextChanged += new System.EventHandler(this.txtGoogleCloudStorageBucket_TextChanged);
// //
// oauth2GoogleCloudStorage
//
resources.ApplyResources(this.oauth2GoogleCloudStorage, "oauth2GoogleCloudStorage");
this.oauth2GoogleCloudStorage.Name = "oauth2GoogleCloudStorage";
this.oauth2GoogleCloudStorage.UserInfo = null;
this.oauth2GoogleCloudStorage.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2GoogleCloudStorage_OpenButtonClicked);
this.oauth2GoogleCloudStorage.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2GoogleCloudStorage_CompleteButtonClicked);
this.oauth2GoogleCloudStorage.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2GoogleCloudStorage_ClearButtonClicked);
this.oauth2GoogleCloudStorage.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oauth2GoogleCloudStorage_RefreshButtonClicked);
//
// tpAzureStorage // tpAzureStorage
// //
this.tpAzureStorage.BackColor = System.Drawing.SystemColors.Window; this.tpAzureStorage.BackColor = System.Drawing.SystemColors.Window;
@ -2542,23 +2472,6 @@ private void InitializeComponent()
this.cbGfycatIsPublic.UseVisualStyleBackColor = true; this.cbGfycatIsPublic.UseVisualStyleBackColor = true;
this.cbGfycatIsPublic.CheckedChanged += new System.EventHandler(this.cbGfycatIsPublic_CheckedChanged); this.cbGfycatIsPublic.CheckedChanged += new System.EventHandler(this.cbGfycatIsPublic_CheckedChanged);
// //
// atcGfycatAccountType
//
resources.ApplyResources(this.atcGfycatAccountType, "atcGfycatAccountType");
this.atcGfycatAccountType.Name = "atcGfycatAccountType";
this.atcGfycatAccountType.SelectedAccountType = ShareX.UploadersLib.AccountType.Anonymous;
this.atcGfycatAccountType.AccountTypeChanged += new ShareX.UploadersLib.AccountTypeControl.AccountTypeChangedEventHandler(this.atcGfycatAccountType_AccountTypeChanged);
//
// oauth2Gfycat
//
resources.ApplyResources(this.oauth2Gfycat, "oauth2Gfycat");
this.oauth2Gfycat.Name = "oauth2Gfycat";
this.oauth2Gfycat.UserInfo = null;
this.oauth2Gfycat.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2Gfycat_OpenButtonClicked);
this.oauth2Gfycat.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2Gfycat_CompleteButtonClicked);
this.oauth2Gfycat.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2Gfycat_ClearButtonClicked);
this.oauth2Gfycat.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oauth2Gfycat_RefreshButtonClicked);
//
// tpMega // tpMega
// //
this.tpMega.BackColor = System.Drawing.SystemColors.Window; this.tpMega.BackColor = System.Drawing.SystemColors.Window;
@ -2925,13 +2838,6 @@ private void InitializeComponent()
this.txtSendSpaceUserName.Name = "txtSendSpaceUserName"; this.txtSendSpaceUserName.Name = "txtSendSpaceUserName";
this.txtSendSpaceUserName.TextChanged += new System.EventHandler(this.txtSendSpaceUserName_TextChanged); this.txtSendSpaceUserName.TextChanged += new System.EventHandler(this.txtSendSpaceUserName_TextChanged);
// //
// atcSendSpaceAccountType
//
resources.ApplyResources(this.atcSendSpaceAccountType, "atcSendSpaceAccountType");
this.atcSendSpaceAccountType.Name = "atcSendSpaceAccountType";
this.atcSendSpaceAccountType.SelectedAccountType = ShareX.UploadersLib.AccountType.Anonymous;
this.atcSendSpaceAccountType.AccountTypeChanged += new ShareX.UploadersLib.AccountTypeControl.AccountTypeChangedEventHandler(this.atcSendSpaceAccountType_AccountTypeChanged);
//
// tpHostr // tpHostr
// //
this.tpHostr.BackColor = System.Drawing.SystemColors.Window; this.tpHostr.BackColor = System.Drawing.SystemColors.Window;
@ -3021,16 +2927,6 @@ private void InitializeComponent()
resources.ApplyResources(this.lblJiraHost, "lblJiraHost"); resources.ApplyResources(this.lblJiraHost, "lblJiraHost");
this.lblJiraHost.Name = "lblJiraHost"; this.lblJiraHost.Name = "lblJiraHost";
// //
// oAuthJira
//
resources.ApplyResources(this.oAuthJira, "oAuthJira");
this.oAuthJira.Name = "oAuthJira";
this.oAuthJira.UserInfo = null;
this.oAuthJira.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oAuthJira_OpenButtonClicked);
this.oAuthJira.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oAuthJira_CompleteButtonClicked);
this.oAuthJira.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oAuthJira_ClearButtonClicked);
this.oAuthJira.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oAuthJira_RefreshButtonClicked);
//
// tpLambda // tpLambda
// //
this.tpLambda.BackColor = System.Drawing.SystemColors.Window; this.tpLambda.BackColor = System.Drawing.SystemColors.Window;
@ -3175,16 +3071,6 @@ private void InitializeComponent()
this.tbTeknikUploadAPIUrl.Name = "tbTeknikUploadAPIUrl"; this.tbTeknikUploadAPIUrl.Name = "tbTeknikUploadAPIUrl";
this.tbTeknikUploadAPIUrl.TextChanged += new System.EventHandler(this.tbTeknikUploadAPIUrl_TextChanged); this.tbTeknikUploadAPIUrl.TextChanged += new System.EventHandler(this.tbTeknikUploadAPIUrl_TextChanged);
// //
// oauthTeknik
//
resources.ApplyResources(this.oauthTeknik, "oauthTeknik");
this.oauthTeknik.Name = "oauthTeknik";
this.oauthTeknik.UserInfo = null;
this.oauthTeknik.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauthTeknik_OpenButtonClicked);
this.oauthTeknik.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauthTeknik_CompleteButtonClicked);
this.oauthTeknik.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauthTeknik_ClearButtonClicked);
this.oauthTeknik.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oauthTeknik_RefreshButtonClicked);
//
// tpPomf // tpPomf
// //
this.tpPomf.BackColor = System.Drawing.SystemColors.Window; this.tpPomf.BackColor = System.Drawing.SystemColors.Window;
@ -3813,14 +3699,6 @@ private void InitializeComponent()
this.tpYouTube.Name = "tpYouTube"; this.tpYouTube.Name = "tpYouTube";
this.tpYouTube.UseVisualStyleBackColor = true; this.tpYouTube.UseVisualStyleBackColor = true;
// //
// oauth2YouTube
//
resources.ApplyResources(this.oauth2YouTube, "oauth2YouTube");
this.oauth2YouTube.Name = "oauth2YouTube";
this.oauth2YouTube.UserInfo = null;
this.oauth2YouTube.ConnectButtonClicked += new System.Action(this.oauth2YouTube_ConnectButtonClicked);
this.oauth2YouTube.DisconnectButtonClicked += new System.Action(this.oauth2YouTube_DisconnectButtonClicked);
//
// llYouTubePermissionsLink // llYouTubePermissionsLink
// //
resources.ApplyResources(this.llYouTubePermissionsLink, "llYouTubePermissionsLink"); resources.ApplyResources(this.llYouTubePermissionsLink, "llYouTubePermissionsLink");
@ -4292,16 +4170,6 @@ private void InitializeComponent()
this.cbGistPublishPublic.UseVisualStyleBackColor = true; this.cbGistPublishPublic.UseVisualStyleBackColor = true;
this.cbGistPublishPublic.CheckedChanged += new System.EventHandler(this.cbGistPublishPublic_CheckedChanged); this.cbGistPublishPublic.CheckedChanged += new System.EventHandler(this.cbGistPublishPublic_CheckedChanged);
// //
// oAuth2Gist
//
this.oAuth2Gist.IsRefreshable = false;
resources.ApplyResources(this.oAuth2Gist, "oAuth2Gist");
this.oAuth2Gist.Name = "oAuth2Gist";
this.oAuth2Gist.UserInfo = null;
this.oAuth2Gist.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oAuth2Gist_OpenButtonClicked);
this.oAuth2Gist.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oAuth2Gist_CompleteButtonClicked);
this.oAuth2Gist.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oAuth2Gist_ClearButtonClicked);
//
// tpUpaste // tpUpaste
// //
this.tpUpaste.BackColor = System.Drawing.SystemColors.Window; this.tpUpaste.BackColor = System.Drawing.SystemColors.Window;
@ -4473,23 +4341,6 @@ private void InitializeComponent()
this.cbImgurDirectLink.UseVisualStyleBackColor = true; this.cbImgurDirectLink.UseVisualStyleBackColor = true;
this.cbImgurDirectLink.CheckedChanged += new System.EventHandler(this.cbImgurDirectLink_CheckedChanged); this.cbImgurDirectLink.CheckedChanged += new System.EventHandler(this.cbImgurDirectLink_CheckedChanged);
// //
// atcImgurAccountType
//
resources.ApplyResources(this.atcImgurAccountType, "atcImgurAccountType");
this.atcImgurAccountType.Name = "atcImgurAccountType";
this.atcImgurAccountType.SelectedAccountType = ShareX.UploadersLib.AccountType.Anonymous;
this.atcImgurAccountType.AccountTypeChanged += new ShareX.UploadersLib.AccountTypeControl.AccountTypeChangedEventHandler(this.atcImgurAccountType_AccountTypeChanged);
//
// oauth2Imgur
//
resources.ApplyResources(this.oauth2Imgur, "oauth2Imgur");
this.oauth2Imgur.Name = "oauth2Imgur";
this.oauth2Imgur.UserInfo = null;
this.oauth2Imgur.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2Imgur_OpenButtonClicked);
this.oauth2Imgur.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2Imgur_CompleteButtonClicked);
this.oauth2Imgur.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2Imgur_ClearButtonClicked);
this.oauth2Imgur.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oauth2Imgur_RefreshButtonClicked);
//
// lvImgurAlbumList // lvImgurAlbumList
// //
this.lvImgurAlbumList.AllowColumnSort = true; this.lvImgurAlbumList.AllowColumnSort = true;
@ -4619,16 +4470,6 @@ private void InitializeComponent()
this.cbFlickrDirectLink.UseVisualStyleBackColor = true; this.cbFlickrDirectLink.UseVisualStyleBackColor = true;
this.cbFlickrDirectLink.CheckedChanged += new System.EventHandler(this.cbFlickrDirectLink_CheckedChanged); this.cbFlickrDirectLink.CheckedChanged += new System.EventHandler(this.cbFlickrDirectLink_CheckedChanged);
// //
// oauthFlickr
//
this.oauthFlickr.IsRefreshable = false;
resources.ApplyResources(this.oauthFlickr, "oauthFlickr");
this.oauthFlickr.Name = "oauthFlickr";
this.oauthFlickr.UserInfo = null;
this.oauthFlickr.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauthFlickr_OpenButtonClicked);
this.oauthFlickr.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauthFlickr_CompleteButtonClicked);
this.oauthFlickr.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauthFlickr_ClearButtonClicked);
//
// tpPhotobucket // tpPhotobucket
// //
this.tpPhotobucket.BackColor = System.Drawing.SystemColors.Window; this.tpPhotobucket.BackColor = System.Drawing.SystemColors.Window;
@ -4762,6 +4603,7 @@ private void InitializeComponent()
// tpGooglePhotos // tpGooglePhotos
// //
this.tpGooglePhotos.BackColor = System.Drawing.SystemColors.Window; this.tpGooglePhotos.BackColor = System.Drawing.SystemColors.Window;
this.tpGooglePhotos.Controls.Add(this.oauth2GooglePhotos);
this.tpGooglePhotos.Controls.Add(this.lblGooglePhotosCreateAlbumName); this.tpGooglePhotos.Controls.Add(this.lblGooglePhotosCreateAlbumName);
this.tpGooglePhotos.Controls.Add(this.txtGooglePhotosCreateAlbumName); this.tpGooglePhotos.Controls.Add(this.txtGooglePhotosCreateAlbumName);
this.tpGooglePhotos.Controls.Add(this.btnGooglePhotosCreateAlbum); this.tpGooglePhotos.Controls.Add(this.btnGooglePhotosCreateAlbum);
@ -4770,7 +4612,6 @@ private void InitializeComponent()
this.tpGooglePhotos.Controls.Add(this.lblPicasaAlbumID); this.tpGooglePhotos.Controls.Add(this.lblPicasaAlbumID);
this.tpGooglePhotos.Controls.Add(this.lvPicasaAlbumList); this.tpGooglePhotos.Controls.Add(this.lvPicasaAlbumList);
this.tpGooglePhotos.Controls.Add(this.btnPicasaRefreshAlbumList); this.tpGooglePhotos.Controls.Add(this.btnPicasaRefreshAlbumList);
this.tpGooglePhotos.Controls.Add(this.oauth2Picasa);
resources.ApplyResources(this.tpGooglePhotos, "tpGooglePhotos"); resources.ApplyResources(this.tpGooglePhotos, "tpGooglePhotos");
this.tpGooglePhotos.Name = "tpGooglePhotos"; this.tpGooglePhotos.Name = "tpGooglePhotos";
// //
@ -4843,16 +4684,6 @@ private void InitializeComponent()
this.btnPicasaRefreshAlbumList.UseVisualStyleBackColor = true; this.btnPicasaRefreshAlbumList.UseVisualStyleBackColor = true;
this.btnPicasaRefreshAlbumList.Click += new System.EventHandler(this.btnPicasaRefreshAlbumList_Click); this.btnPicasaRefreshAlbumList.Click += new System.EventHandler(this.btnPicasaRefreshAlbumList_Click);
// //
// oauth2Picasa
//
resources.ApplyResources(this.oauth2Picasa, "oauth2Picasa");
this.oauth2Picasa.Name = "oauth2Picasa";
this.oauth2Picasa.UserInfo = null;
this.oauth2Picasa.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2Picasa_OpenButtonClicked);
this.oauth2Picasa.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2Picasa_CompleteButtonClicked);
this.oauth2Picasa.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2Picasa_ClearButtonClicked);
this.oauth2Picasa.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oauth2Picasa_RefreshButtonClicked);
//
// tpChevereto // tpChevereto
// //
this.tpChevereto.BackColor = System.Drawing.SystemColors.Window; this.tpChevereto.BackColor = System.Drawing.SystemColors.Window;
@ -4951,6 +4782,173 @@ private void InitializeComponent()
this.tttvMain.TreeViewFont = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(162))); this.tttvMain.TreeViewFont = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(162)));
this.tttvMain.TreeViewSize = 230; this.tttvMain.TreeViewSize = 230;
// //
// atcImgurAccountType
//
resources.ApplyResources(this.atcImgurAccountType, "atcImgurAccountType");
this.atcImgurAccountType.Name = "atcImgurAccountType";
this.atcImgurAccountType.SelectedAccountType = ShareX.UploadersLib.AccountType.Anonymous;
this.atcImgurAccountType.AccountTypeChanged += new ShareX.UploadersLib.AccountTypeControl.AccountTypeChangedEventHandler(this.atcImgurAccountType_AccountTypeChanged);
//
// oauth2Imgur
//
resources.ApplyResources(this.oauth2Imgur, "oauth2Imgur");
this.oauth2Imgur.Name = "oauth2Imgur";
this.oauth2Imgur.UserInfo = null;
this.oauth2Imgur.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2Imgur_OpenButtonClicked);
this.oauth2Imgur.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2Imgur_CompleteButtonClicked);
this.oauth2Imgur.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2Imgur_ClearButtonClicked);
this.oauth2Imgur.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oauth2Imgur_RefreshButtonClicked);
//
// oauthFlickr
//
this.oauthFlickr.IsRefreshable = false;
resources.ApplyResources(this.oauthFlickr, "oauthFlickr");
this.oauthFlickr.Name = "oauthFlickr";
this.oauthFlickr.UserInfo = null;
this.oauthFlickr.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauthFlickr_OpenButtonClicked);
this.oauthFlickr.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauthFlickr_CompleteButtonClicked);
this.oauthFlickr.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauthFlickr_ClearButtonClicked);
//
// oauth2GooglePhotos
//
resources.ApplyResources(this.oauth2GooglePhotos, "oauth2GooglePhotos");
this.oauth2GooglePhotos.Name = "oauth2GooglePhotos";
this.oauth2GooglePhotos.UserInfo = null;
this.oauth2GooglePhotos.ConnectButtonClicked += new System.Action(this.oauth2GooglePhotos_ConnectButtonClicked);
this.oauth2GooglePhotos.DisconnectButtonClicked += new System.Action(this.oauth2GooglePhotos_DisconnectButtonClicked);
//
// oAuth2Gist
//
this.oAuth2Gist.IsRefreshable = false;
resources.ApplyResources(this.oAuth2Gist, "oAuth2Gist");
this.oAuth2Gist.Name = "oAuth2Gist";
this.oAuth2Gist.UserInfo = null;
this.oAuth2Gist.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oAuth2Gist_OpenButtonClicked);
this.oAuth2Gist.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oAuth2Gist_CompleteButtonClicked);
this.oAuth2Gist.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oAuth2Gist_ClearButtonClicked);
//
// oauth2Dropbox
//
this.oauth2Dropbox.IsRefreshable = false;
resources.ApplyResources(this.oauth2Dropbox, "oauth2Dropbox");
this.oauth2Dropbox.Name = "oauth2Dropbox";
this.oauth2Dropbox.UserInfo = null;
this.oauth2Dropbox.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2Dropbox_OpenButtonClicked);
this.oauth2Dropbox.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2Dropbox_CompleteButtonClicked);
this.oauth2Dropbox.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2Dropbox_ClearButtonClicked);
//
// oAuth2OneDrive
//
resources.ApplyResources(this.oAuth2OneDrive, "oAuth2OneDrive");
this.oAuth2OneDrive.Name = "oAuth2OneDrive";
this.oAuth2OneDrive.UserInfo = null;
this.oAuth2OneDrive.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oAuth2OneDrive_OpenButtonClicked);
this.oAuth2OneDrive.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oAuth2OneDrive_CompleteButtonClicked);
this.oAuth2OneDrive.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oAuth2OneDrive_ClearButtonClicked);
this.oAuth2OneDrive.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oAuth2OneDrive_RefreshButtonClicked);
//
// oauth2GoogleDrive
//
resources.ApplyResources(this.oauth2GoogleDrive, "oauth2GoogleDrive");
this.oauth2GoogleDrive.Name = "oauth2GoogleDrive";
this.oauth2GoogleDrive.UserInfo = null;
this.oauth2GoogleDrive.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2GoogleDrive_OpenButtonClicked);
this.oauth2GoogleDrive.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2GoogleDrive_CompleteButtonClicked);
this.oauth2GoogleDrive.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2GoogleDrive_ClearButtonClicked);
this.oauth2GoogleDrive.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oauth2GoogleDrive_RefreshButtonClicked);
//
// oauth2Box
//
resources.ApplyResources(this.oauth2Box, "oauth2Box");
this.oauth2Box.Name = "oauth2Box";
this.oauth2Box.UserInfo = null;
this.oauth2Box.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2Box_OpenButtonClicked);
this.oauth2Box.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2Box_CompleteButtonClicked);
this.oauth2Box.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2Box_ClearButtonClicked);
this.oauth2Box.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oauth2Box_RefreshButtonClicked);
//
// oauth2GoogleCloudStorage
//
resources.ApplyResources(this.oauth2GoogleCloudStorage, "oauth2GoogleCloudStorage");
this.oauth2GoogleCloudStorage.Name = "oauth2GoogleCloudStorage";
this.oauth2GoogleCloudStorage.UserInfo = null;
this.oauth2GoogleCloudStorage.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2GoogleCloudStorage_OpenButtonClicked);
this.oauth2GoogleCloudStorage.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2GoogleCloudStorage_CompleteButtonClicked);
this.oauth2GoogleCloudStorage.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2GoogleCloudStorage_ClearButtonClicked);
this.oauth2GoogleCloudStorage.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oauth2GoogleCloudStorage_RefreshButtonClicked);
//
// oauthTwitter
//
resources.ApplyResources(this.oauthTwitter, "oauthTwitter");
this.oauthTwitter.IsRefreshable = false;
this.oauthTwitter.Name = "oauthTwitter";
this.oauthTwitter.UserInfo = null;
this.oauthTwitter.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauthTwitter_OpenButtonClicked);
this.oauthTwitter.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauthTwitter_CompleteButtonClicked);
this.oauthTwitter.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauthTwitter_ClearButtonClicked);
//
// oauth2Bitly
//
this.oauth2Bitly.IsRefreshable = false;
resources.ApplyResources(this.oauth2Bitly, "oauth2Bitly");
this.oauth2Bitly.Name = "oauth2Bitly";
this.oauth2Bitly.UserInfo = null;
this.oauth2Bitly.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2Bitly_OpenButtonClicked);
this.oauth2Bitly.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2Bitly_CompleteButtonClicked);
this.oauth2Bitly.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2Bitly_ClearButtonClicked);
//
// atcGfycatAccountType
//
resources.ApplyResources(this.atcGfycatAccountType, "atcGfycatAccountType");
this.atcGfycatAccountType.Name = "atcGfycatAccountType";
this.atcGfycatAccountType.SelectedAccountType = ShareX.UploadersLib.AccountType.Anonymous;
this.atcGfycatAccountType.AccountTypeChanged += new ShareX.UploadersLib.AccountTypeControl.AccountTypeChangedEventHandler(this.atcGfycatAccountType_AccountTypeChanged);
//
// oauth2Gfycat
//
resources.ApplyResources(this.oauth2Gfycat, "oauth2Gfycat");
this.oauth2Gfycat.Name = "oauth2Gfycat";
this.oauth2Gfycat.UserInfo = null;
this.oauth2Gfycat.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2Gfycat_OpenButtonClicked);
this.oauth2Gfycat.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2Gfycat_CompleteButtonClicked);
this.oauth2Gfycat.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2Gfycat_ClearButtonClicked);
this.oauth2Gfycat.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oauth2Gfycat_RefreshButtonClicked);
//
// atcSendSpaceAccountType
//
resources.ApplyResources(this.atcSendSpaceAccountType, "atcSendSpaceAccountType");
this.atcSendSpaceAccountType.Name = "atcSendSpaceAccountType";
this.atcSendSpaceAccountType.SelectedAccountType = ShareX.UploadersLib.AccountType.Anonymous;
this.atcSendSpaceAccountType.AccountTypeChanged += new ShareX.UploadersLib.AccountTypeControl.AccountTypeChangedEventHandler(this.atcSendSpaceAccountType_AccountTypeChanged);
//
// oAuthJira
//
resources.ApplyResources(this.oAuthJira, "oAuthJira");
this.oAuthJira.Name = "oAuthJira";
this.oAuthJira.UserInfo = null;
this.oAuthJira.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oAuthJira_OpenButtonClicked);
this.oAuthJira.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oAuthJira_CompleteButtonClicked);
this.oAuthJira.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oAuthJira_ClearButtonClicked);
this.oAuthJira.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oAuthJira_RefreshButtonClicked);
//
// oauthTeknik
//
resources.ApplyResources(this.oauthTeknik, "oauthTeknik");
this.oauthTeknik.Name = "oauthTeknik";
this.oauthTeknik.UserInfo = null;
this.oauthTeknik.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauthTeknik_OpenButtonClicked);
this.oauthTeknik.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauthTeknik_CompleteButtonClicked);
this.oauthTeknik.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauthTeknik_ClearButtonClicked);
this.oauthTeknik.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oauthTeknik_RefreshButtonClicked);
//
// oauth2YouTube
//
resources.ApplyResources(this.oauth2YouTube, "oauth2YouTube");
this.oauth2YouTube.Name = "oauth2YouTube";
this.oauth2YouTube.UserInfo = null;
this.oauth2YouTube.ConnectButtonClicked += new System.Action(this.oauth2YouTube_ConnectButtonClicked);
this.oauth2YouTube.DisconnectButtonClicked += new System.Action(this.oauth2YouTube_DisconnectButtonClicked);
//
// actRapidShareAccountType // actRapidShareAccountType
// //
resources.ApplyResources(this.actRapidShareAccountType, "actRapidShareAccountType"); resources.ApplyResources(this.actRapidShareAccountType, "actRapidShareAccountType");
@ -5285,7 +5283,6 @@ private void InitializeComponent()
private System.Windows.Forms.ColumnHeader chPicasaName; private System.Windows.Forms.ColumnHeader chPicasaName;
private System.Windows.Forms.ColumnHeader chPicasaDescription; private System.Windows.Forms.ColumnHeader chPicasaDescription;
private System.Windows.Forms.Button btnPicasaRefreshAlbumList; private System.Windows.Forms.Button btnPicasaRefreshAlbumList;
private OAuthControl oauth2Picasa;
private System.Windows.Forms.TabControl tcUploaders; private System.Windows.Forms.TabControl tcUploaders;
private ShareX.HelpersLib.ExportImportControl eiFTP; private ShareX.HelpersLib.ExportImportControl eiFTP;
private OAuthControl oauth2Dropbox; private OAuthControl oauth2Dropbox;
@ -5698,5 +5695,6 @@ private void InitializeComponent()
private System.Windows.Forms.LinkLabel llYouTubePermissionsLink; private System.Windows.Forms.LinkLabel llYouTubePermissionsLink;
private System.Windows.Forms.Label lblYouTubePermissionsTip; private System.Windows.Forms.Label lblYouTubePermissionsTip;
private OAuthLoopbackControl oauth2YouTube; private OAuthLoopbackControl oauth2YouTube;
private OAuthLoopbackControl oauth2GooglePhotos;
} }
} }

View file

@ -228,13 +228,13 @@ private void LoadImageUploaderSettings()
if (OAuth2Info.CheckOAuth(Config.GooglePhotosOAuth2Info)) if (OAuth2Info.CheckOAuth(Config.GooglePhotosOAuth2Info))
{ {
oauth2Picasa.UserInfo = Config.GooglePhotosUserInfo; oauth2GooglePhotos.Connected = true;
oauth2Picasa.Status = OAuthLoginStatus.LoginSuccessful; oauth2GooglePhotos.UserInfo = Config.GooglePhotosUserInfo;
btnPicasaRefreshAlbumList.Enabled = true; btnPicasaRefreshAlbumList.Enabled = true;
} }
txtPicasaAlbumID.Text = Config.GooglePhotosAlbumID;
cbGooglePhotosIsPublic.Checked = Config.GooglePhotosIsPublic; cbGooglePhotosIsPublic.Checked = Config.GooglePhotosIsPublic;
txtPicasaAlbumID.Text = Config.GooglePhotosAlbumID;
#endregion Google Photos #endregion Google Photos
@ -732,8 +732,12 @@ private void LoadFileUploaderSettings()
#region YouTube #region YouTube
oauth2YouTube.Connected = OAuth2Info.CheckOAuth(Config.YouTubeOAuth2Info); if (OAuth2Info.CheckOAuth(Config.YouTubeOAuth2Info))
oauth2YouTube.UserInfo = Config.YouTubeUserInfo; {
oauth2YouTube.Connected = true;
oauth2YouTube.UserInfo = Config.YouTubeUserInfo;
}
cbYouTubePrivacyType.Items.Clear(); cbYouTubePrivacyType.Items.Clear();
cbYouTubePrivacyType.Items.AddRange(Helpers.GetLocalizedEnumDescriptions<YouTubeVideoPrivacy>()); cbYouTubePrivacyType.Items.AddRange(Helpers.GetLocalizedEnumDescriptions<YouTubeVideoPrivacy>());
cbYouTubePrivacyType.SelectedIndex = (int)Config.YouTubePrivacyType; cbYouTubePrivacyType.SelectedIndex = (int)Config.YouTubePrivacyType;
@ -1054,43 +1058,30 @@ private void btnPhotobucketRemoveAlbum_Click(object sender, EventArgs e)
#region Google Photos #region Google Photos
private void oauth2Picasa_OpenButtonClicked() private void oauth2GooglePhotos_ConnectButtonClicked()
{ {
OAuth2Info oauth = new OAuth2Info(APIKeys.GoogleClientID, APIKeys.GoogleClientSecret); OAuth2Info oauth = new OAuth2Info(APIKeys.GoogleClientID, APIKeys.GoogleClientSecret);
Config.GooglePhotosOAuth2Info = OAuth2Open(new GooglePhotos(oauth)); IOAuth2Loopback oauthLoopback = new GooglePhotos(oauth).OAuth2;
Config.GooglePhotosUserInfo = null;
}
private void oauth2Picasa_CompleteButtonClicked(string code) using (OAuthListenerForm form = new OAuthListenerForm(oauthLoopback))
{
GooglePhotos googlePhotos = new GooglePhotos(Config.GooglePhotosOAuth2Info);
bool result = OAuth2Complete(googlePhotos, code, oauth2Picasa);
if (result)
{ {
try form.ShowDialog();
{ Config.GooglePhotosOAuth2Info = form.OAuth2Info;
Config.GooglePhotosUserInfo = googlePhotos.GetUserInfo(); Config.GooglePhotosUserInfo = form.UserInfo;
oauth2Picasa.UserInfo = Config.GooglePhotosUserInfo;
}
catch (Exception e)
{
e.ShowError();
}
} }
btnPicasaRefreshAlbumList.Enabled = result;
oauth2GooglePhotos.Connected = OAuth2Info.CheckOAuth(Config.GooglePhotosOAuth2Info);
oauth2GooglePhotos.UserInfo = Config.GooglePhotosUserInfo;
btnPicasaRefreshAlbumList.Enabled = oauth2GooglePhotos.Connected;
this.ForceActivate();
} }
private void oauth2Picasa_ClearButtonClicked() private void oauth2GooglePhotos_DisconnectButtonClicked()
{ {
Config.GooglePhotosOAuth2Info = null; Config.GooglePhotosOAuth2Info = null;
Config.GooglePhotosUserInfo = null; Config.GooglePhotosUserInfo = null;
} }
private void oauth2Picasa_RefreshButtonClicked()
{
btnPicasaRefreshAlbumList.Enabled = OAuth2Refresh(new GooglePhotos(Config.GooglePhotosOAuth2Info), oauth2Picasa);
}
private void txtPicasaAlbumID_TextChanged(object sender, EventArgs e) private void txtPicasaAlbumID_TextChanged(object sender, EventArgs e)
{ {
Config.GooglePhotosAlbumID = txtPicasaAlbumID.Text; Config.GooglePhotosAlbumID = txtPicasaAlbumID.Text;
@ -3050,7 +3041,7 @@ private void oauth2YouTube_ConnectButtonClicked()
Config.YouTubeUserInfo = form.UserInfo; Config.YouTubeUserInfo = form.UserInfo;
} }
oauth2YouTube.Connected = Config.YouTubeOAuth2Info != null; oauth2YouTube.Connected = OAuth2Info.CheckOAuth(Config.YouTubeOAuth2Info);
oauth2YouTube.UserInfo = Config.YouTubeUserInfo; oauth2YouTube.UserInfo = Config.YouTubeUserInfo;
this.ForceActivate(); this.ForceActivate();
} }

File diff suppressed because it is too large Load diff

View file

@ -58,43 +58,42 @@ public override GenericUploader CreateUploader(UploadersConfig config, TaskRefer
public sealed class GooglePhotos : ImageUploader, IOAuth2 public sealed class GooglePhotos : ImageUploader, IOAuth2
{ {
private GoogleOAuth2 GoogleAuth { get; set; } public GoogleOAuth2 OAuth2 { get; private set; }
public OAuth2Info AuthInfo => OAuth2.AuthInfo;
public string AlbumID { get; set; } public string AlbumID { get; set; }
public bool IsPublic { get; set; } public bool IsPublic { get; set; }
public GooglePhotos(OAuth2Info oauth) public GooglePhotos(OAuth2Info oauth)
{ {
GoogleAuth = new GoogleOAuth2(oauth, this) OAuth2 = new GoogleOAuth2(oauth, this)
{ {
Scope = "https://www.googleapis.com/auth/photoslibrary https://www.googleapis.com/auth/photoslibrary.sharing https://www.googleapis.com/auth/userinfo.profile" Scope = "https://www.googleapis.com/auth/photoslibrary https://www.googleapis.com/auth/photoslibrary.sharing https://www.googleapis.com/auth/userinfo.profile"
}; };
} }
public OAuth2Info AuthInfo => GoogleAuth.AuthInfo;
public bool RefreshAccessToken() public bool RefreshAccessToken()
{ {
return GoogleAuth.RefreshAccessToken(); return OAuth2.RefreshAccessToken();
} }
public bool CheckAuthorization() public bool CheckAuthorization()
{ {
return GoogleAuth.CheckAuthorization(); return OAuth2.CheckAuthorization();
} }
public string GetAuthorizationURL() public string GetAuthorizationURL()
{ {
return GoogleAuth.GetAuthorizationURL(); return OAuth2.GetAuthorizationURL();
} }
public bool GetAccessToken(string code) public bool GetAccessToken(string code)
{ {
return GoogleAuth.GetAccessToken(code); return OAuth2.GetAccessToken(code);
} }
public OAuthUserInfo GetUserInfo() public OAuthUserInfo GetUserInfo()
{ {
return GoogleAuth.GetUserInfo(); return OAuth2.GetUserInfo();
} }
public GooglePhotosAlbum CreateAlbum(string albumName) public GooglePhotosAlbum CreateAlbum(string albumName)
@ -113,7 +112,7 @@ public GooglePhotosAlbum CreateAlbum(string albumName)
}; };
string serializedNewItemAlbum = JsonConvert.SerializeObject(newItemAlbum); string serializedNewItemAlbum = JsonConvert.SerializeObject(newItemAlbum);
string serializedNewItemAlbumResponse = SendRequest(HttpMethod.POST, "https://photoslibrary.googleapis.com/v1/albums", serializedNewItemAlbum, RequestHelpers.ContentTypeJSON, newItemAlbumArgs, GoogleAuth.GetAuthHeaders()); string serializedNewItemAlbumResponse = SendRequest(HttpMethod.POST, "https://photoslibrary.googleapis.com/v1/albums", serializedNewItemAlbum, RequestHelpers.ContentTypeJSON, newItemAlbumArgs, OAuth2.GetAuthHeaders());
GooglePhotosAlbum newItemAlbumResponse = JsonConvert.DeserializeObject<GooglePhotosAlbum>(serializedNewItemAlbumResponse); GooglePhotosAlbum newItemAlbumResponse = JsonConvert.DeserializeObject<GooglePhotosAlbum>(serializedNewItemAlbumResponse);
return newItemAlbumResponse; return newItemAlbumResponse;
@ -136,7 +135,7 @@ public List<GooglePhotosAlbumInfo> GetAlbumList()
do do
{ {
albumListArgs["pageToken"] = pageToken; albumListArgs["pageToken"] = pageToken;
string response = SendRequest(HttpMethod.GET, "https://photoslibrary.googleapis.com/v1/albums", albumListArgs, GoogleAuth.GetAuthHeaders()); string response = SendRequest(HttpMethod.GET, "https://photoslibrary.googleapis.com/v1/albums", albumListArgs, OAuth2.GetAuthHeaders());
pageToken = ""; pageToken = "";
if (!string.IsNullOrEmpty(response)) if (!string.IsNullOrEmpty(response))
@ -185,7 +184,7 @@ public override UploadResult Upload(Stream stream, string fileName)
GooglePhotosAlbumOptions albumOptions = new GooglePhotosAlbumOptions(); GooglePhotosAlbumOptions albumOptions = new GooglePhotosAlbumOptions();
string serializedAlbumOptions = JsonConvert.SerializeObject(albumOptions); string serializedAlbumOptions = JsonConvert.SerializeObject(albumOptions);
string serializedAlbumOptionsResponse = SendRequest(HttpMethod.POST, $"https://photoslibrary.googleapis.com/v1/albums/{AlbumID}:share", serializedAlbumOptions, RequestHelpers.ContentTypeJSON, albumOptionsResponseArgs, GoogleAuth.GetAuthHeaders()); string serializedAlbumOptionsResponse = SendRequest(HttpMethod.POST, $"https://photoslibrary.googleapis.com/v1/albums/{AlbumID}:share", serializedAlbumOptions, RequestHelpers.ContentTypeJSON, albumOptionsResponseArgs, OAuth2.GetAuthHeaders());
GooglePhotosAlbumOptionsResponse albumOptionsResponse = JsonConvert.DeserializeObject<GooglePhotosAlbumOptionsResponse>(serializedAlbumOptionsResponse); GooglePhotosAlbumOptionsResponse albumOptionsResponse = JsonConvert.DeserializeObject<GooglePhotosAlbumOptionsResponse>(serializedAlbumOptionsResponse);
result.URL = albumOptionsResponse.shareInfo.shareableUrl; result.URL = albumOptionsResponse.shareInfo.shareableUrl;
@ -195,7 +194,7 @@ public override UploadResult Upload(Stream stream, string fileName)
{ {
{ "X-Goog-Upload-File-Name", fileName }, { "X-Goog-Upload-File-Name", fileName },
{ "X-Goog-Upload-Protocol", "raw" }, { "X-Goog-Upload-Protocol", "raw" },
{ "Authorization", GoogleAuth.GetAuthHeaders()["Authorization"] } { "Authorization", OAuth2.GetAuthHeaders()["Authorization"] }
}; };
string uploadToken = SendRequest(HttpMethod.POST, "https://photoslibrary.googleapis.com/v1/uploads", stream, RequestHelpers.ContentTypeOctetStream, null, uploadTokenHeaders); string uploadToken = SendRequest(HttpMethod.POST, "https://photoslibrary.googleapis.com/v1/uploads", stream, RequestHelpers.ContentTypeOctetStream, null, uploadTokenHeaders);
@ -222,7 +221,7 @@ public override UploadResult Upload(Stream stream, string fileName)
string serializedNewMediaItemRequest = JsonConvert.SerializeObject(newMediaItemRequest); string serializedNewMediaItemRequest = JsonConvert.SerializeObject(newMediaItemRequest);
result.Response = SendRequest(HttpMethod.POST, "https://photoslibrary.googleapis.com/v1/mediaItems:batchCreate", serializedNewMediaItemRequest, RequestHelpers.ContentTypeJSON, newMediaItemRequestArgs, GoogleAuth.GetAuthHeaders()); result.Response = SendRequest(HttpMethod.POST, "https://photoslibrary.googleapis.com/v1/mediaItems:batchCreate", serializedNewMediaItemRequest, RequestHelpers.ContentTypeJSON, newMediaItemRequestArgs, OAuth2.GetAuthHeaders());
GooglePhotosNewMediaItemResults newMediaItemResult = JsonConvert.DeserializeObject<GooglePhotosNewMediaItemResults>(result.Response); GooglePhotosNewMediaItemResults newMediaItemResult = JsonConvert.DeserializeObject<GooglePhotosNewMediaItemResults>(result.Response);

View file

@ -79,7 +79,6 @@ public async Task<bool> ConnectAsync()
string queryCode = null; string queryCode = null;
string queryState = null; string queryState = null;
bool stateValidation = false;
try try
{ {
@ -90,13 +89,12 @@ public async Task<bool> ConnectAsync()
HttpListenerContext context = await listener.GetContextAsync(); HttpListenerContext context = await listener.GetContextAsync();
queryCode = context.Request.QueryString.Get("code"); queryCode = context.Request.QueryString.Get("code");
queryState = context.Request.QueryString.Get("state"); queryState = context.Request.QueryString.Get("state");
stateValidation = !string.IsNullOrEmpty(queryState) && queryState == state;
using (HttpListenerResponse response = context.Response) using (HttpListenerResponse response = context.Response)
{ {
string status; string status;
if (!stateValidation) if (queryState != state)
{ {
status = "Invalid state parameter."; status = "Invalid state parameter.";
} }
@ -129,7 +127,7 @@ public async Task<bool> ConnectAsync()
Dispose(); Dispose();
} }
if (stateValidation && !string.IsNullOrEmpty(queryCode)) if (queryState == state && !string.IsNullOrEmpty(queryCode))
{ {
return await Task.Run(() => OAuth.GetAccessToken(queryCode)); return await Task.Run(() => OAuth.GetAccessToken(queryCode));
} }