예제 #1
0
        void OpenProperties()
        {
            FRMWinClassicAddressBookNewContact abnc = new FRMWinClassicAddressBookNewContact();

            // Finds the selected contact
            if (treeView1.SelectedNode != null)
            {
                foreach (AddressBookContactList ContactList in AddressBookObjects)
                {
                    if (ContactList.NodePath == FindNodePath(treeView1.SelectedNode))
                    {
                        foreach (AddressBookContact Contact in ContactList.Contacts)
                        {
                            if (contactsView.FocusedItem == null)
                            { // Most likely they are trying to view a whole folder!
                                wm.StartInfobox95("Properties of a folder", "You cannot view the properties of a contact folder.", InfoboxType.Warning, InfoboxButtons.OK);
                            }
                            else
                            {
                                if ((Contact.FirstName + " " + Contact.MiddleName + " " + Contact.LastName) == contactsView.FocusedItem.Text)
                                {
                                    abnc.toSet = Contact;
                                }
                            }
                        }
                    }
                }
                WinClassic app = wm.Init(abnc, "Address Book - Contact Properties", Properties.Resources.Win95IconWordpad, true, true, true);

                if (treeView1.SelectedNode != null)
                {
                    if (Program.AddressBookSelectedContact != null)
                    {
                        foreach (AddressBookContactList ContactList in AddressBookObjects)
                        {
                            if (ContactList.NodePath == FindNodePath(treeView1.SelectedNode))
                            {
                                foreach (AddressBookContact Contact in ContactList.Contacts)
                                {
                                    if ((Contact.FirstName + " " + Contact.MiddleName + " " + Contact.LastName) == contactsView.FocusedItem.Text)
                                    {
                                        ContactList.Contacts.Remove(Contact);
                                        ContactList.Contacts.Add(Program.AddressBookSelectedContact);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
예제 #2
0
        void OpenProperties()
        {
            FRMWinClassicAddressBookNewContact abnc = new FRMWinClassicAddressBookNewContact();

            // Finds the selected contact
            if (treeView1.SelectedNode != null)
            {
                foreach (AddressBookContactList ContactList in AddressBookObjects)
                {
                    if (ContactList.AttachedNode == treeView1.SelectedNode.Text)
                    {
                        foreach (AddressBookContact Contact in ContactList.Contacts)
                        {
                            if ((Contact.FirstName + " " + Contact.MiddleName + " " + Contact.LastName) == contactsView.FocusedItem.Text)
                            {
                                abnc.toSet = Contact;
                            }
                        }
                    }
                }
                WinClassic app = wm.StartWin95(abnc, "Address Book - Contact Properties", Properties.Resources.Win95IconWordpad, true, true, true);

                if (treeView1.SelectedNode != null)
                {
                    if (Program.AddressBookSelectedContact != null)
                    {
                        foreach (AddressBookContactList ContactList in AddressBookObjects)
                        {
                            if (ContactList.AttachedNode == treeView1.SelectedNode.Text)
                            {
                                foreach (AddressBookContact Contact in ContactList.Contacts)
                                {
                                    if ((Contact.FirstName + " " + Contact.MiddleName + " " + Contact.LastName) == contactsView.FocusedItem.Text)
                                    {
                                        ContactList.Contacts.Remove(Contact);
                                        ContactList.Contacts.Add(Program.AddressBookSelectedContact);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
예제 #3
0
        void NewContact()
        {
            FRMWinClassicAddressBookNewContact abnc = new FRMWinClassicAddressBookNewContact();
            WinClassic app = wm.StartWin95(abnc, "Address Book - New Contact", Properties.Resources.Win95IconWordpad, true, true, true);

            if (treeView1.SelectedNode != null)
            {
                if (Program.AddressBookSelectedContact != null)
                {
                    foreach (AddressBookContactList ContactList in AddressBookObjects)
                    {
                        if (ContactList.AttachedNode == treeView1.SelectedNode.Text)
                        {
                            ContactList.Contacts.Add(Program.AddressBookSelectedContact);
                            contactsView.Items.Add(Program.AddressBookSelectedContact.FirstName + " " + Program.AddressBookSelectedContact.MiddleName + " " + Program.AddressBookSelectedContact.LastName);
                        }
                    }
                }
            }
        }