private void RunBtn_Click(object sender, EventArgs e) { var btn = (SimpleButton)sender; if (btn.Name == "Гравировать") { if (XtraMessageBox.Show("Вы действительно хотите гравировать?", "Сообщения", MessageBoxButtons.YesNo) == DialogResult.Yes) { if (!runBackgroundWorker.IsBusy) { runBackgroundWorker.RunWorkerAsync(); btn.Name = "Стоп"; btn.BackColor = Color.FromArgb(192, 0, 0); } else { XtraMessageBox.Show("Гравировка уже идет", "Information", MessageBoxButtons.OK); } } } else { ReopositoryEzdFile.StopMark(); btn.Name = "Гравировать"; btn.BackColor = Color.FromArgb(0, 192, 192); } }
private void TestRedMarkContourBackgroundWorker_DoWork(object sender, DoWorkEventArgs e) { while (doWorkTest) { Thread.Sleep(100); ReopositoryEzdFile.RedMarkContour(); } }
private void ChangeFont(ReopositoryEzdFile.ModeFontSize mode, int index) { var img = ReopositoryEzdFile.FontSize(_competitor[index].Item1, mode, _currentEzd.Image.Width, _currentEzd.Image.Height); img = PictureControl.Images.SetImageTransparent(img); _currentEzd.Image = img; }
private void RunBackgroundWorker_DoWork(object sender, DoWorkEventArgs e) { if (doWorkRun) { ReopositoryEzdFile.Mark(); } if (!ReopositoryEzdFile.IsMarking()) { this.runBtn.Text = "RUN"; this.runBtn.Appearance.BackColor = Color.FromArgb(0, 192, 192); } }
private void obj1TextEdit_TextChanged(object sender, EventArgs e) { try { var text = (TextEdit)sender; var comp = new Tuple <string, string>(text.Properties.NullText, text.Text); _currentEzd.Image = ReopositoryEzdFile.UpdateCustomEzd(comp, _currentEzd.Width, _currentEzd.Height); } catch (Exception ex) { XtraMessageBox.Show("Данные с этим номером не найдены", "Information", MessageBoxButtons.OK); } }
private void enterBtn_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.searchControl.Text) || this._competitors == null || this._competitors.CompetitorDatas == null || this._competitors.CompetitorDatas.Count <= 0) { return; } var selectedCompotitor = this._competitors.CompetitorDatas.FirstOrDefault(p => p.Bib == this.listView1.SelectedItems[0].Text); this._bib_text.Text = selectedCompotitor.Bib; this._currentEzd.Image = ReopositoryEzdFile.UpdateEzdApi(selectedCompotitor, this._currentEzd.Width, this._currentEzd.Height); }
private void RunBtn_Click(object sender, EventArgs e) { var btn = (SimpleButton)sender; if (doWorkTest) { doWorkTest = false; } if (btn.Text == "RUN") { if (XtraMessageBox.Show("Вы действительно хотите гравировать?", "Сообщения", MessageBoxButtons.YesNo) == DialogResult.Yes) { doWorkRun = true; if (!runBackgroundWorker.IsBusy) { runBackgroundWorker.RunWorkerAsync(); btn.Text = "STOP"; btn.Appearance.BackColor = Color.FromArgb(192, 0, 0); this.testBtn.Enabled = false; this.testBtn.Cursor = Cursors.No; } else { XtraMessageBox.Show("Гравировка уже идет", "Information", MessageBoxButtons.OK); } } } else { doWorkRun = false; ReopositoryEzdFile.StopMark(); btn.Text = "RUN"; btn.Appearance.BackColor = Color.FromArgb(0, 192, 192); this.testBtn.Enabled = true; this.testBtn.Cursor = Cursors.No; } }
private async void OkSimpleButton_Click(object sender, EventArgs e) { try { var task = await Queries.GetRequestAsync( $@"http://openeventor.ru/api/event/{CurrentApiData.Token}/get_competitor/bib/{this.searchTextEdit.Text}"); this._competitor = JsonConvert.DeserializeObject <Competitor>(task); string filesPath = Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName) + @"\files\"; ReopositoryEzdFile.LoadImage($@"{filesPath}{this._currentEzd.Properties.NullText}"); this._currentEzd.Image = ReopositoryEzdFile.UpdateEzdApi(_competitor.CompetitorData, this._currentEzd.Width, this._currentEzd.Height); } catch (Exception ex) { XtraMessageBox.Show("Данные с этим номером не найдены", "Information", MessageBoxButtons.OK); } }
private void RunBackgroundWorker_DoWork(object sender, DoWorkEventArgs e) { ReopositoryEzdFile.Mark(); }