示例#1
0
 private void add_umk_Click(object sender, EventArgs e)
 {
     win_add_umk window_umk = new win_add_umk();
     System.Collections.ObjectModel.Collection<string> return_lst = new System.Collections.ObjectModel.Collection<string>();
     System.Collections.ObjectModel.Collection<string> return_lst1 = new System.Collections.ObjectModel.Collection<string>();
     System.Collections.ObjectModel.Collection<string> return_lst2 = new System.Collections.ObjectModel.Collection<string>();
     cls_main main_func = new cls_main();
      window_umk.change_vars(umk_folder);
     window_umk.ShowDialog();
     //if (window_umk.selected_path != "")
     //{
         if (window_umk.selected_level == 2)
         {
             //if (if_cell_ISexists(2, window_umk.selected_path + "\\" + window_umk.selected_obj) != true)
             //{
                 string[] row1 = { window_umk.selected_obj, main_func.get_value_from_infofile(umk_folder + "\\" + window_umk.selected_path + "\\" + window_umk.selected_obj + "\\info.dat", "code"), window_umk.selected_path + "\\" + window_umk.selected_obj };
                 dg_prj_files.Rows.Add(row1);
             //}
         }
         else
         {
             if (window_umk.selected_level == 0)
             {
                 return_lst.Clear();
                 return_lst1.Clear();
                 return_lst = main_func.get_dir(umk_folder +  window_umk.selected_path + "\\" + window_umk.selected_obj);
                 if (return_lst.Count > 0)
                 {
                     for (int i = 0; i < return_lst.Count; i++)
                     {
                         return_lst1 = main_func.get_dir(umk_folder +  window_umk.selected_path + "\\" + window_umk.selected_obj + "\\" + return_lst[i]);
                         if (return_lst1.Count > 0)
                         {
                             for (int j = 0; j < return_lst1.Count; j++)
                             {
                                 //if (if_cell_ISexists(2,  window_umk.selected_obj + "\\" + return_lst[i] + "\\" + return_lst1[j]) != true)
                                 //{
                                     string[] row1 = { return_lst1[j], main_func.get_value_from_infofile(umk_folder + window_umk.selected_path + "\\" + window_umk.selected_obj + "\\" + return_lst[i] + "\\" + return_lst1[j] + "\\info.dat", "code"),  window_umk.selected_obj + "\\" + return_lst[i] + "\\" + return_lst1[j] };
                                     dg_prj_files.Rows.Add(row1);
                                 //}
                             }
                         }
                     }
                 }
             }
             else
             {
                 return_lst.Clear();
                 return_lst = main_func.get_dir(umk_folder + "\\" + window_umk.selected_path + "\\" + window_umk.selected_obj);
                 if (return_lst.Count > 0)
                 {
                     for (int i = 0; i < return_lst.Count; i++)
                     {
                         //if (if_cell_ISexists(2,  window_umk.selected_path + "\\" + window_umk.selected_obj + "\\" + return_lst[i]) != true)
                         //{
                             string[] row1 = { return_lst[i], main_func.get_value_from_infofile(umk_folder + "\\" + window_umk.selected_path + "\\" + window_umk.selected_obj + "\\" + return_lst[i] + "\\info.dat", "code"), window_umk.selected_path + "\\" + window_umk.selected_obj + "\\" + return_lst[i] };
                             dg_prj_files.Rows.Add(row1);
                         //}
                     }
                 }
             }
         }
     //}
     update_level_files(selected_level);
 }
示例#2
0
 private void add_umk_files_Click(object sender, EventArgs e)
 {
     win_add_umk window_umk = new win_add_umk();
        System.Collections.ObjectModel.Collection<string> return_lst = new System.Collections.ObjectModel.Collection<string>();
        System.Collections.ObjectModel.Collection<string> return_lst1 = new System.Collections.ObjectModel.Collection<string>();
        System.Collections.ObjectModel.Collection<string> return_lst2 = new System.Collections.ObjectModel.Collection<string>();
        cls_main main_func = new cls_main();
        window_umk.change_vars(umk_folder);
        window_umk.ShowDialog();
        if (window_umk.selected_path != "")
        {
        /*if (window_umk.selected_level == 3)
        {
            string[] row1 = { window_umk.selected_obj, "файл", window_umk.selected_path + "\\" };
            dg_prj_files.Rows.Add(row1);
        }*/
        if (window_umk.selected_level == 2)
        {
            string[] row1 = { window_umk.selected_obj, "папка", window_umk.selected_path + "\\" };
            //dg_prj_files.Rows.Add(row1);
        }
        else
        {
            if (window_umk.selected_level == 0)
            {
                return_lst.Clear();
                return_lst1.Clear();
                return_lst = main_func.get_dir(window_umk.selected_path + "\\" + window_umk.selected_obj);
                if (return_lst.Count > 0)
                {
                    for (int i = 0; i < return_lst.Count; i++)
                    {
                        return_lst1 = main_func.get_dir(window_umk.selected_path + "\\" + window_umk.selected_obj + "\\" + return_lst[i]);
                        if (return_lst1.Count > 0)
                        {
                            for (int j = 0; j < return_lst1.Count; j++)
                            {
                                string[] row1 = { return_lst1[j], "папка", window_umk.selected_path + "\\" + window_umk.selected_obj + "\\" + return_lst[i] + "\\"};
                                //dg_prj_files.Rows.Add(row1);
                            }
                        }
                    }
                }
            }
            else
            {
                return_lst.Clear();
                return_lst = main_func.get_dir(window_umk.selected_path + "\\" + window_umk.selected_obj);
                if (return_lst.Count > 0)
                {
                    for (int i = 0; i < return_lst.Count; i++)
                    {
                        string[] row1 = { return_lst[i], "папка", window_umk.selected_path + "\\" + window_umk.selected_obj + "\\" };
                        //dg_prj_files.Rows.Add(row1);
                    }
                }
            }
        }
        }
 }