示例#1
0
        private void ApplyFilter(MachineServiceManagerViewModel vm)
        {
            var selectedService = _filterViewModel.SelectedService;

            bool result = true;

            //0 = first empty item in combo box - added manually in Services.get. magic number
            if (selectedService != null && selectedService.ServiceId != 0)
            {
                if (vm.MachineServiceManager.MachineService.Service.ServiceId != selectedService.ServiceId)
                {
                    result = false;
                }
            }



            if (_filterViewModel.HideRunningServices)
            {
                if (vm.Status.Id == MachineServiceStatus.Running.Id)
                {
                    result = false;
                }
            }

            vm.IsVisible = result;
        }
示例#2
0
 public RestartCommand(MachineServiceManagerViewModel viewModel)
 {
     _viewModel = viewModel;
 }