コード例 #1
0
        private void FileInList_Click(object sender, EventArgs e)
        {
            File     file     = (sender as Border).Tag as File;
            FileEdit fileEdit = new FileEdit(file);

            if (fileEdit.ShowDialog() == true)
            {
                if (fileEdit.Deleted)
                {
                    controller.Delete(file);
                }
                else
                {
                    controller.UpdateFile(fileEdit.tbxDescription.Text.Trim(), file);
                }
                Refresh();
            }
            if (fileEdit.ShowDialog() == true)
            {
                controller.UpdateFile(fileEdit.tbxDescription.Text.Trim(), file);
            }
            Refresh();
        }
コード例 #2
0
        private void LstFiles_MouseDoubleClick(object sender, EventArgs e)
        {
            ListBox lbx = sender as ListBox;

            if (lbx.SelectedItem != null)
            {
                File     file     = lbx.SelectedItem as File;
                FileEdit fileEdit = new FileEdit(file);
                if (fileEdit.ShowDialog() == true)
                {
                    if (fileEdit.Deleted)
                    {
                        controller.Delete(file);
                    }
                    else
                    {
                        controller.UpdateFile(fileEdit.tbxDescription.Text, file);
                    }
                    Refresh();
                }
            }
        }