private void ListBox2_SelectedIndexChanged(object sender, RoutedEventArgs e)//event of publication list
        {
            List <database.researcher> rlist = (ResearcherList.generate_R_list());

            if (list2.SelectedIndex != -1)
            {
                // MessageBox.Show(list2.SelectedIndex.ToString());

                tbk1.Text = PublicationDetail.Pdetail(P_list[list2.SelectedIndex].doi.ToString(), publication_list); //bug fixed

                tab_m.SelectedIndex = 3;                                                                             //auto jump to tab 2
            }
        }
        private void invert_Click(object sender, RoutedEventArgs e)
        {
            // list2.Items.Refresh();
            if (list2.Items.Count > 0)//listbox is not empty
            {
                List <database.researcher> rlist = (ResearcherList.generate_R_list());



                // PublicationList.additemt_p_listbox(list2, tmp_list);
                //P_list = tmp_list;
                //list2.ItemsSource = P_list;
                // invert_control = false;

                if (invert_control == true)//click once invert,click twice resume
                {
                    //list2.Items.Clear();
                    //tmp_list = PublicationList.sort_P_list(P_list, Convert.ToInt32(cbo1.SelectedItem), Convert.ToInt32(cbo2.SelectedItem), true);
                    // PublicationList.additemt_p_listbox(list2, tmp_list);

                    P_list = PublicationList.sort_P_list(P_list, 1900, 2100, true);
                    // tmp_list = P_list;
                    list2.ItemsSource = P_list;
                    list2.Items.Refresh();
                    // P_list = tmp_list;
                    invert_control = false;
                }
                else
                {
                    //list2.Items.Clear();
                    P_list = PublicationList.sort_P_list(P_list, 1900, 2100, false);
                    // PublicationList.additemt_p_listbox(list2, tmp_list);

                    //  tmp_list = P_list;
                    list2.ItemsSource = P_list;
                    list2.Items.Refresh();
                    invert_control = true;
                }
            }
            else
            {
                MessageBox.Show("Publication list is empty ");
            }
        }