mirror of
https://github.com/chylex/TweetDuck.git
synced 2024-11-24 20:42:49 +01:00
27 lines
803 B
C#
27 lines
803 B
C#
using System;
|
|
using System.Windows.Forms;
|
|
using TweetDuck.Core.Controls;
|
|
|
|
namespace TweetDuck.Core.Notification.Screenshot{
|
|
sealed class ScreenshotBridge{
|
|
private readonly Control owner;
|
|
|
|
private readonly Action<int> safeSetHeight;
|
|
private readonly Action safeTriggerScreenshot;
|
|
|
|
public ScreenshotBridge(Control owner, Action<int> safeSetHeight, Action safeTriggerScreenshot){
|
|
this.owner = owner;
|
|
this.safeSetHeight = safeSetHeight;
|
|
this.safeTriggerScreenshot = safeTriggerScreenshot;
|
|
}
|
|
|
|
public void SetHeight(int tweetHeight){
|
|
owner.InvokeSafe(() => safeSetHeight(tweetHeight));
|
|
}
|
|
|
|
public void TriggerScreenshot(){
|
|
owner.InvokeSafe(safeTriggerScreenshot);
|
|
}
|
|
}
|
|
}
|