コード例 #1
0
 public static void CloseSolution()
 {
     Solution = null;
     Helper.EntityTreeUtil.GetBasePath = string.Empty;
     Helper.EntityTreeUtil.GetFilePath = string.Empty;
     Helper.EntityTreeUtil.UpdateDict();
 }
コード例 #2
0
 public static void CreateSolution(string aName , string aBasePath)
 {
     Solution = null;
     var filePath = Path.Combine(aBasePath, aName + "\\" + aName + ".sln");
     if (File.Exists(filePath))
         throw new Exception("文件已经存在");
     var sln = new Entity.SolutionEntity(aName);
     Helper.EntityTreeUtil.GetBasePath = Path.Combine(aBasePath, aName);
     Helper.EntityTreeUtil.UpdateDict();
     Solution = sln;
     SaveSolution();
 }
コード例 #3
0
 public static void LoadSolution(string aSlnPath)
 {
     Solution = null;
     int lastChar = aSlnPath.LastIndexOf('\\');
     using (StreamReader sr = new StreamReader(aSlnPath))
     {
         var strSln = sr.ReadToEnd();
         var sln = JsonConvert.DeserializeObject<Entity.SolutionEntity>(strSln);
         Helper.EntityTreeUtil.GetBasePath = aSlnPath.Substring(0, lastChar);
         Helper.EntityTreeUtil.GetFilePath = aSlnPath;
         Solution = sln;
         Helper.EntityTreeUtil.UpdateDict();
     }
 }