示例#1
0
 public ProjectItem this[string key]
 {
     get
     {
         return(IncludedFiles.FirstOrDefault(x => x.RelativePath == key));
     }
 }
示例#2
0
        public void RenameFile(string filepath, string oldname, string newname)
        {
            var entry = IncludedFiles.FirstOrDefault(x => x.RealPath == filepath || x.RelativePath == filepath);

            entry.RelativePath = entry.RelativePath.Replace(oldname, newname);
            entry.RealPath     = entry.RealPath.Replace(oldname, newname);
            if (entry.RealPath.EndsWith(".fitproj"))
            {
                File.Move(entry.RealPath, entry.RealPath.Remove(Runtime.CanonicalizePath(entry.RealPath).LastIndexOf(Path.DirectorySeparatorChar)) + newname + ".fitproj");
            }
            else
            {
                File.Move(filepath, entry.RealPath);
            }
            SaveProject();
        }