1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-07-29 22:59:03 +02:00

Rename more parameters and fields in TweetDeckBridge

This commit is contained in:
chylex 2017-08-31 14:40:10 +02:00
parent 44397b2d45
commit c77c974455
2 changed files with 18 additions and 18 deletions

View File

@ -11,14 +11,14 @@
namespace TweetDuck.Core.Bridge{
sealed class TweetDeckBridge{
public static string LastHighlightedTweet = string.Empty;
public static string LastHighlightedQuotedTweet = string.Empty;
public static string LastHighlightedTweetUrl = string.Empty;
public static string LastHighlightedQuoteUrl = string.Empty;
public static string LastHighlightedTweetAuthor = string.Empty;
public static string[] LastHighlightedTweetImages = StringUtils.EmptyArray;
public static Dictionary<string, string> SessionData = new Dictionary<string, string>(2);
public static void ResetStaticProperties(){
LastHighlightedTweet = LastHighlightedQuotedTweet = LastHighlightedTweetAuthor = string.Empty;
LastHighlightedTweetUrl = LastHighlightedQuoteUrl = LastHighlightedTweetAuthor = string.Empty;
LastHighlightedTweetImages = StringUtils.EmptyArray;
}
@ -59,10 +59,10 @@ public void SetLastRightClickInfo(string type, string link){
form.InvokeAsyncSafe(() => ContextMenuBase.SetContextInfo(type, link));
}
public void SetLastHighlightedTweet(string link, string quotedLink, string author, string imageList){
public void SetLastHighlightedTweet(string tweetUrl, string quoteUrl, string author, string imageList){
form.InvokeAsyncSafe(() => {
LastHighlightedTweet = link;
LastHighlightedQuotedTweet = quotedLink;
LastHighlightedTweetUrl = tweetUrl;
LastHighlightedQuoteUrl = quoteUrl;
LastHighlightedTweetAuthor = author;
LastHighlightedTweetImages = imageList.Split(';');
});

View File

@ -26,8 +26,8 @@ sealed class ContextMenuBrowser : ContextMenuBase{
private readonly FormBrowser form;
private string lastHighlightedTweet;
private string lastHighlightedQuotedTweet;
private string lastHighlightedTweetUrl;
private string lastHighlightedQuoteUrl;
public ContextMenuBrowser(FormBrowser form) : base(form){
this.form = form;
@ -46,20 +46,20 @@ public override void OnBeforeContextMenu(IWebBrowser browserControl, IBrowser br
base.OnBeforeContextMenu(browserControl, browser, frame, parameters, model);
lastHighlightedTweet = TweetDeckBridge.LastHighlightedTweet;
lastHighlightedQuotedTweet = TweetDeckBridge.LastHighlightedQuotedTweet;
lastHighlightedTweetUrl = TweetDeckBridge.LastHighlightedTweetUrl;
lastHighlightedQuoteUrl = TweetDeckBridge.LastHighlightedQuoteUrl;
if (!TwitterUtils.IsTweetDeckWebsite(frame) || browser.IsLoading){
lastHighlightedTweet = string.Empty;
lastHighlightedQuotedTweet = string.Empty;
lastHighlightedTweetUrl = string.Empty;
lastHighlightedQuoteUrl = string.Empty;
}
if (!string.IsNullOrEmpty(lastHighlightedTweet) && (parameters.TypeFlags & (ContextMenuType.Editable | ContextMenuType.Selection)) == 0){
if (!string.IsNullOrEmpty(lastHighlightedTweetUrl) && (parameters.TypeFlags & (ContextMenuType.Editable | ContextMenuType.Selection)) == 0){
model.AddItem(MenuOpenTweetUrl, "Open tweet in browser");
model.AddItem(MenuCopyTweetUrl, "Copy tweet address");
model.AddItem(MenuScreenshotTweet, "Screenshot tweet to clipboard");
if (!string.IsNullOrEmpty(lastHighlightedQuotedTweet)){
if (!string.IsNullOrEmpty(lastHighlightedQuoteUrl)){
model.AddSeparator();
model.AddItem(MenuOpenQuotedTweetUrl, "Open quoted tweet in browser");
model.AddItem(MenuCopyQuotedTweetUrl, "Copy quoted tweet address");
@ -118,11 +118,11 @@ public override bool OnContextMenuCommand(IWebBrowser browserControl, IBrowser b
return true;
case MenuOpenTweetUrl:
BrowserUtils.OpenExternalBrowser(lastHighlightedTweet);
BrowserUtils.OpenExternalBrowser(lastHighlightedTweetUrl);
return true;
case MenuCopyTweetUrl:
SetClipboardText(lastHighlightedTweet);
SetClipboardText(lastHighlightedTweetUrl);
return true;
case MenuScreenshotTweet:
@ -130,11 +130,11 @@ public override bool OnContextMenuCommand(IWebBrowser browserControl, IBrowser b
return true;
case MenuOpenQuotedTweetUrl:
BrowserUtils.OpenExternalBrowser(lastHighlightedQuotedTweet);
BrowserUtils.OpenExternalBrowser(lastHighlightedQuoteUrl);
return true;
case MenuCopyQuotedTweetUrl:
SetClipboardText(lastHighlightedQuotedTweet);
SetClipboardText(lastHighlightedQuoteUrl);
return true;
}