private void Requeue(object param) { Thread background = new Thread(new ThreadStart ( () => { try { this.ParentJob.RequeueTask(this.instance.TaskId); } catch (Exception ex) { VMLog.GetInstance().AddMessage(new LogMessage(LogMessageTypes.Error, ex.Message, this.Name, "Requeue Task")); } })); background.IsBackground = true; background.Priority = ThreadPriority.Lowest; background.Start(); }
private void CancelJob(object param) { Thread background = new Thread(new ThreadStart ( () => { try { HpcScheduler.CancelJob(this.JobID, "Cancelled by cluster administrator."); } catch (Exception ex) { VMLog.GetInstance().AddMessage(new LogMessage(LogMessageTypes.Error, ex.Message, this.Name, "Cancel Job")); } })); background.IsBackground = true; background.Priority = ThreadPriority.Lowest; background.Start(); }
public VMListViewModel(VMModel vmModel, ObservableCollection <VM> _VMList) { this.vmModel = vmModel; View = new VMListView(); this.VMList = _VMList; vmModel.ActiveVMList.Clear(); //FillVMList(); RefreshVMListCommand = new DelegateCommand <ObservableCollection <VM> >(RefreshVMList, CanRefreshVMList); SelectAllCommand = new DelegateCommand <IEnumerable <VMViewModel> >(SelectAll, CanSelectAll); UnselectAllCommand = new DelegateCommand <IEnumerable <VMViewModel> >(UnselectAll, CanUnselectAll); ChangeMainNodeNameCommand = new DelegateCommand <string>(ChangeMainNode, CanChangeMainNode); CanExecuteRaisers = new List <Action> { RefreshVMListCommand.RaiseCanExecuteChanged, SelectAllCommand.RaiseCanExecuteChanged, UnselectAllCommand.RaiseCanExecuteChanged }; this.MainNodeName = vmModel.Settings.MainNodeName; this.VMList.CollectionChanged += (obj, exp) => { RefreshCommands(); OnPropertyChanged("VMList"); }; vmModel.ActiveVMList.CollectionChanged += (obj, exp) => { DetailsExpanded = false; PropertiesExpanded = false; JobsExpanded = false; GC.Collect(); UnselectAllCommand.RaiseCanExecuteChanged(); }; VMLog.GetInstance().CollectionChanged += (o, e) => { LogExpanded = true; }; View.SetViewModel(this); }
private void RequeueJob(object param) { Thread background = new Thread(new ThreadStart ( () => { try { HpcScheduler.ConfigureJob(this.JobID); HpcScheduler.SubmitJob(this.Job, string.Empty, string.Empty); } catch (Exception ex) { VMLog.GetInstance().AddMessage(new LogMessage(LogMessageTypes.Error, ex.Message, this.Name, "Requeue Job")); } })); background.IsBackground = true; background.Priority = ThreadPriority.Lowest; background.Start(); }