title: get a recursive file list sorted alphabetically by subdirs and filenames
body: <p>i tried to get a file list sorted, without sucess.</p>
  
  <p>it gets the files recursively but without any order.</p>
  
  <p>here's the code:</p>
  
  <pre><code>private void Step2_Load(object sender, EventArgs e)
  {
      foreach (string file in GetFiles(PathClient))
      {
          string flist = "";
          if (file.Contains(PathClient + "\\"))
              flist = file.Replace(PathClient + "\\", "");
          else
               flist = file.Replace(PathClient, "");
  
           LB_FULL.Items.Add(flist);
      }
  .
  .
  .
  
  static IEnumerable&lt;string&gt; GetFiles(string path)
  {
      Queue&lt;string&gt; queue = new Queue&lt;string&gt;();
      queue.Enqueue(path);
      while (queue.Count &gt; 0)
      {
          path = queue.Dequeue();
          try
          {
              foreach (string subDir in Directory.GetDirectories(path))
                  queue.Enqueue(subDir);
          }
          catch (Exception ex)
          {
              //ex
          }
          string[] files = null;
          try
          {
              files = Directory.GetFiles(path);
          }
          catch (Exception ex)
          {
              //ex
          }
          if (files != null)
          {
              for (int i = 0; i &lt; files.Length; i++)
              {
                  yield return files[i];
              }
          }
      }
  }
  </code></pre>
  
  <p>i've tried with OrderBy, but it only sorts by filename, regardless of the subfolder.</p>
  
  <p>i want to sort it by subfolder first, then by filename.</p>
  
  <p>for ex.</p>
  
  <pre><code>/
  /file_a.bla
  /file_b.bla
  /file_c.bla
  /sub1/file_a.bla
  /sub1/file_b.bla
  /sub2/_file_x.bla
  /testsub/a.bla
  ...
  </code></pre>
  
  <p>and so on.</p>
  
  <p>any ideas how to manage it?</p>