public TaskProgressDialog() { base.SuspendLayout(); this.DoubleBuffered = true; base.ResizeRedraw = true; base.AutoHandleGlassRelatedOptimizations = true; base.IsGlassDesired = !OS.IsWin10OrLater; this.dispatcher = new ControlDispatcher(this); this.headerLabel = new PdnLabel(); this.progressBar = new ProgressBar(); this.separator = new PaintDotNet.Controls.SeparatorLine(); this.cancelButton = new PdnPushButton(); this.headerLabel.Name = "headerLabel"; this.progressBar.Name = "progressBar"; this.progressBar.Style = ProgressBarStyle.Marquee; this.progressBar.Minimum = 0; this.progressBar.Maximum = 100; this.separator.Name = "separator"; this.cancelButton.Name = "cancelButton"; this.cancelButton.AutoSize = true; this.cancelButton.Click += new EventHandler(this.OnCancelButtonClick); base.AutoScaleMode = AutoScaleMode.None; base.AcceptButton = null; base.CancelButton = this.cancelButton; base.FormBorderStyle = FormBorderStyle.FixedDialog; base.MinimizeBox = false; base.MaximizeBox = false; base.ShowInTaskbar = false; base.StartPosition = FormStartPosition.CenterParent; Control[] controls = new Control[] { this.headerLabel, this.progressBar, this.separator, this.cancelButton }; base.Controls.AddRange(controls); base.ResumeLayout(false); base.PerformLayout(); }
/// <inheritdoc /> public void Render(MediaBlock mediaBlock, TimeSpan clockPosition) { if (mediaBlock is VideoBlock == false) { return; } var block = (VideoBlock)mediaBlock; if (IsRenderingInProgress.Value) { if (MediaCore?.State.IsPlaying ?? false) { this.LogDebug(Aspects.VideoRenderer, $"{nameof(VideoRenderer)} frame skipped at {mediaBlock.StartTime}"); } return; } // Flag the start of a rendering cycle IsRenderingInProgress.Value = true; // Send the packets to the CC renderer MediaElement?.CaptionsView?.SendPackets(block, MediaCore); if (!IsRenderTime) { return; } else { RenderStopwatch.Restart(); } VideoDispatcher?.BeginInvoke(() => { try { // Prepare and write frame data if (PrepareVideoFrameBuffer(block)) { WriteVideoFrameBuffer(block, clockPosition); } } catch (Exception ex) { this.LogError(Aspects.VideoRenderer, $"{nameof(VideoRenderer)}.{nameof(Render)} bitmap failed.", ex); } finally { // Update the layout including pixel ratio and video rotation ControlDispatcher?.InvokeAsync(() => UpdateLayout(block, clockPosition), DispatcherPriority.Render); IsRenderingInProgress.Value = false; } }, DispatcherPriority.Send); }
/// <summary> /// ClearItems will remove all the items from the collection /// </summary> protected override void ClearItems() { if (InvokeRequired) { ControlDispatcher.Invoke(DispatcherPriority.DataBind, new ClearItemsCallback(ClearItems)); } else { base.ClearItems(); } }
public Executor(string[] args) { m_instance = int.Parse(args[0]); m_instanceString = m_instance.ToString(); m_partnerEntityId = new Safir.Dob.Typesystem.EntityId(DoseTest.Partner.ClassTypeId, new Safir.Dob.Typesystem.InstanceId(m_instance)); m_controlConnectionName = m_identifier + "_control"; m_testConnectionName = "partner_test_connection"; m_callbackActions = new Dictionary <Safir.Dob.CallbackId.Enumeration, List <DoseTest.Action> >(); foreach (Safir.Dob.CallbackId.Enumeration cb in Enum.GetValues(typeof(Safir.Dob.CallbackId.Enumeration))) { m_callbackActions.Add(cb, new List <DoseTest.Action>()); } m_controlDispatcher = new ControlDispatcher(m_controlDispatchEvent); m_testDispatcher = new Dispatcher(m_testDispatchEvent); m_testStopHandler = new StopHandler(); m_actionReceiver = new ActionReceiver(m_instance, m_dataReceivedEvent); }