BudgetAnalyser.ShellController.OnApplicationStateLoaded C# (CSharp) Method

OnApplicationStateLoaded() private method

private OnApplicationStateLoaded ( [ message ) : void
message [
return void
        private async void OnApplicationStateLoaded([NotNull] ApplicationStateLoadedMessage message)
        {
            if (message == null)
            {
                throw new ArgumentNullException(nameof(message));
            }

            var shellState = message.ElementOfType<ShellPersistentState>();
            if (shellState != null)
            {
                // Setting Window Size at this point has no effect, must happen after window is loaded. See OnViewReady()
                if (shellState.Size.X > 0 || shellState.Size.Y > 0)
                {
                    this.originalWindowSize = shellState.Size;
                }
                else
                {
                    this.originalWindowSize = new Point(1250, 600);
                }

                if (shellState.TopLeft.X > 0 || shellState.TopLeft.Y > 0)
                {
                    // Setting Window Top & Left at this point has no effect, must happen after window is loaded. See OnViewReady()
                    this.originalWindowTopLeft = shellState.TopLeft;
                }
            }

            var storedMainAppState = message.ElementOfType<MainApplicationState>();
            if (storedMainAppState != null)
            {
                await this.persistenceOperations.LoadDatabase(storedMainAppState.BudgetAnalyserDataStorageKey);
            }
        }