private void EditText(object sender, MouseEventArgs e) { if (!points.ContainsKey(NowTimePoint)) { return; } GetStringDialog getString = new GetStringDialog(mw, "", "", ""); if (getString.ShowDialog() == true) { TextBlock tb = cText.Children[lbText.SelectedIndex] as TextBlock; tb.Text = getString.mString; points[NowTimePoint].Texts[lbText.SelectedIndex].Value = getString.mString; ((DataContext as FrameUserControlViewModel).Model.ListBoxData as ObservableCollection <dynamic>)[lbText.SelectedIndex] = getString.mString; } }
private void NewText(object sender, MouseEventArgs e) { GetStringDialog getString = new GetStringDialog(mw, "", "", ""); if (getString.ShowDialog() == true) { TextBlock tb = new TextBlock() { Text = getString.mString, Foreground = StaticConstant.brushList[nowColor], }; if (points.ContainsKey(NowTimePoint)) { points[NowTimePoint].Texts.Add(new FramePointModel.Text() { Value = getString.mString, Point = new Point(0, 0) }); } else { points.Add(NowTimePoint, new FramePointModel() { Value = NowTimePoint, Texts = new List <FramePointModel.Text>() { new FramePointModel.Text() { Value = getString.mString, Point = new Point(0, 0) } } }); } Canvas.SetLeft(tb, 0); Canvas.SetTop(tb, 0); cText.Children.Add(tb); ((DataContext as FrameUserControlViewModel).Model.ListBoxData as ObservableCollection <dynamic>).Add(getString.mString); } }
private void btnNewLngFile_Click(object sender, EventArgs e) { GetStringDialog getStringDialog = new GetStringDialog(string.Empty, "Add"); getStringDialog.ShowDialog(); if (getStringDialog.DialogResult == DialogResult.OK) { string g = Guid.NewGuid().ToString(); if (_dataProcessor.InsertCardList(g, getStringDialog.TextValue) > 0) { listFiles.Items.Add(getStringDialog.TextValue, g); } } }
private void btnEditCardListName_Click(object sender, EventArgs e) { if (isSingleCardListIsSelected()) { ListViewItem selected = listFiles.SelectedItems[0]; GetStringDialog getStringDialog = new GetStringDialog(selected.Text, "Add"); getStringDialog.ShowDialog(); if (getStringDialog.DialogResult == DialogResult.OK) { if (getStringDialog.TextValue != selected.Text) { int i = _dataProcessor.daCardList.UpdateName(getStringDialog.TextValue, DateTime.Now, selected.ImageKey); if (i > 0) selected.Text = getStringDialog.TextValue; } } } }