private void ProcessImage(RasterImage rasterImage) { ClearOldData(false); selectedRowIndex = -1; if (rasterImage.ViewPerspective != RasterViewPerspective.TopLeft) { Leadtools.ImageProcessing.ChangeViewPerspectiveCommand cmd = new Leadtools.ImageProcessing.ChangeViewPerspectiveCommand(); cmd.InPlace = true; cmd.ViewPerspective = RasterViewPerspective.TopLeft; cmd.Run(rasterImage); } this.rasterImageViewer1.Image = rasterImage; processdlg = new ProcessDialog(checkReader); processdlg.Show(); processdlg.ProcessFinished += new EventHandler(processdlg_ProcessFinished); new Thread(delegate() { try { checkReader.ProcessImage(rasterImage); } catch (Exception e) { checkReader.Cancel(); this.Invoke(new Action(() => ThrowExp(e))); } }).Start(); }
private void attachProcess() { ProcessDialog dialog = new ProcessDialog(); if (dialog.ShowDialog() == DialogResult.OK) { API.attach(dialog.process); } }
// Update is called once per frame void Update() { if (gm.IsPaused()) { return; } if (Input.GetButtonDown("Fire1") || Input.GetKeyDown("l")) { // Disable firing only if dialog asks for it not to be shown ProcessDialog pd = GetComponent <ProcessDialog>(); if (pd.DialogDisableControls()) { return; } // Disable firing dialog is shown //if (dialogBox.gameObject.activeInHierarchy) //return; throwAudioSource.Play(); // Throw force Vector2 newThrowForce = new Vector2(throwForce.x * transform.localScale.x, throwForce.y); Vector3 newThrowOffset = new Vector3(throwOffset.x * transform.localScale.x, throwOffset.y, 0); float torqueRandDeviation = 0f; // Calc random torque deviation if (torqueDeviation != 0) { torqueRandDeviation = UnityEngine.Random.Range(0, torqueDeviation); } // todo make rotate negative if throwing left Transform microphone = Instantiate(prefab, transform.position + newThrowOffset, Quaternion.identity); microphone.GetComponent <Rigidbody2D>().AddForce(newThrowForce, ForceMode2D.Impulse); microphone.GetComponent <Rigidbody2D>().AddTorque(torque + torqueRandDeviation, ForceMode2D.Impulse); microphone.GetComponent <Rigidbody2D>().velocity = new Vector2(microphone.GetComponent <Rigidbody2D>().velocity.x + rb.velocity.x, 0); } }
public void init() { inputDialog = new InputDialog(); processDialog = new ProcessDialog(); }
void processdlg_ProcessFinished(object sender, EventArgs e) { UpdateControls(); processdlg = null; }