예제 #1
0
        private void UpdateList(object sender, EventArgs e)
        {
            try
            {
                view.GetSetlistView.Items.Clear();

                ImageList images = new ImageList();
                images.ImageSize = new Size(25, 25);

                images.Images.Add(Properties.Resources.imageFile);
                images.Images.Add(Properties.Resources.imageFolder);

                view.GetSetlistView.LargeImageList = images;

                var Directories = new Forms.Folder(view.getTextBox1).GetDirectories();
                var files       = new Forms.Folder(view.getTextBox1).Get_Files_In_Selected_Folder();

                foreach (var dir in Directories)
                {
                    ListViewItem listview = new ListViewItem();
                    listview.ImageIndex = 1;
                    var name_Of_File_Or_Directory = new Forms.Folder(dir.ToString()).GetName();
                    listview.Text = name_Of_File_Or_Directory.ToString();
                    listview.Tag  = "directory";
                    view.GetSetlistView.Items.Add(listview);
                }

                foreach (var file in files)
                {
                    ListViewItem listView = new ListViewItem();
                    listView.ImageIndex = 0;
                    var name_Of_File_Or_Directory = new Forms.Folder(file.ToString()).GetName();
                    listView.Text = name_Of_File_Or_Directory.ToString();
                    listView.Tag  = "file";
                    view.GetSetlistView.Items.Add(listView);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Ошибка.");
                view.getTextBox1 = "";
                OutputDisks(sender, e);
            }
        }
예제 #2
0
        }//Статистика текстового файла.

        public void Open_Or_Go(object sender, EventArgs e)
        {
            var Path_Selected_Item = new Forms.Folder("").Combine(view.getTextBox1, view.GetSetlistView.SelectedItems[0].Text);
            var Ext_Selected_Item  = new Forms.Folder(Path_Selected_Item).GetExtension();

            if (Ext_Selected_Item != ".zip")
            {
                try
                {
                    if (Ext_Selected_Item == "")
                    {
                        view.getTextBox1 = Path_Selected_Item;
                        UpdateList(sender, e);
                    }
                    else
                    {
                        new Forms.File("").Start(Path_Selected_Item);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else
            {
                Forms.ZipFolder zipFolder = new Forms.ZipFolder(Path_Selected_Item);
                var             files     = zipFolder.GetAllFiles();

                foreach (var file in files)
                {
                    ListViewItem listView = new ListViewItem();
                    listView.ImageIndex = 0;
                    var name_Of_File_Or_Directory = new Forms.Folder(file.ToString()).GetName();
                    listView.Text = name_Of_File_Or_Directory.ToString();
                    listView.Tag  = "file";
                    view.GetSetlistView.Items.Add(listView);
                }
            }
        }