예제 #1
0
        public ActionResult Tree(string id, string name, string path)
        {
            ViewBag.ID = id;
            if (!String.IsNullOrEmpty(id))
            {
                bool download = false;
                if (path != null)
                {
                    if (path.EndsWith(".browse"))
                    {
                        path = path.Substring(0, path.Length - 7);
                    }
                    else if (path.EndsWith(".download"))
                    {
                        path     = path.Substring(0, path.Length - 9);
                        download = true;
                    }
                }
                path = path != null?path.Replace(".browse", "") : null;

                using (var browser = new RepositoryBrowser(Path.Combine(UserConfigurationManager.Repositories, id)))
                {
                    string branchName;
                    var    files = browser.Browse(name, path, out branchName);
                    PopulateBranchesData(browser, branchName);
                    PopulateAddressBarData(name, path);
                    return(DisplayFiles(files, path, id, download));
                }
            }
            return(View());
        }
 public ActionResult Tree(string id, string name, string path)
 {
     ViewBag.ID = id;
     if (!String.IsNullOrEmpty(id))
     {
         bool download = false;
         if (path != null)
         {
             if (path.EndsWith(".browse"))
             {
                 path = path.Substring(0, path.Length - 7);
             }
             else if (path.EndsWith(".download"))
             {
                 path = path.Substring(0, path.Length - 9);
                 download = true;
             }
         }
         path = path != null ? path.Replace(".browse", "") : null;
         using (var browser = new RepositoryBrowser(Path.Combine(UserConfigurationManager.Repositories, id)))
         {
             string branchName;
             var files = browser.Browse(name, path, out branchName);
             PopulateBranchesData(browser, branchName);
             PopulateAddressBarData(name, path);
             return DisplayFiles(files, path, id, download);
         }
     }
     return View();
 }