Ejemplo n.º 1
0
        private void OnBtnCustomRemove(object sender, EventArgs e)
        {
            ListView.SelectedListViewItemCollection lvsicSel = m_lvCustomIcons.SelectedItems;
            List <PwUuid> vUuidsToDelete = new List <PwUuid>();

            foreach (ListViewItem lvi in lvsicSel)
            {
                PwUuid uuidIcon = lvi.Tag as PwUuid;

                Debug.Assert(uuidIcon != null);
                if (uuidIcon != null)
                {
                    vUuidsToDelete.Add(uuidIcon);
                }
            }

            m_pwDatabase.DeleteCustomIcons(vUuidsToDelete);

            if (vUuidsToDelete.Count > 0)
            {
                m_pwDatabase.UINeedsIconUpdate = true;
                m_pwDatabase.Modified          = true;
            }

            RecreateCustomIconList(false);
            EnableControlsEx();
        }
Ejemplo n.º 2
0
        private void OnBtnCustomRemove(object sender, EventArgs e)
        {
            ListView.SelectedListViewItemCollection lvsic = m_lvCustomIcons.SelectedItems;
            if (lvsic.Count == 0)
            {
                Debug.Assert(false); return;
            }

            List <PwUuid> lDel = new List <PwUuid>();

            foreach (ListViewItem lvi in lvsic)
            {
                PwCustomIcon ci = (lvi.Tag as PwCustomIcon);
                if (ci != null)
                {
                    lDel.Add(ci.Uuid);
                }
                else
                {
                    Debug.Assert(false);
                }
            }

            m_pd.DeleteCustomIcons(lDel);
            m_pd.UINeedsIconUpdate = true;
            m_pd.Modified          = true;

            RecreateCustomIconList(PwUuid.Zero);
            EnableControlsEx();
        }