private void btnInsertFragment_Click(object sender, System.EventArgs e) { FragmentDeCod = GetFragmentDeCod(); if (FragmentDeCod != null) { DialogResult = System.Windows.Forms.DialogResult.Yes; Close(); } }
private void btnDeleteFragment_Click(object sender, System.EventArgs e) { if (_selectedSnippet == null) return; Res.Instance.IdsFragmenteDeCod.Remove(_selectedSnippet.Id); Res.Instance.FragmenteDeCodHolder.FragmenteDeCod.Remove(_selectedSnippet); listaCodeSnippets.Items.Remove(listaCodeSnippets.SelectedItems[0]); txtAutor.Text = txtCodSursa.Text = txtTitlu.Text = ""; txtCodSursa.SourceTextBox.Invalidate(); txtCodSursa.Invalidate(); _selectedSnippet = null; }
private void btnNewFragment_Click(object sender, System.EventArgs e) { txtAutor.Text = txtCodSursa.Text = txtTitlu.Text = ""; txtCodSursa.SourceTextBox.Invalidate(); txtCodSursa.Invalidate(); _selectedSnippet = null; }
private void listaCodeSnippets_SelectedIndexChanged(object sender, System.EventArgs e) { if (listaCodeSnippets.SelectedItems.Count == 0 || !(listaCodeSnippets.SelectedItems[0] is CustomListViewItem<FragmentDeCod>)) return; txtCodSursa.Text = ""; txtCodSursa.Refresh(); FragmentDeCod fragment = (listaCodeSnippets.SelectedItems[0] as CustomListViewItem<FragmentDeCod>).CustomStruct; _selectedSnippet = fragment; txtTitlu.Text = fragment.Titlu; txtCodSursa.Text = fragment.CodSursa; txtAutor.Text = fragment.Autor; }