Thumbnail positions are not saved on exit

This commit is contained in:
Anton Kasyanov
2016-06-08 22:26:12 +03:00
parent 010a421033
commit c596857fbc

View File

@@ -35,7 +35,6 @@ namespace EveOPreview.UI
this._thumbnailDescriptionViews = new Dictionary<IntPtr, IThumbnailDescriptionView>(); this._thumbnailDescriptionViews = new Dictionary<IntPtr, IThumbnailDescriptionView>();
this._exitApplication = false; this._exitApplication = false;
this.View.ApplicationExitRequested += ExitApplication;
this.View.FormActivated += Activate; this.View.FormActivated += Activate;
this.View.FormMinimized += Minimize; this.View.FormMinimized += Minimize;
this.View.FormCloseRequested += Close; this.View.FormCloseRequested += Close;
@@ -43,6 +42,7 @@ namespace EveOPreview.UI
this.View.ThumbnailsSizeChanged += UpdateThumbnailsSize; this.View.ThumbnailsSizeChanged += UpdateThumbnailsSize;
this.View.ThumbnailStateChanged += UpdateThumbnailState; this.View.ThumbnailStateChanged += UpdateThumbnailState;
this.View.ForumUrlLinkActivated += OpenForumUrlLink; this.View.ForumUrlLinkActivated += OpenForumUrlLink;
this.View.ApplicationExitRequested += ExitApplication;
this._thumbnailManager.ThumbnailsAdded += ThumbnailsAdded; this._thumbnailManager.ThumbnailsAdded += ThumbnailsAdded;
this._thumbnailManager.ThumbnailsUpdated += ThumbnailsUpdated; this._thumbnailManager.ThumbnailsUpdated += ThumbnailsUpdated;
@@ -50,14 +50,6 @@ namespace EveOPreview.UI
this._thumbnailManager.ThumbnailSizeChanged += ThumbnailSizeChanged; this._thumbnailManager.ThumbnailSizeChanged += ThumbnailSizeChanged;
} }
private void ExitApplication()
{
this._thumbnailManager.Deactivate();
this._configurationStorage.Save();
this._exitApplication = true;
this.View.Close();
}
private void Activate() private void Activate()
{ {
this.LoadApplicationSettings(); this.LoadApplicationSettings();
@@ -80,6 +72,8 @@ namespace EveOPreview.UI
{ {
if (this._exitApplication || !this.View.MinimizeToTray) if (this._exitApplication || !this.View.MinimizeToTray)
{ {
this._thumbnailManager.Deactivate();
this._configurationStorage.Save();
request.Allow = true; request.Allow = true;
return; return;
} }
@@ -223,5 +217,11 @@ namespace EveOPreview.UI
ProcessStartInfo processStartInfo = new ProcessStartInfo(new Uri(MainPresenter.ForumUrl).AbsoluteUri); ProcessStartInfo processStartInfo = new ProcessStartInfo(new Uri(MainPresenter.ForumUrl).AbsoluteUri);
Process.Start(processStartInfo); Process.Start(processStartInfo);
} }
private void ExitApplication()
{
this._exitApplication = true;
this.View.Close();
}
} }
} }