Ejemplo n.º 1
0
 private void DoCalculateShiftTable(HomeViewModel homeViewModel, ShiftTableCalculator shiftTableCalculator)
 {
     try
     {
         shiftTableCalculator.PerformCalculation(homeViewModel);
     }
     catch (Exception e)
     {
         shiftTableCalculator.IsPerformingCalculation = false;
         throw e;
     }
 }
Ejemplo n.º 2
0
        public HomeViewModel(IDialogService dialogService, IImageManager imageManager, IShellViewModel shellViewModel, IEntityQuery entityQuery, IVETSEntityManagerView entityManager, ISystemLogManager logger, ShiftTableCalculator shiftTableCalculator)
        {
            _shellViewModel                = shellViewModel;
            _entityQuery                   = entityQuery;
            _entityManager                 = entityManager;
            SystemLogService.Logger        = logger;
            SystemLogService.DialogService = dialogService;

            CalculateShiftTableCommand = new CalculateShiftTableCommand(this, imageManager, shiftTableCalculator);

            var imagePathPattern = "/STARS.Applications.VETS.Plugins.ShiftTableCalculator;component/Images/{0}.png";

            DisplayInfo = new ExplorerDisplayInfo
            {
                Description     = Resources.DisplayName,
                Image16         = string.Format(imagePathPattern, "color_image_16"),
                ExplorerImage16 = string.Format(imagePathPattern, "white_image_16"),
            };
            DisplayName = Resources.DisplayName;
        }
Ejemplo n.º 3
0
 public CalculateShiftTableCommand(HomeViewModel homeViewModel, IImageManager imageManager, ShiftTableCalculator shiftTableCalculator)
 {
     Command = new RelayCommand(_ => DoCalculateShiftTable(homeViewModel, shiftTableCalculator),
                                _ => (homeViewModel.SelectedVehicle != null && (homeViewModel.SelectedTrace != null || homeViewModel.WmtcMode)));
     DisplayInfo = new DisplayInfo
     {
         Description = Properties.Resources.CalculateShiftTable,
         Image16     = imageManager.GetImage16Path("Import")
     };
 }