mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
Introduced a very simple "singleton" service-locator, which allowed for a removal of specific implementations which were very limited. With this it's easier to access dependencies.
This commit is contained in:
parent
3ebdf3d2fe
commit
80d8f51fc5
53 changed files with 744 additions and 1230 deletions
|
@ -52,16 +52,11 @@ namespace GreenshotPlugin.Core {
|
|||
private static readonly CoreConfiguration CoreConfig = IniConfig.GetIniSection<CoreConfiguration>();
|
||||
private const int ExifOrientationId = 0x0112;
|
||||
|
||||
/// <summary>
|
||||
/// This is a factory method to create a surface, set from the Greenshot main project
|
||||
/// </summary>
|
||||
public static Func<ISurface> SurfaceFactory { get; set; }
|
||||
|
||||
static ImageHelper()
|
||||
static ImageHelper()
|
||||
{
|
||||
StreamConverters["greenshot"] = (stream, s) =>
|
||||
{
|
||||
var surface = SurfaceFactory();
|
||||
var surface = SimpleServiceProvider.Current.GetInstance<Func<ISurface>>().Invoke();
|
||||
return surface.GetImageForExport();
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue