protected override void OnCheckTarget(ComponentTarget target)
 {
     base.OnCheckTarget(target);
     PackagesForTarget.Clear();
     foreach (var p in AllPackages[target].OrderByDescending(fw => fw.Information.FirmwareVersion))
         PackagesForTarget.Add(p);
     SelectedPackage = new FirmwarePackageViewModel(PackagesForTarget.FirstOrDefault());
 }
 public void OpenFirmware(String FileName)
 {
     try
     {
         SelectedFilePath = FileName;
         if (FileName != null)
         {
             SelectedPackage = new FirmwarePackageViewModel(FirmwarePackage.Open(FileName));
             SelectedFile = System.IO.Path.GetFileName(FileName);
         }
         else
         {
             SelectedPackage = null;
             SelectedFile = "Нажмите, чтобы выбрать файл";
         }
     }
     catch (Exception exc)
     {
         MessageBox.Show("Не удалось открыть файл с прошивкой:\n\n" + exc.Message, "Не удалось открыть прошивку", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
 private void RemoveExistingViewModel(FirmwarePackageViewModel PackageViewModel)
 {
     _packagesCollection.Remove(PackageViewModel);
 }
 protected abstract void UpdateExistingViewModel(FirmwarePackageViewModel ExistingViewModel, IRepositoryElement Element);
 protected void AddModel(FirmwarePackageViewModel PackageViewModel)
 {
     _packagesCollection.Add(PackageViewModel);
 }
 protected override void UpdateExistingViewModel(FirmwarePackageViewModel ExistingViewModel, IRepositoryElement Element)
 {
     ExistingViewModel.Status = Element.Status;
 }
 protected override void UpdateExistingViewModel(FirmwarePackageViewModel ExistingViewModel, IRepositoryElement Element)
 {
     ExistingViewModel.Availability = new FirmwarePackageAvailabilityViewModel(true);
 }