internal void Render(List <int> columnsWidth, int elementIndex, int listViewX, int listViewY)
 {
     for (int i = 0; i < columns.Length; i++)
     {
         Console.BackgroundColor = ConsoleColor.DarkRed;
         Console.CursorTop       = elementIndex + listViewY;
         Console.CursorLeft      = listViewX + columnsWidth.Take(i).Sum();
         Console.WriteLine(ListViewFunc.GetStringWithLenght(columns[i], columnsWidth[i]));
     }
 }
        private void View_Find1(object sender, EventArgs e)
        {
            var    listView = (ListView)sender;
            string request  = UserVoid();

            if (request.Length == 0)
            {
                return;
            }

            List <FileInfo>      fileRez = ListViewFunc.FindListOfFiles(new DirectoryInfo(listView.CurrentState.ToString()), request);
            List <DirectoryInfo> dirRez  = ListViewFunc.FindListOfDirectories(new DirectoryInfo(listView.CurrentState.ToString()), request);

            Console.SetCursorPosition(1, 25);
            Console.WriteLine("                                                                                               ");
            listView.Clean();
            listView.Items = GetItems(view.CurrentState.ToString());
        }
 private static List <ListViewItem> GetItems(string path)
 {
     return(new DirectoryInfo(path).GetFileSystemInfos().Select(f =>
                                                                new ListViewItem(
                                                                    f,
                                                                    f.Name,
                                                                    f is DirectoryInfo ? "<dir>" : f.Extension,
                                                                    f is FileInfo file ? ListViewFunc.GetSizeofFile(file) : " ")).ToList());
 }