Exemplo n.º 1
0
        void cae_FormClosed(object sender, FormClosedEventArgs e)
        {
            ContactAddEdit cae = sender as ContactAddEdit;

            if (cae.getContact() != null)
            {
                if (Contacts.Contains(cae.getPrevContact()))
                {
                    Contacts.RemoveAt(Contacts.IndexOf(cae.getPrevContact()));
                }
                Contacts.Add(cae.getContact());
            }

            string vCards = "";

            foreach (Contact c in Contacts)
            {
                vCards += c.getVCard();
            }
            StreamWriter stream = new StreamWriter(Globals.PathContacts, false);

            stream.Write(vCards);
            stream.Close();

            gvContacts.RefreshData();
        }
Exemplo n.º 2
0
        private void edytujToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ContactAddEdit cae = new ContactAddEdit(Contacts[gvContacts.GetFocusedDataSourceRowIndex()]);

            cae.FormClosed += cae_FormClosed;
            cae.Show();
        }
Exemplo n.º 3
0
        private void btnAddContact_Click(object sender, EventArgs e)
        {
            ContactAddEdit conae = new ContactAddEdit();

            conae.FormClosed += cae_FormClosed;
            conae.Show();
        }