PageRenderTime 41ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/UploadersLib/GUI/UploadersConfigFormHelper.cs

https://github.com/llehouerou/ShareX
C# | 1701 lines | 1461 code | 217 blank | 23 comment | 188 complexity | 15941a96ef3c918b13537c81f0e78548 MD5 | raw file
Possible License(s): GPL-3.0

Large files files are truncated, but you can click here to view the full file

  1. #region License Information (GPL v3)
  2. /*
  3. ShareX - A program that allows you to take screenshots and share any file type
  4. Copyright (C) 2007-2014 ShareX Developers
  5. This program is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License
  7. as published by the Free Software Foundation; either version 2
  8. of the License, or (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  16. Optionally you can also view the license at <http://www.gnu.org/licenses/>.
  17. */
  18. #endregion License Information (GPL v3)
  19. using HelpersLib;
  20. using Newtonsoft.Json;
  21. using System;
  22. using System.Collections.Generic;
  23. using System.IO;
  24. using System.Linq;
  25. using System.Net.FtpClient;
  26. using System.Net.NetworkInformation;
  27. using System.Text;
  28. using System.Threading;
  29. using System.Windows.Forms;
  30. using UploadersLib.FileUploaders;
  31. using UploadersLib.Forms;
  32. using UploadersLib.GUI;
  33. using UploadersLib.HelperClasses;
  34. using UploadersLib.ImageUploaders;
  35. using UploadersLib.SocialServices;
  36. using UploadersLib.TextUploaders;
  37. using UploadersLib.URLShorteners;
  38. namespace UploadersLib
  39. {
  40. public partial class UploadersConfigForm : Form
  41. {
  42. #region Imgur
  43. public void ImgurAuthOpen()
  44. {
  45. try
  46. {
  47. OAuth2Info oauth = new OAuth2Info(APIKeys.ImgurClientID, APIKeys.ImgurClientSecret);
  48. string url = new Imgur_v3(oauth).GetAuthorizationURL();
  49. if (!string.IsNullOrEmpty(url))
  50. {
  51. Config.ImgurOAuth2Info = oauth;
  52. Helpers.OpenURL(url);
  53. DebugHelper.WriteLine("ImgurAuthOpen - Authorization URL is opened: " + url);
  54. }
  55. else
  56. {
  57. DebugHelper.WriteLine("ImgurAuthOpen - Authorization URL is empty.");
  58. }
  59. }
  60. catch (Exception ex)
  61. {
  62. MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  63. }
  64. }
  65. public void ImgurAuthComplete(string code)
  66. {
  67. try
  68. {
  69. if (!string.IsNullOrEmpty(code) && Config.ImgurOAuth2Info != null)
  70. {
  71. bool result = new Imgur_v3(Config.ImgurOAuth2Info).GetAccessToken(code);
  72. if (result)
  73. {
  74. oauth2Imgur.Status = "Login successful.";
  75. MessageBox.Show("Login successful.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
  76. }
  77. else
  78. {
  79. oauth2Imgur.Status = "Login failed.";
  80. MessageBox.Show("Login failed.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
  81. atcImgurAccountType.SelectedAccountType = AccountType.Anonymous;
  82. }
  83. oauth2Imgur.LoginStatus = result;
  84. btnImgurRefreshAlbumList.Enabled = result;
  85. }
  86. }
  87. catch (Exception ex)
  88. {
  89. MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  90. }
  91. }
  92. public void ImgurAuthRefresh()
  93. {
  94. try
  95. {
  96. if (OAuth2Info.CheckOAuth(Config.ImgurOAuth2Info))
  97. {
  98. bool result = new Imgur_v3(Config.ImgurOAuth2Info).RefreshAccessToken();
  99. if (result)
  100. {
  101. oauth2Imgur.Status = "Login successful.";
  102. MessageBox.Show("Login successful.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
  103. }
  104. else
  105. {
  106. oauth2Imgur.Status = "Login failed.";
  107. MessageBox.Show("Login failed.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
  108. atcImgurAccountType.SelectedAccountType = AccountType.Anonymous;
  109. }
  110. btnImgurRefreshAlbumList.Enabled = result;
  111. }
  112. }
  113. catch (Exception ex)
  114. {
  115. MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  116. }
  117. }
  118. public void ImgurRefreshAlbumList()
  119. {
  120. try
  121. {
  122. lvImgurAlbumList.Items.Clear();
  123. if (OAuth2Info.CheckOAuth(Config.ImgurOAuth2Info))
  124. {
  125. List<ImgurAlbumData> albums = new Imgur_v3(Config.ImgurOAuth2Info).GetAlbums();
  126. if (albums != null && albums.Count > 0)
  127. {
  128. foreach (ImgurAlbumData album in albums)
  129. {
  130. ListViewItem lvi = new ListViewItem(album.id);
  131. lvi.SubItems.Add(album.title ?? "");
  132. lvi.SubItems.Add(album.description ?? "");
  133. lvi.Tag = album;
  134. lvImgurAlbumList.Items.Add(lvi);
  135. }
  136. }
  137. }
  138. }
  139. catch (Exception ex)
  140. {
  141. MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  142. }
  143. }
  144. #endregion Imgur
  145. #region Flickr
  146. public void FlickrAuthOpen()
  147. {
  148. try
  149. {
  150. FlickrUploader flickr = new FlickrUploader(APIKeys.FlickrKey, APIKeys.FlickrSecret);
  151. btnFlickrOpenAuthorize.Tag = flickr.GetFrob();
  152. string url = flickr.GetAuthLink(FlickrPermission.Write);
  153. if (!string.IsNullOrEmpty(url))
  154. {
  155. Helpers.OpenURL(url);
  156. btnFlickrCompleteAuth.Enabled = true;
  157. }
  158. }
  159. catch (Exception ex)
  160. {
  161. MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  162. }
  163. }
  164. public void FlickrAuthComplete()
  165. {
  166. try
  167. {
  168. string token = btnFlickrOpenAuthorize.Tag as string;
  169. if (!string.IsNullOrEmpty(token))
  170. {
  171. FlickrUploader flickr = new FlickrUploader(APIKeys.FlickrKey, APIKeys.FlickrSecret);
  172. Config.FlickrAuthInfo = flickr.GetToken(token);
  173. pgFlickrAuthInfo.SelectedObject = Config.FlickrAuthInfo;
  174. // btnFlickrOpenImages.Text = string.Format("{0}'s photostream", Config.FlickrAuthInfo.Username);
  175. MessageBox.Show("Login successful.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
  176. }
  177. }
  178. catch (Exception ex)
  179. {
  180. MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  181. }
  182. }
  183. public void FlickrCheckToken()
  184. {
  185. try
  186. {
  187. if (Config.FlickrAuthInfo != null)
  188. {
  189. string token = Config.FlickrAuthInfo.Token;
  190. if (!string.IsNullOrEmpty(token))
  191. {
  192. FlickrUploader flickr = new FlickrUploader(APIKeys.FlickrKey, APIKeys.FlickrSecret);
  193. Config.FlickrAuthInfo = flickr.CheckToken(token);
  194. pgFlickrAuthInfo.SelectedObject = Config.FlickrAuthInfo;
  195. MessageBox.Show("Login successful.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
  196. }
  197. }
  198. }
  199. catch (Exception ex)
  200. {
  201. MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  202. }
  203. }
  204. public void FlickrOpenImages()
  205. {
  206. if (Config.FlickrAuthInfo != null)
  207. {
  208. string userID = Config.FlickrAuthInfo.UserID;
  209. if (!string.IsNullOrEmpty(userID))
  210. {
  211. FlickrUploader flickr = new FlickrUploader(APIKeys.FlickrKey, APIKeys.FlickrSecret);
  212. string url = flickr.GetPhotosLink(userID);
  213. if (!string.IsNullOrEmpty(url))
  214. {
  215. Helpers.OpenURL(url);
  216. }
  217. }
  218. }
  219. }
  220. #endregion Flickr
  221. #region Photobucket
  222. public void PhotobucketAuthOpen()
  223. {
  224. try
  225. {
  226. OAuthInfo oauth = new OAuthInfo(APIKeys.PhotobucketConsumerKey, APIKeys.PhotobucketConsumerSecret);
  227. string url = new Photobucket(oauth).GetAuthorizationURL();
  228. if (!string.IsNullOrEmpty(url))
  229. {
  230. Config.PhotobucketOAuthInfo = oauth;
  231. Helpers.OpenURL(url);
  232. }
  233. }
  234. catch (Exception ex)
  235. {
  236. MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  237. }
  238. }
  239. public void PhotobucketAuthComplete()
  240. {
  241. try
  242. {
  243. string verification = txtPhotobucketVerificationCode.Text;
  244. if (!string.IsNullOrEmpty(verification) && Config.PhotobucketOAuthInfo != null &&
  245. !string.IsNullOrEmpty(Config.PhotobucketOAuthInfo.AuthToken) && !string.IsNullOrEmpty(Config.PhotobucketOAuthInfo.AuthSecret))
  246. {
  247. Photobucket pb = new Photobucket(Config.PhotobucketOAuthInfo);
  248. bool result = pb.GetAccessToken(verification);
  249. if (result)
  250. {
  251. Config.PhotobucketAccountInfo = pb.GetAccountInfo();
  252. lblPhotobucketAccountStatus.Text = "Login successful.";
  253. txtPhotobucketDefaultAlbumName.Text = Config.PhotobucketAccountInfo.AlbumID;
  254. Config.PhotobucketAccountInfo.AlbumList.Add(Config.PhotobucketAccountInfo.AlbumID);
  255. cboPhotobucketAlbumPaths.Items.Add(Config.PhotobucketAccountInfo.AlbumID);
  256. cboPhotobucketAlbumPaths.SelectedIndex = 0;
  257. MessageBox.Show("Login successful.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
  258. }
  259. else
  260. {
  261. lblPhotobucketAccountStatus.Text = "Login failed.";
  262. MessageBox.Show("Login failed.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
  263. }
  264. }
  265. }
  266. catch (Exception ex)
  267. {
  268. MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  269. }
  270. }
  271. public void PhotobucketCreateAlbum()
  272. {
  273. Photobucket pb = new Photobucket(Config.PhotobucketOAuthInfo, Config.PhotobucketAccountInfo);
  274. if (pb.CreateAlbum(txtPhotobucketParentAlbumPath.Text, txtPhotobucketNewAlbumName.Text))
  275. {
  276. string albumPath = txtPhotobucketParentAlbumPath.Text + "/" + txtPhotobucketNewAlbumName.Text;
  277. Config.PhotobucketAccountInfo.AlbumList.Add(albumPath);
  278. cboPhotobucketAlbumPaths.Items.Add(albumPath);
  279. MessageBox.Show(albumPath + " successfully created.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
  280. }
  281. }
  282. #endregion Photobucket
  283. #region Picasa
  284. public void PicasaAuthOpen()
  285. {
  286. try
  287. {
  288. OAuth2Info oauth = new OAuth2Info(APIKeys.GoogleClientID, APIKeys.GoogleClientSecret);
  289. string url = new Picasa(oauth).GetAuthorizationURL();
  290. if (!string.IsNullOrEmpty(url))
  291. {
  292. Config.PicasaOAuth2Info = oauth;
  293. Helpers.OpenURL(url);
  294. DebugHelper.WriteLine("PicasaAuthOpen - Authorization URL is opened: " + url);
  295. }
  296. else
  297. {
  298. DebugHelper.WriteLine("PicasaAuthOpen - Authorization URL is empty.");
  299. }
  300. }
  301. catch (Exception ex)
  302. {
  303. MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  304. }
  305. }
  306. public void PicasaAuthComplete(string code)
  307. {
  308. try
  309. {
  310. if (!string.IsNullOrEmpty(code) && Config.PicasaOAuth2Info != null)
  311. {
  312. bool result = new GoogleDrive(Config.PicasaOAuth2Info).GetAccessToken(code);
  313. if (result)
  314. {
  315. oauth2Picasa.Status = "Login successful.";
  316. MessageBox.Show("Login successful.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
  317. }
  318. else
  319. {
  320. oauth2Picasa.Status = "Login failed.";
  321. MessageBox.Show("Login failed.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
  322. }
  323. oauth2Picasa.LoginStatus = result;
  324. btnPicasaRefreshAlbumList.Enabled = result;
  325. }
  326. }
  327. catch (Exception ex)
  328. {
  329. MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  330. }
  331. }
  332. public void PicasaAuthRefresh()
  333. {
  334. try
  335. {
  336. if (OAuth2Info.CheckOAuth(Config.PicasaOAuth2Info))
  337. {
  338. bool result = new GoogleDrive(Config.PicasaOAuth2Info).RefreshAccessToken();
  339. if (result)
  340. {
  341. oauth2Picasa.Status = "Login successful.";
  342. MessageBox.Show("Login successful.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
  343. }
  344. else
  345. {
  346. oauth2Picasa.Status = "Login failed.";
  347. MessageBox.Show("Login failed.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
  348. }
  349. btnPicasaRefreshAlbumList.Enabled = result;
  350. }
  351. }
  352. catch (Exception ex)
  353. {
  354. MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  355. }
  356. }
  357. public void PicasaRefreshAlbumList()
  358. {
  359. try
  360. {
  361. lvPicasaAlbumList.Items.Clear();
  362. if (OAuth2Info.CheckOAuth(Config.PicasaOAuth2Info))
  363. {
  364. List<PicasaAlbumInfo> albums = new Picasa(Config.PicasaOAuth2Info).GetAlbumList();
  365. if (albums != null && albums.Count > 0)
  366. {
  367. foreach (PicasaAlbumInfo album in albums)
  368. {
  369. ListViewItem lvi = new ListViewItem(album.ID);
  370. lvi.SubItems.Add(album.Name ?? "");
  371. lvi.SubItems.Add(album.Summary ?? "");
  372. lvi.Tag = album;
  373. lvPicasaAlbumList.Items.Add(lvi);
  374. }
  375. }
  376. }
  377. }
  378. catch (Exception ex)
  379. {
  380. MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  381. }
  382. }
  383. #endregion Picasa
  384. #region Dropbox
  385. public void DropboxOpenFiles()
  386. {
  387. if (OAuth2Info.CheckOAuth(Config.DropboxOAuth2Info))
  388. {
  389. using (DropboxFilesForm filesForm = new DropboxFilesForm(Config.DropboxOAuth2Info, GetDropboxUploadPath(), Config.DropboxAccountInfo))
  390. {
  391. if (filesForm.ShowDialog() == DialogResult.OK)
  392. {
  393. txtDropboxPath.Text = filesForm.CurrentFolderPath;
  394. }
  395. }
  396. }
  397. }
  398. public void DropboxAuthOpen()
  399. {
  400. try
  401. {
  402. OAuth2Info oauth = new OAuth2Info(APIKeys.DropboxConsumerKey, APIKeys.DropboxConsumerSecret);
  403. string url = new Dropbox(oauth).GetAuthorizationURL();
  404. if (!string.IsNullOrEmpty(url))
  405. {
  406. Config.DropboxOAuth2Info = oauth;
  407. Helpers.OpenURL(url);
  408. DebugHelper.WriteLine("DropboxAuthOpen - Authorization URL is opened: " + url);
  409. }
  410. else
  411. {
  412. DebugHelper.WriteLine("DropboxAuthOpen - Authorization URL is empty.");
  413. }
  414. }
  415. catch (Exception ex)
  416. {
  417. MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  418. }
  419. }
  420. public void DropboxAuthComplete(string code)
  421. {
  422. try
  423. {
  424. if (!string.IsNullOrEmpty(code) && Config.DropboxOAuth2Info != null)
  425. {
  426. Dropbox dropbox = new Dropbox(Config.DropboxOAuth2Info);
  427. bool result = dropbox.GetAccessToken(code);
  428. if (result)
  429. {
  430. oauth2Dropbox.Status = "Login successful.";
  431. Config.DropboxAccountInfo = dropbox.GetAccountInfo();
  432. UpdateDropboxStatus();
  433. if (Config.DropboxAccountInfo != null)
  434. {
  435. MessageBox.Show("Login successful.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
  436. }
  437. else
  438. {
  439. MessageBox.Show("Login successful but GetAccountInfo failed.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
  440. }
  441. return;
  442. }
  443. else
  444. {
  445. oauth2Dropbox.Status = "Login failed.";
  446. MessageBox.Show("Login failed.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
  447. }
  448. }
  449. Config.DropboxAccountInfo = null;
  450. UpdateDropboxStatus();
  451. }
  452. catch (Exception ex)
  453. {
  454. DebugHelper.WriteException(ex);
  455. MessageBox.Show(ex.ToString(), Application.ProductName + " - Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  456. }
  457. }
  458. private void UpdateDropboxStatus()
  459. {
  460. if (OAuth2Info.CheckOAuth(Config.DropboxOAuth2Info) && Config.DropboxAccountInfo != null)
  461. {
  462. StringBuilder sb = new StringBuilder();
  463. sb.AppendLine("Email: " + Config.DropboxAccountInfo.Email);
  464. sb.AppendLine("Name: " + Config.DropboxAccountInfo.Display_name);
  465. sb.AppendLine("User ID: " + Config.DropboxAccountInfo.Uid.ToString());
  466. string uploadPath = GetDropboxUploadPath();
  467. sb.AppendLine("Upload path: " + uploadPath);
  468. sb.AppendLine("Download path: " + Dropbox.GetPublicURL(Config.DropboxAccountInfo.Uid, uploadPath + "Example.png"));
  469. lblDropboxStatus.Text = sb.ToString();
  470. btnDropboxShowFiles.Enabled = true;
  471. }
  472. else
  473. {
  474. lblDropboxStatus.Text = string.Empty;
  475. }
  476. }
  477. private string GetDropboxUploadPath()
  478. {
  479. return NameParser.Parse(NameParserType.URL, Dropbox.TidyUploadPath(Config.DropboxUploadPath));
  480. }
  481. #endregion Dropbox
  482. #region Copy
  483. public void CopyAuthOpen()
  484. {
  485. try
  486. {
  487. OAuthInfo oauth = new OAuthInfo(APIKeys.CopyConsumerKey, APIKeys.CopyConsumerSecret);
  488. string url = new Copy(oauth).GetAuthorizationURL();
  489. if (!string.IsNullOrEmpty(url))
  490. {
  491. Config.CopyOAuthInfo = oauth;
  492. Helpers.OpenURL(url);
  493. DebugHelper.WriteLine("CopyAuthOpen - Authorization URL is opened: " + url);
  494. }
  495. else
  496. {
  497. DebugHelper.WriteLine("CopyAuthOpen - Authorization URL is empty.");
  498. }
  499. }
  500. catch (Exception ex)
  501. {
  502. MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  503. }
  504. }
  505. public void CopyAuthComplete(string code)
  506. {
  507. try
  508. {
  509. if (Config.CopyOAuthInfo != null && !string.IsNullOrEmpty(Config.CopyOAuthInfo.AuthToken) && !string.IsNullOrEmpty(Config.CopyOAuthInfo.AuthSecret) && !string.IsNullOrEmpty(code))
  510. {
  511. Copy copy = new Copy(Config.CopyOAuthInfo);
  512. bool result = copy.GetAccessToken(code);
  513. if (result)
  514. {
  515. oAuthCopy.Status = "Login successful.";
  516. Config.CopyAccountInfo = copy.GetAccountInfo();
  517. UpdateCopyStatus();
  518. if (Config.CopyAccountInfo != null)
  519. {
  520. MessageBox.Show("Login successful.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
  521. }
  522. else
  523. {
  524. MessageBox.Show("Login successful but GetAccountInfo failed.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
  525. }
  526. return;
  527. }
  528. else
  529. {
  530. oAuthCopy.Status = "Login failed.";
  531. MessageBox.Show("Login failed.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
  532. }
  533. }
  534. Config.CopyOAuthInfo = null;
  535. UpdateCopyStatus();
  536. }
  537. catch (Exception ex)
  538. {
  539. DebugHelper.WriteException(ex);
  540. MessageBox.Show(ex.ToString(), Application.ProductName + " - Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  541. }
  542. }
  543. private void UpdateCopyStatus()
  544. {
  545. if (OAuthInfo.CheckOAuth(Config.CopyOAuthInfo) && Config.CopyAccountInfo != null)
  546. {
  547. StringBuilder sb = new StringBuilder();
  548. sb.AppendLine("Email: " + Config.CopyAccountInfo.email);
  549. sb.AppendLine("Name: " + Config.CopyAccountInfo.first_name + " " + Config.CopyAccountInfo.last_name);
  550. sb.AppendLine("User ID: " + Config.CopyAccountInfo.id.ToString());
  551. sb.AppendLine("Upload path: " + GetCopyUploadPath());
  552. lblCopyStatus.Text = sb.ToString();
  553. }
  554. else
  555. {
  556. lblCopyStatus.Text = string.Empty;
  557. }
  558. }
  559. private string GetCopyUploadPath()
  560. {
  561. return NameParser.Parse(NameParserType.URL, Copy.TidyUploadPath(Config.CopyUploadPath));
  562. }
  563. #endregion Copy
  564. #region Amazon S3
  565. private void UpdateAmazonS3Status()
  566. {
  567. lblAmazonS3PathPreview.Text = new AmazonS3(Config.AmazonS3Settings).GetURL("Example.png");
  568. }
  569. #endregion Amazon S3
  570. #region Google Drive
  571. public void GoogleDriveAuthOpen()
  572. {
  573. try
  574. {
  575. OAuth2Info oauth = new OAuth2Info(APIKeys.GoogleClientID, APIKeys.GoogleClientSecret);
  576. string url = new GoogleDrive(oauth).GetAuthorizationURL();
  577. if (!string.IsNullOrEmpty(url))
  578. {
  579. Config.GoogleDriveOAuth2Info = oauth;
  580. Helpers.OpenURL(url);
  581. DebugHelper.WriteLine("GoogleDriveAuthOpen - Authorization URL is opened: " + url);
  582. }
  583. else
  584. {
  585. DebugHelper.WriteLine("GoogleDriveAuthOpen - Authorization URL is empty.");
  586. }
  587. }
  588. catch (Exception ex)
  589. {
  590. MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  591. }
  592. }
  593. public void GoogleDriveAuthComplete(string code)
  594. {
  595. try
  596. {
  597. if (!string.IsNullOrEmpty(code) && Config.GoogleDriveOAuth2Info != null)
  598. {
  599. bool result = new GoogleDrive(Config.GoogleDriveOAuth2Info).GetAccessToken(code);
  600. if (result)
  601. {
  602. oauth2GoogleDrive.Status = "Login successful.";
  603. MessageBox.Show("Login successful.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
  604. }
  605. else
  606. {
  607. oauth2GoogleDrive.Status = "Login failed.";
  608. MessageBox.Show("Login failed.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
  609. }
  610. oauth2GoogleDrive.LoginStatus = result;
  611. }
  612. }
  613. catch (Exception ex)
  614. {
  615. MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  616. }
  617. }
  618. public void GoogleDriveAuthRefresh()
  619. {
  620. try
  621. {
  622. if (OAuth2Info.CheckOAuth(Config.GoogleDriveOAuth2Info))
  623. {
  624. bool result = new GoogleDrive(Config.GoogleDriveOAuth2Info).RefreshAccessToken();
  625. if (result)
  626. {
  627. oauth2GoogleDrive.Status = "Login successful.";
  628. MessageBox.Show("Login successful.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
  629. }
  630. else
  631. {
  632. oauth2GoogleDrive.Status = "Login failed.";
  633. MessageBox.Show("Login failed.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
  634. }
  635. }
  636. }
  637. catch (Exception ex)
  638. {
  639. MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  640. }
  641. }
  642. #endregion Google Drive
  643. #region Box
  644. public void BoxAuthOpen()
  645. {
  646. try
  647. {
  648. OAuth2Info oauth = new OAuth2Info(APIKeys.BoxClientID, APIKeys.BoxClientSecret);
  649. string url = new Box(oauth).GetAuthorizationURL();
  650. if (!string.IsNullOrEmpty(url))
  651. {
  652. Config.BoxOAuth2Info = oauth;
  653. //Helpers.LoadBrowserAsync(url);
  654. DebugHelper.WriteLine("BoxAuthOpen - Authorization URL is opened: " + url);
  655. // Workaround for authorization because we don't have callback url which starts with https://
  656. using (OAuthWebForm oauthForm = new OAuthWebForm(url, "https://www.box.com/home/"))
  657. {
  658. if (oauthForm.ShowDialog() == DialogResult.OK)
  659. {
  660. BoxAuthComplete(oauthForm.Code);
  661. }
  662. }
  663. }
  664. else
  665. {
  666. DebugHelper.WriteLine("BoxAuthOpen - Authorization URL is empty.");
  667. }
  668. }
  669. catch (Exception ex)
  670. {
  671. MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  672. }
  673. }
  674. public void BoxAuthComplete(string code)
  675. {
  676. try
  677. {
  678. if (!string.IsNullOrEmpty(code) && Config.BoxOAuth2Info != null)
  679. {
  680. bool result = new Box(Config.BoxOAuth2Info).GetAccessToken(code);
  681. if (result)
  682. {
  683. oauth2Box.Status = "Login successful.";
  684. MessageBox.Show("Login successful.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
  685. }
  686. else
  687. {
  688. oauth2Box.Status = "Login failed.";
  689. MessageBox.Show("Login failed.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
  690. }
  691. oauth2Box.LoginStatus = result;
  692. btnBoxRefreshFolders.Enabled = result;
  693. }
  694. }
  695. catch (Exception ex)
  696. {
  697. MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  698. }
  699. }
  700. public void BoxAuthRefresh()
  701. {
  702. try
  703. {
  704. if (OAuth2Info.CheckOAuth(Config.BoxOAuth2Info))
  705. {
  706. bool result = new Box(Config.BoxOAuth2Info).RefreshAccessToken();
  707. if (result)
  708. {
  709. oauth2Box.Status = "Login successful.";
  710. MessageBox.Show("Login successful.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
  711. }
  712. else
  713. {
  714. oauth2Box.Status = "Login failed.";
  715. MessageBox.Show("Login failed.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
  716. }
  717. btnBoxRefreshFolders.Enabled = result;
  718. }
  719. }
  720. catch (Exception ex)
  721. {
  722. MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  723. }
  724. }
  725. public void BoxListFolders()
  726. {
  727. lvBoxFolders.Items.Clear();
  728. BoxAddFolder(Box.RootFolder);
  729. BoxListFolders(Box.RootFolder);
  730. }
  731. public void BoxListFolders(BoxFileEntry fileEntry)
  732. {
  733. if (!OAuth2Info.CheckOAuth(Config.BoxOAuth2Info))
  734. {
  735. MessageBox.Show("Authentication required.", "Box refresh folders list failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  736. }
  737. else
  738. {
  739. Box box = new Box(Config.BoxOAuth2Info);
  740. BoxFileInfo files = box.GetFiles(fileEntry);
  741. if (files != null && files.entries != null && files.entries.Length > 0)
  742. {
  743. foreach (BoxFileEntry folder in files.entries.Where(x => x.type == "folder"))
  744. {
  745. BoxAddFolder(folder);
  746. }
  747. }
  748. }
  749. }
  750. private void BoxAddFolder(BoxFileEntry folder)
  751. {
  752. ListViewItem lvi = new ListViewItem(folder.name);
  753. lvi.Tag = folder;
  754. lvBoxFolders.Items.Add(lvi);
  755. }
  756. #endregion Box
  757. #region Minus
  758. public void MinusAuth()
  759. {
  760. if (!string.IsNullOrEmpty(txtMinusUsername.Text) && !string.IsNullOrEmpty(txtMinusPassword.Text))
  761. {
  762. btnMinusAuth.Enabled = false;
  763. btnMinusRefreshAuth.Enabled = false;
  764. try
  765. {
  766. Config.MinusConfig.Username = txtMinusUsername.Text;
  767. Config.MinusConfig.Password = txtMinusPassword.Text;
  768. Config.MinusOAuth2Info = new OAuth2Info(APIKeys.MinusConsumerKey, APIKeys.MinusConsumerSecret);
  769. Minus minus = new Minus(Config.MinusConfig, Config.MinusOAuth2Info);
  770. if (minus.GetAccessToken())
  771. {
  772. minus.ReadFolderList();
  773. MinusUpdateControls();
  774. MessageBox.Show("Login successful.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
  775. }
  776. else
  777. {
  778. MessageBox.Show("Login failed.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
  779. }
  780. }
  781. catch (Exception ex)
  782. {
  783. MessageBox.Show("Error: " + ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
  784. }
  785. finally
  786. {
  787. btnMinusAuth.Enabled = true;
  788. btnMinusRefreshAuth.Enabled = true;
  789. }
  790. }
  791. }
  792. public void MinusAuthRefresh()
  793. {
  794. btnMinusAuth.Enabled = false;
  795. btnMinusRefreshAuth.Enabled = false;
  796. try
  797. {
  798. if (OAuth2Info.CheckOAuth(Config.MinusOAuth2Info))
  799. {
  800. bool result = new Minus(Config.MinusConfig, Config.MinusOAuth2Info).RefreshAccessToken();
  801. if (result)
  802. {
  803. MessageBox.Show("Login successful.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
  804. }
  805. else
  806. {
  807. MessageBox.Show("Login failed.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
  808. }
  809. }
  810. }
  811. catch (Exception ex)
  812. {
  813. MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  814. }
  815. finally
  816. {
  817. btnMinusAuth.Enabled = true;
  818. btnMinusRefreshAuth.Enabled = true;
  819. }
  820. }
  821. public void MinusUpdateControls()
  822. {
  823. if (Config.MinusConfig != null && Config.MinusConfig.MinusUser != null && OAuth2Info.CheckOAuth(Config.MinusOAuth2Info))
  824. {
  825. lblMinusAuthStatus.Text = "Logged in as " + Config.MinusConfig.MinusUser.display_name + ".";
  826. txtMinusUsername.Text = Config.MinusConfig.Username;
  827. txtMinusPassword.Text = Config.MinusConfig.Password;
  828. cboMinusFolders.Items.Clear();
  829. if (Config.MinusConfig.FolderList.Count > 0)
  830. {
  831. cboMinusFolders.Items.AddRange(Config.MinusConfig.FolderList.ToArray());
  832. cboMinusFolders.SelectedIndex = Config.MinusConfig.FolderID.BetweenOrDefault(0, cboMinusFolders.Items.Count - 1);
  833. }
  834. cbMinusURLType.SelectedIndex = (int)Config.MinusConfig.LinkType;
  835. }
  836. else
  837. {
  838. lblMinusAuthStatus.Text = "Not logged in.";
  839. btnMinusRefreshAuth.Enabled = false;
  840. }
  841. }
  842. private bool MinusHasFolder(string name)
  843. {
  844. return cboMinusFolders.Items.Cast<MinusFolder>().Any(mf => mf.name == name);
  845. }
  846. #endregion Minus
  847. #region FTP
  848. public bool CheckFTPAccounts()
  849. {
  850. return Config.FTPAccountList.IsValidIndex(Config.FTPSelectedImage);
  851. }
  852. public FTPAccount GetSelectedFTPAccount()
  853. {
  854. if (CheckFTPAccounts())
  855. {
  856. return Config.FTPAccountList[ucFTPAccounts.lbAccounts.SelectedIndex];
  857. }
  858. return null;
  859. }
  860. public void AddFTPAccount(FTPAccount account)
  861. {
  862. if (account != null)
  863. {
  864. Config.FTPAccountList.Add(account);
  865. ucFTPAccounts.AddItem(account);
  866. FTPSetup(Config.FTPAccountList);
  867. }
  868. }
  869. public void TestFTPAccountAsync(FTPAccount acc)
  870. {
  871. if (acc != null)
  872. {
  873. ucFTPAccounts.btnTest.Enabled = false;
  874. TaskEx.Run(() =>
  875. {
  876. TestFTPAccount(acc);
  877. },
  878. () =>
  879. {
  880. ucFTPAccounts.btnTest.Enabled = true;
  881. });
  882. }
  883. }
  884. private void FTPOpenClient()
  885. {
  886. FTPAccount account = GetSelectedFTPAccount();
  887. if (account != null)
  888. {
  889. new FTPClientForm(account).Show();
  890. }
  891. }
  892. public static void TestFTPAccount(FTPAccount account)
  893. {
  894. string msg = string.Empty;
  895. string remotePath = account.GetSubFolderPath();
  896. List<string> directories = new List<string>();
  897. try
  898. {
  899. if (account.Protocol == FTPProtocol.FTP || account.Protocol == FTPProtocol.FTPS)
  900. {
  901. using (FTP ftp = new FTP(account))
  902. {
  903. if (ftp.Connect())
  904. {
  905. if (!ftp.DirectoryExists(remotePath))
  906. {
  907. directories = ftp.CreateMultiDirectory(remotePath);
  908. }
  909. if (ftp.IsConnected)
  910. {
  911. if (directories.Count > 0)
  912. {
  913. msg = "Connected!\r\nCreated folders:\r\n" + string.Join("\r\n", directories);
  914. }
  915. else
  916. {
  917. msg = "Connected!";
  918. }
  919. }
  920. }
  921. }
  922. }
  923. else if (account.Protocol == FTPProtocol.SFTP)
  924. {
  925. using (SFTP sftp = new SFTP(account))
  926. {
  927. if (sftp.Connect())
  928. {
  929. if (!sftp.DirectoryExists(remotePath))
  930. {
  931. directories = sftp.CreateMultiDirectory(remotePath);
  932. }
  933. if (sftp.IsConnected)
  934. {
  935. if (directories.Count > 0)
  936. {
  937. msg = "Connected!\r\nCreated folders:\r\n" + string.Join("\r\n", directories);
  938. }
  939. else
  940. {
  941. msg = "Connected!";
  942. }
  943. }
  944. }
  945. }
  946. }
  947. }
  948. catch (Exception e)
  949. {
  950. msg = e.Message;
  951. }
  952. MessageBox.Show(msg, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
  953. }
  954. #endregion FTP
  955. #region SendSpace
  956. public UserPassBox SendSpaceRegister()
  957. {
  958. UserPassBox upb = new UserPassBox("SendSpace Registration...", "John Doe", "john.doe@gmail.com", "JohnDoe", "");
  959. upb.ShowDialog();
  960. if (upb.DialogResult == DialogResult.OK)
  961. {
  962. SendSpace sendSpace = new SendSpace(APIKeys.SendSpaceKey);
  963. upb.Success = sendSpace.AuthRegister(upb.UserName, upb.FullName, upb.Email, upb.Password);
  964. if (!upb.Success && sendSpace.Errors.Count > 0)
  965. {
  966. MessageBox.Show(sendSpace.ToErrorString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  967. }
  968. }
  969. return upb;
  970. }
  971. #endregion SendSpace
  972. #region Ge.tt
  973. public void Ge_ttLogin()
  974. {
  975. try
  976. {
  977. Ge_tt gett = new Ge_tt(APIKeys.Ge_ttKey);
  978. Ge_ttLogin login = gett.Login(txtGe_ttEmail.Text, txtGe_ttPassword.Text);
  979. Config.Ge_ttLogin = login;
  980. lblGe_ttStatus.Text = "Login successful.";
  981. }
  982. catch (Exception ex)
  983. {
  984. Config.Ge_ttLogin = null;
  985. lblGe_ttStatus.Text = "Login failed.";
  986. MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  987. }
  988. }
  989. #endregion Ge.tt
  990. #region Pastebin
  991. public void PastebinLogin()
  992. {
  993. if (Config.PastebinSettings != null)
  994. {
  995. try
  996. {
  997. Pastebin pastebin = new Pastebin(APIKeys.PastebinKey, Config.PastebinSettings);
  998. if (pastebin.Login())
  999. {
  1000. pgPastebinSettings.SelectedObject = Config.PastebinSettings;
  1001. MessageBox.Show("Login successful.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
  1002. }
  1003. else
  1004. {
  1005. MessageBox.Show("Login failed.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
  1006. }
  1007. }
  1008. catch (Exception ex)
  1009. {
  1010. MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  1011. }
  1012. }
  1013. }
  1014. #endregion Pastebin
  1015. #region Pushbullet
  1016. public void PushbulletGetDevices()
  1017. {
  1018. cboPushbulletDevices.Items.Clear();
  1019. cboPushbulletDevices.ResetText();
  1020. Pushbullet pushbullet = new Pushbullet(Config.PushbulletSettings);
  1021. Config.PushbulletSettings.DeviceList = pushbullet.GetDeviceList();
  1022. if (Config.PushbulletSettings.DeviceList.Count > 0)
  1023. {
  1024. Config.PushbulletSettings.SelectedDevice = 0;
  1025. cboPushbulletDevices.Enabled = true;
  1026. Config.PushbulletSettings.DeviceList.ForEach(pbDevice =>
  1027. {
  1028. cboPushbulletDevices.Items.Add(pbDevice.Name ?? "Invalid device name");
  1029. });
  1030. cboPushbulletDevices.SelectedIndex = 0;
  1031. }
  1032. }
  1033. #endregion Pushbullet
  1034. #region Twitter
  1035. public bool CheckTwitterAccounts()
  1036. {
  1037. return Config.TwitterOAuthInfoList.IsValidIndex(Config.TwitterSelectedAccount);
  1038. }
  1039. public void TwitterAuthOpen()
  1040. {
  1041. if (CheckTwitterAccounts())
  1042. {
  1043. OAuthInfo acc = new OAuthInfo(APIKeys.TwitterConsumerKey, APIKeys.TwitterConsumerSecret);
  1044. Twitter twitter = new Twitter(acc);
  1045. string url = twitter.GetAuthorizationURL();
  1046. if (!string.IsNullOrEmpty(url))
  1047. {
  1048. acc.Description = Config.TwitterOAuthInfoList[Config.TwitterSelectedAccount].Description;
  1049. Config.TwitterOAuthInfoList[Config.TwitterSelectedAccount] = acc;
  1050. ucTwitterAccounts.pgSettings.SelectedObject = acc;
  1051. Helpers.OpenURL(url);
  1052. btnTwitterLogin.Enabled = true;
  1053. }
  1054. }
  1055. }
  1056. public void TwitterAuthComplete()
  1057. {
  1058. if (CheckTwitterAccounts())
  1059. {
  1060. OAuthInfo acc = Config.TwitterOAuthInfoList[Config.TwitterSelectedAccount];
  1061. if (acc != null && !string.IsNullOrEmpty(acc.AuthToken) && !string.IsNullOrEmpty(acc.AuthSecret) && !string.IsNullOrEmpty(acc.AuthVerifier))
  1062. {
  1063. Twitter twitter = new Twitter(acc);
  1064. bool result = twitter.GetAccessToken(acc.AuthVerifier);
  1065. if (result)
  1066. {
  1067. acc.AuthVerifier = string.Empty;
  1068. Config.TwitterOAuthInfoList[Config.TwitterSelectedAccount] = acc;
  1069. ucTwitterAccounts.pgSettings.SelectedObject = acc;
  1070. MessageBox.Show("Login successful.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
  1071. }
  1072. else
  1073. {
  1074. MessageBox.Show("Login failed.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
  1075. }
  1076. }
  1077. }
  1078. }
  1079. #endregion Twitter
  1080. #region goo.gl
  1081. public void GoogleURLShortenerAuthOpen()
  1082. {
  1083. try
  1084. {
  1085. OAuth2Info oauth = new OAuth2Info(APIKeys.GoogleClientID, APIKeys.GoogleClientSecret);
  1086. string url = new GoogleURLShortener(oauth).GetAuthorizationURL();
  1087. if (!string.IsNullOrEmpty(url))
  1088. {
  1089. Config.GoogleURLShortenerOAuth2Info = oauth;
  1090. Helpers.OpenURL(url);
  1091. DebugHelper.WriteLine("GoogleURLShortenerAuthOpen - Authorization URL is opened: " + url);
  1092. }
  1093. else
  1094. {
  1095. DebugHelper.WriteLine("GoogleURLShortenerAuthOpen - Authorization URL is empty.");
  1096. }
  1097. }
  1098. catch (Exception ex)
  1099. {
  1100. MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  1101. }
  1102. }
  1103. public void GoogleURLShortenerAuthComplete(string code)
  1104. {
  1105. try
  1106. {
  1107. if (!string.IsNullOrEmpty(code) && Config.GoogleURLShortenerOAuth2Info != null)
  1108. {
  1109. bool result = new GoogleDrive(Config.GoogleURLShortenerOAuth2Info).GetAccessToken(code);
  1110. if (result)
  1111. {
  1112. oauth2GoogleURLShortener.Status = "Login successful.";
  1113. MessageBox.Show("Login successful.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
  1114. }
  1115. else
  1116. {
  1117. oauth2GoogleURLShortener.Status = "Login failed.";
  1118. MessageBox.Show("Login failed.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
  1119. }
  1120. oauth2GoogleURLShortener.LoginStatus = result;
  1121. }
  1122. }
  1123. catch (Exception ex)
  1124. {
  1125. MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  1126. }
  1127. }
  1128. public void GoogleURLShortenerAuthRefresh()
  1129. {
  1130. try
  1131. {
  1132. if (OAuth2Info.CheckOAuth(Config.GoogleURLShortenerOAuth2Info))
  1133. {
  1134. bool result = new GoogleDrive(Config.GoogleURLShortenerOAuth2Info).RefreshAccessToken();
  1135. if (result)
  1136. {
  1137. oauth2GoogleURLShortener.Status = "Login successful.";
  1138. MessageBox.Show("Login successful.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
  1139. }
  1140. else
  1141. {
  1142. oauth2GoogleURLShortener.Status = "Login failed.";
  1143. MessageBox.Show("Login failed.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
  1144. }
  1145. }
  1146. }
  1147. catch (Exception ex)
  1148. {
  1149. MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  1150. }
  1151. }
  1152. #endregion goo.gl
  1153. #region bit.ly
  1154. public void BitlyAuthOpen()
  1155. {
  1156. try
  1157. {
  1158. OAuth2Info oauth = new OAuth2Info(APIKeys.BitlyClientID, APIKeys.BitlyClientSecret);
  1159. string url = new BitlyURLShortener(oauth).GetAuthorizationURL();
  1160. if (!string.IsNullOrEmpty(url))
  1161. {
  1162. Config.BitlyOAuth2Info = oauth;
  1163. Helpers.OpenURL(url);
  1164. DebugHelper.WriteLine("BitlyAuthOpen - Authorization URL is opened: " + url);
  1165. }
  1166. else
  1167. {
  1168. DebugHelper.WriteLine("BitlyAuthOpen - Authorization URL is empty.");
  1169. }
  1170. }
  1171. catch (Exception ex)
  1172. {
  1173. Mess

Large files files are truncated, but you can click here to view the full file