Ejemplo n.º 1
0
        private void _requestr_ResponseReceived(object sender, ApprovalEnvelope <string> envelope)
        {
            DoCancel();
            if (envelope.IsApproved != true)
            {
                return;
            }

            var jobs = MarketDayCloser.GetActions(_main.ColxnsDB, _main.AppArgs,
                                                  envelope.ResponderName);

            Parallel.Invoke(jobs.ToArray());

            CurrentExe.RelaunchApp();
        }
Ejemplo n.º 2
0
        private async Task DownloadAndWriteToDisk()
        {
            Log("Downloading latest file from server ...");
            var b64 = await _client.GetContentB64(_fileKey);

            if (b64.IsBlank())
            {
                Log($"Something went wrong at {nameof(DownloadAndWriteToDisk)}!");
            }

            Log("Writing downloaded file to disk ...");
            DecodeB64ToDisk(b64);

            if (_fileKey == CheckerRelease.FileKey)
            {
                _listnr.Disconnect();
                CurrentExe.RelaunchApp();
            }
        }
Ejemplo n.º 3
0
        private async Task ExitApp(bool relaunchAfter)
        {
            try
            {
                OnWindowClose();
                await OnWindowCloseAsync();

                _scope?.Dispose();
                AppInsights.Flush();
                if (relaunchAfter)
                {
                    CurrentExe.RelaunchApp();
                }
                else
                {
                    CurrentExe.Shutdown();
                }
            }
            catch { }
        }