public DirectoryContents GetDirectoryWithFiles(Credentials c, MachineContents m, DirectoryIdentity did) { var cl = new Ref.FileSyncModelClient(); try { DirectoryContents newD = new DirectoryContents(did); newD.Files = cl.GetFileList(c, m, newD); cl.Close(); if (newD == null) { throw new ActionException("Received a null object.", ActionType.User); } return(newD); //DirectoryContents d = null; //d = cl.GetDirectoryWithFiles(c, m, did); //cl.Close(); //return d; } catch (ActionException ex) { cl.Abort(); throw new ActionException("Unable to download directory contents.", ActionType.Directory, MemeType.Fuuuuu, ex); } catch (Exception ex) { cl.Abort(); throw new ActionException("Error while downloading directory contents.", ActionType.Directory, MemeType.Fuuuuu, ex); } }