Пример #1
0
        public async Task <IActionResult> Interrupt([FromBody] InterruptArgs args)
        {
            if (!await Scheduler.Interrupt(args.Id))
            {
                throw new InvalidOperationException("Cannot interrupt execution " + args.Id);
            }

            return(NoContent());
        }
Пример #2
0
        public FrameRingPresenter()
        {
            VideoStartTimer.Tick               += VideoStartTimer_Ticked;
            IsVisibleChanged                   += VisibleDpChanged;
            RingEngine                          = new RingEngine <IFrameRingEntry>();
            RingEngine.CurrentEntryChanged     += NextRingElement;
            RingEngine.BufferedEntryAdded      += BufferedEntryAdded;
            RingEngine.InterruptEntryAvailable += args =>
            {
                var resultArgs = new InterruptArgs(args.InterruptName);
                InterruptFrameAvailable?.Invoke(resultArgs);
                args.Result.RingEntryFrame = resultArgs.Result;
            };

            InitializeComponent();

            Loaded += OnLoaded;
        }