public string LinkUrl(PictureDisplaySize pictureDisplaySize) { string linkUrl = string.Empty; switch (pictureDisplaySize) { case PictureDisplaySize.WebUrl: linkUrl = this.WebUrl; break; case PictureDisplaySize.OriginalUrl: linkUrl = this.OriginalUrl; break; case PictureDisplaySize.SquareThumbnailUrl: linkUrl = this.SquareThumbnailUrl; break; default: linkUrl = this.WebUrl; break; } if (string.IsNullOrEmpty(linkUrl)) { linkUrl = this.WebUrl; } return(linkUrl); }
/// <summary> /// A form for token /// </summary> /// <returns>bool true if OK was pressed, false if cancel</returns> public bool ShowConfigDialog() { SettingsForm settingsForm; ILanguage lang = Language.GetInstance(); BackgroundForm backgroundForm = BackgroundForm.ShowAndWait(BoxPlugin.Attributes.Name, lang.GetString(LangKey.communication_wait)); try { settingsForm = new SettingsForm(this); } finally { backgroundForm.CloseDialog(); } settingsForm.UploadFormat = this.UploadFormat.ToString(); settingsForm.AfterUploadOpenHistory = this.AfterUploadOpenHistory; settingsForm.AfterUploadLinkToClipBoard = this.AfterUploadLinkToClipBoard; settingsForm.AuthToken = this.boxToken; settingsForm.DefaultSize = this.PictureDisplaySize.ToString(); DialogResult result = settingsForm.ShowDialog(); if (result == DialogResult.OK) { this.UploadFormat = (OutputFormat)Enum.Parse(typeof(OutputFormat), settingsForm.UploadFormat.ToLower()); this.AfterUploadOpenHistory = settingsForm.AfterUploadOpenHistory; this.AfterUploadLinkToClipBoard = settingsForm.AfterUploadLinkToClipBoard; this.boxToken = settingsForm.AuthToken; this.PictureDisplaySize = (PictureDisplaySize)Enum.Parse(typeof(PictureDisplaySize), settingsForm.DefaultSize); IniConfig.Save(); return(true); } return(false); }
private void openPicture(PictureDisplaySize pictureDisplaySize) { if (listview_Picasa_uploads.SelectedItems != null && listview_Picasa_uploads.SelectedItems.Count > 0) { for (int i = 0; i < listview_Picasa_uploads.SelectedItems.Count; i++) { PicasaInfo imgurInfo = (PicasaInfo)listview_Picasa_uploads.SelectedItems[i].Tag; System.Diagnostics.Process.Start(imgurInfo.LinkUrl(pictureDisplaySize)); } } }
/// <summary> /// A form for token /// </summary> /// <returns>bool true if OK was pressed, false if cancel</returns> public bool ShowConfigDialog() { SettingsForm settingsForm; ILanguage lang = Language.GetInstance(); BackgroundForm backgroundForm = BackgroundForm.ShowAndWait(FlickrPlugin.Attributes.Name, lang.GetString(LangKey.communication_wait)); try { settingsForm = new SettingsForm(this); } finally { backgroundForm.CloseDialog(); } settingsForm.AuthToken = this.flickrToken; settingsForm.IsFamily = this.IsFamily; settingsForm.IsPublic = this.IsPublic; settingsForm.IsFriend = this.IsFriend; settingsForm.UploadFormat = this.UploadFormat.ToString(); settingsForm.SafetyLevel = this.SafetyLevel.ToString(); settingsForm.HiddenFromSearch = this.HiddenFromSearch.ToString(); settingsForm.PictureDefaultSize = this.PictureDisplaySize.ToString(); settingsForm.AfterUploadOpenHistory = this.AfterUploadOpenHistory; settingsForm.AfterUploadLinkToClipBoard = this.AfterUploadLinkToClipBoard; DialogResult result = settingsForm.ShowDialog(); if (result == DialogResult.OK) { this.flickrToken = settingsForm.AuthToken; this.IsFamily = settingsForm.IsFamily; this.IsPublic = settingsForm.IsPublic; this.IsFriend = settingsForm.IsFriend; this.SafetyLevel = (FlickrNet.SafetyLevel)Enum.Parse(typeof(FlickrNet.SafetyLevel), settingsForm.SafetyLevel); this.HiddenFromSearch = (FlickrNet.HiddenFromSearch)Enum.Parse(typeof(FlickrNet.HiddenFromSearch), settingsForm.HiddenFromSearch); this.UploadFormat = (OutputFormat)Enum.Parse(typeof(OutputFormat), settingsForm.UploadFormat.ToLower()); this.PictureDisplaySize = (PictureDisplaySize)Enum.Parse(typeof(PictureDisplaySize), settingsForm.PictureDefaultSize); this.AfterUploadOpenHistory = settingsForm.AfterUploadOpenHistory; this.AfterUploadLinkToClipBoard = settingsForm.AfterUploadLinkToClipBoard; IniConfig.Save(); return(true); } return(false); }
private void clipboardUrl(PictureDisplaySize pictureDisplaySize) { StringBuilder links = new StringBuilder(); if (listview_Picasa_uploads.SelectedItems != null && listview_Picasa_uploads.SelectedItems.Count > 0) { for (int i = 0; i < listview_Picasa_uploads.SelectedItems.Count; i++) { PicasaInfo PicasaInfo = (PicasaInfo)listview_Picasa_uploads.SelectedItems[i].Tag; links.AppendLine(PicasaInfo.LinkUrl(pictureDisplaySize)); } } try { Clipboard.SetText(links.ToString()); } catch (Exception ex) { LOG.Error("Can't write to clipboard: ", ex); } }
/// <summary> /// A form for token /// </summary> /// <returns>bool true if OK was pressed, false if cancel</returns> public bool ShowConfigDialog() { SettingsForm settingsForm; ILanguage lang = Language.GetInstance(); BackgroundForm backgroundForm = BackgroundForm.ShowAndWait(PicasaPlugin.Attributes.Name, lang.GetString(LangKey.communication_wait)); try { settingsForm = new SettingsForm(this); } finally { backgroundForm.CloseDialog(); } settingsForm.UploadFormat = this.UploadFormat.ToString(); settingsForm.AfterUploadOpenHistory = this.AfterUploadOpenHistory; settingsForm.AfterUploadLinkToClipBoard = this.AfterUploadLinkToClipBoard; settingsForm.Username = this.Username; settingsForm.Password = this.Password; settingsForm.PictureDefaultSize = this.PictureDisplaySize.ToString(); DialogResult result = settingsForm.ShowDialog(); if (result == DialogResult.OK) { this.UploadFormat = (OutputFormat)Enum.Parse(typeof(OutputFormat), settingsForm.UploadFormat.ToLower()); this.AfterUploadOpenHistory=settingsForm.AfterUploadOpenHistory; this.AfterUploadLinkToClipBoard=settingsForm.AfterUploadLinkToClipBoard; this.Username=settingsForm.Username; this.Password=settingsForm.Password; this.PictureDisplaySize = (PictureDisplaySize)Enum.Parse(typeof(PictureDisplaySize), settingsForm.PictureDefaultSize); IniConfig.Save(); return true; } return false; }
public string LinkUrl(PictureDisplaySize pictureDisplaySize) { string linkUrl = string.Empty; switch (pictureDisplaySize) { case PictureDisplaySize.WebUrl: linkUrl = this.WebUrl; break; case PictureDisplaySize.Large: linkUrl = this.LargeUrl; break; case PictureDisplaySize.Medium: linkUrl = this.MediumUrl; break; case PictureDisplaySize.OriginalUrl: linkUrl = this.OriginalUrl; break; case PictureDisplaySize.SquareThumbnailUrl: linkUrl = this.SquareThumbnailUrl; break; default: linkUrl = this.WebUrl; break; } if (string.IsNullOrEmpty(linkUrl)) { linkUrl = this.WebUrl; } return linkUrl; }
private void clipboardUrl(PictureDisplaySize pictureDisplaySize) { StringBuilder links = new StringBuilder(); if (listview_Box_uploads.SelectedItems != null && listview_Box_uploads.SelectedItems.Count > 0) { for (int i = 0; i < listview_Box_uploads.SelectedItems.Count; i++) { BoxInfo BoxInfo = (BoxInfo)listview_Box_uploads.SelectedItems[i].Tag; links.AppendLine(BoxInfo.LinkUrl(pictureDisplaySize)); } } try { Clipboard.SetText(links.ToString()); } catch (Exception ex) { LOG.Error("Can't write to clipboard: ", ex); } }
private void openPicture(PictureDisplaySize pictureDisplaySize) { if (listview_Box_uploads.SelectedItems != null && listview_Box_uploads.SelectedItems.Count > 0) { for (int i = 0; i < listview_Box_uploads.SelectedItems.Count; i++) { BoxInfo imgurInfo = (BoxInfo)listview_Box_uploads.SelectedItems[i].Tag; System.Diagnostics.Process.Start(imgurInfo.LinkUrl(pictureDisplaySize)); } } }
/// <summary> /// A form for token /// </summary> /// <returns>bool true if OK was pressed, false if cancel</returns> public bool ShowConfigDialog() { SettingsForm settingsForm; ILanguage lang = Language.GetInstance(); BackgroundForm backgroundForm = BackgroundForm.ShowAndWait(FlickrPlugin.Attributes.Name, lang.GetString(LangKey.communication_wait)); try { settingsForm = new SettingsForm(this); } finally { backgroundForm.CloseDialog(); } settingsForm.AuthToken = this.flickrToken; settingsForm.IsFamily = this.IsFamily; settingsForm.IsPublic = this.IsPublic; settingsForm.IsFriend = this.IsFriend; settingsForm.UploadFormat = this.UploadFormat.ToString(); settingsForm.SafetyLevel = this.SafetyLevel.ToString(); settingsForm.HiddenFromSearch = this.HiddenFromSearch.ToString(); settingsForm.PictureDefaultSize = this.PictureDisplaySize.ToString(); settingsForm.AfterUploadOpenHistory = this.AfterUploadOpenHistory; settingsForm.AfterUploadLinkToClipBoard = this.AfterUploadLinkToClipBoard; DialogResult result = settingsForm.ShowDialog(); if (result == DialogResult.OK) { this.flickrToken = settingsForm.AuthToken; this.IsFamily=settingsForm.IsFamily; this.IsPublic=settingsForm.IsPublic; this.IsFriend=settingsForm.IsFriend; this.SafetyLevel = (FlickrNet.SafetyLevel)Enum.Parse(typeof(FlickrNet.SafetyLevel), settingsForm.SafetyLevel); this.HiddenFromSearch = (FlickrNet.HiddenFromSearch)Enum.Parse(typeof(FlickrNet.HiddenFromSearch), settingsForm.HiddenFromSearch); this.UploadFormat = (OutputFormat)Enum.Parse(typeof(OutputFormat), settingsForm.UploadFormat.ToLower()); this.PictureDisplaySize = (PictureDisplaySize)Enum.Parse(typeof(PictureDisplaySize), settingsForm.PictureDefaultSize); this.AfterUploadOpenHistory=settingsForm.AfterUploadOpenHistory; this.AfterUploadLinkToClipBoard=settingsForm.AfterUploadLinkToClipBoard; IniConfig.Save(); return true; } return false; }