Esempio n. 1
0
 //todo: use caller name as thread label instead of asking for it
 protected override void RunOnNewThread(Task task, string threadLabel)
 => new Thread(async() =>
 {
     try { await task; }
     catch (Exception ex) { ThreadedAlerter.Show(ex, threadLabel); }
 }
               ).Start();
Esempio n. 2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            ThreadedAlerter.CatchErrors(this);

            var cfg = CfgReader.ReadAndParseFromLocal();

            if (cfg == null)
            {
                MessageBox.Show($"Config not found in {CfgReader.ExpectedPath}");
                return;
            }

            var win = new MainWindow();

            using (var scope = Components.GetContainer(cfg).BeginLifetimeScope())
            {
                win.DataContext = scope.Resolve <MainWindowVM>();
            }
            win.Show();
        }
Esempio n. 3
0
 public UploaderClient2(RestServerCredentials restServerCredentials) : base(restServerCredentials)
 {
     OnError      = ex => ThreadedAlerter.Show(ex, "Uploader Client 2");
     _partUploadr = new PackagePartUploader(restServerCredentials);
 }
Esempio n. 4
0
 public static void CatchErrors(this IRepo1Client repo1Client, Application app, Action <string> errorLogger = null)
 => ThreadedAlerter.CatchErrors(app, PostIssueThen(repo1Client, errorLogger));
Esempio n. 5
0
 public PackagePartUploader(RestServerCredentials restServerCredentials) : base(restServerCredentials)
 {
     OnError = ex => ThreadedAlerter.Show(ex, "Package Part Uploader");
 }