Tinkr2/4.2/AphelionCore/AphelionCommonControls/Controls/Filebox.cs
/// <summary>
/// Gets all directories and files from <see cref="FilePath"/> and sets them as items in a sorted order
/// </summary>
Gets all directories and files from  and sets them as items in a sorted order
Gets all directories and files from and sets them as items in a sorted order
public void UpdateItems()
      {
         if (_path == null || !Directory.Exists(_path))
         {
            RequiredHeight = 0;
            _items = null;
            return;
         }
         try
         {
            int i;
            int c = 0;
            string[] s = new StringSorter(Directory.GetDirectories(_path)).InsensitiveSort();
            _items = new ItemData[s.Length + Directory.GetFiles(_path).Length];
            for (i = 0; i < s.Length; i++)
            {
               _items[c++] = new ItemData(s[i].Substring(s[i].LastIndexOf('\\') + 1), "",
                  new DirectoryInfo(s[i]).LastWriteTime.ToString(), s[i], FileType.Folder);
            }
            s = new StringSorter(Directory.GetFiles(_path)).InsensitiveSort();
            for (i = 0; i < s.Length; i++)
            {
               _items[c++] = new ItemData(Path.GetFileName(s[i]), Filelen(new FileInfo(s[i]).Length),
                  new FileInfo(s[i]).LastWriteTime.ToString(), s[i], FileType.File);
            }
         }
         catch { }
         if (_items != null)
         {
            RequiredHeight = ((_items.Length + 1) * (_font.Height + 9)) + 2;
         }
      }
public void UpdateItems ( ) { if ( _path == null || ! Directory . Exists ( _path ) ) { RequiredHeight = 0 ; _items = null ; return ; } try { int i ; int c = 0 ; string [ ] s = new StringSorter ( Directory . GetDirectories ( _path ) ) . InsensitiveSort ( ) ; _items = new ItemData [ s . Length + Directory . GetFiles ( _path ) . Length ] ; for ( i = 0 ; i < s . Length ; i ++ ) { _items [ c ++ ] = new ItemData ( s [ i ] . Substring ( s [ i ] . LastIndexOf ( ' \\ ' ) + 1 ) , " " , new DirectoryInfo ( s [ i ] ) . LastWriteTime . ToString ( ) , s [ i ] , FileType . Folder ) ; } s = new StringSorter ( Directory . GetFiles ( _path ) ) . InsensitiveSort ( ) ; for ( i = 0 ; i < s . Length ; i ++ ) { _items [ c ++ ] = new ItemData ( Path . GetFileName ( s [ i ] ) , Filelen ( new FileInfo ( s [ i ] ) . Length ) , new FileInfo ( s [ i ] ) . LastWriteTime . ToString ( ) , s [ i ] , FileType . File ) ; } } catch { } if ( _items != null ) { RequiredHeight = ( ( _items . Length + 1 ) * ( _font . Height + 9 ) ) + 2 ; } }
Gets all directories and files from  and sets them as items in a sorted order
Gets all directories and files from and sets them as items in a sorted order
// ReSharper disable once EmptyGeneralCatchClause