Finished transition to MediatR for GUI <-> service interaction

This commit is contained in:
Anton Kasyanov
2018-02-25 16:25:14 +02:00
parent 8910608f9e
commit 37d14446a9
18 changed files with 141 additions and 71 deletions

View File

@@ -78,7 +78,19 @@ namespace EveOPreview.Services
thumbnail.IsEnabled = !hideAlways;
}
public void UpdateThumbnailsSize()
{
this.InternalSetThumbnailsSize(this._configuration.ThumbnailSize);
}
public async void SetThumbnailsSize(Size size)
{
this.InternalSetThumbnailsSize(size);
await this._mediator.Publish(new ThumbnailActiveSizeUpdated(size));
}
private void InternalSetThumbnailsSize(Size size)
{
this.DisableViewEvents();
@@ -88,8 +100,6 @@ namespace EveOPreview.Services
entry.Value.Refresh(false);
}
await this._mediator.Publish(new ThumbnailSizeUpdated(size));
this.EnableViewEvents();
}
@@ -104,7 +114,7 @@ namespace EveOPreview.Services
foreach (KeyValuePair<IntPtr, IThumbnailView> entry in this._thumbnailViews)
{
IThumbnailView view = entry.Value;
if (hideAllThumbnails || !view.IsEnabled)
{
if (view.IsActive)
@@ -154,7 +164,7 @@ namespace EveOPreview.Services
this.EnableViewEvents();
}
public void SetupThumbnailFrames()
public void UpdateThumbnailFrames()
{
this.DisableViewEvents();