Пример #1
0
        private void ExceptionButton_Click(object sender, RoutedEventArgs e)
        {
            e.Handled = true;
            VMLog log = CommandViewModel.GetViewModelObject <VMLog>(e.OriginalSource);

            ExceptionBox.ShowException(log.ShortText, log.LongText, log.File.Path, this);
        }
Пример #2
0
        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();
        }
Пример #3
0
        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();
        }
Пример #4
0
        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);
        }
Пример #5
0
        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();
        }