Ejemplo n.º 1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            try
            {
                var args = Environment.GetCommandLineArgs();
                Constant.PidLauncher = int.Parse(args[1]);
            }
            catch (Exception)
            {
                MessageBox.Show(Constant.ErrorOnStartUpdater);
                Shutdown();
                return;
            }

            var proc = new ProcessHelper();

            if (!File.Exists(CommonConstant.FileSettingsLauncher))
            {
                MessageBox.Show(CommonConstant.NotFoundFileSettings);
                Shutdown();
                return;
            }

            var token = proc.GetPublicKeyTokenFromAssembly(Assembly.GetCallingAssembly());

            if (string.IsNullOrEmpty(token))
            {
                MessageBox.Show(Constant.CrashUpdater);
                Shutdown();
                return;
            }

            var mut = new Mutex(true, token, out _instance);

            if (!_instance)
            {
                MessageBox.Show(Constant.AlreadyStartUpdater);
                Shutdown();
            }


            base.OnStartup(e);

            _mainWindowViewModel = new DataMainViewModel();

            displayRootRegistry.ShowPresentation(_mainWindowViewModel, false);
        }
Ejemplo n.º 2
0
 public ProgressBarCommand(DataMainViewModel dataMainViewModel)
 {
     _dataMainViewModel = dataMainViewModel;
 }