Ejemplo n.º 1
0
        public override void Initialize()
        {
            Task.Factory
            .StartNew(() => MediaLibrary.LoadAll(ShowProgress))
            .ContinueWith(tsk =>
            {
                if (tsk.IsFaulted)
                {
                    var message = tsk.Exception.GetBaseException().Message;

                    MessageBox.Show(
                        message,
                        "Initialization error",
                        MessageBoxButton.OK,
                        MessageBoxImage.Error);

                    LogFile.Error(message);

                    Application.Current.Shutdown();
                    return;
                }

                var startScreen = ViewModels.StartScreen.Create();
                Shell.ChangeScreen(startScreen);
            }, TaskScheduler.FromCurrentSynchronizationContext());
        }
Ejemplo n.º 2
0
 public override void Initialize()
 {
     Task.Factory.StartNew(() => MediaLibrary.LoadAll(ShowProgress))
     .ContinueWith(tsk =>
     {
         var startScreen = ViewModels.StartScreen.Create();
         Shell.ChangeScreen(startScreen);
     }, TaskScheduler.FromCurrentSynchronizationContext());
 }
Ejemplo n.º 3
0
        private static void Main(string[] args)
        {
            MediaLibrary.LoadAll();
            var runner = new TaskRunner();

            try
            {
                if (!runner.Run(args))
                {
                    Usage();
                    return;
                }
            }
            catch (Exception ex)
            {
                LogFile.Error(ex.ToString());
            }
        }