Exemplo n.º 1
0
 private void btnInsertFragment_Click(object sender, System.EventArgs e)
 {
     FragmentDeCod = GetFragmentDeCod();
     if (FragmentDeCod != null)
     {
         DialogResult = System.Windows.Forms.DialogResult.Yes;
         Close();
     }
 }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
 private void btnNewFragment_Click(object sender, System.EventArgs e)
 {
     txtAutor.Text = txtCodSursa.Text = txtTitlu.Text = "";
     txtCodSursa.SourceTextBox.Invalidate();
     txtCodSursa.Invalidate();
     _selectedSnippet = null;
 }
Exemplo n.º 4
0
        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;
        }