/// <summary> /// Create a new project file and object /// </summary> /// <param name="file">Path to the project file</param> /// <returns>Read to use Project object</returns> private static BlamLib.CheApe.Project Create(string file) { BlamLib.CheApe.Project proj = new BlamLib.CheApe.Project(BlamVersion.Halo2, file); Managers.FileManager fm = new Managers.FileManager(file); fm.CreateForWrite(); fm.Manage(proj); fm.Write(); fm.Close(); return(new ProjectState(proj).Project); }
/// <summary> /// Open an existing project file /// </summary> /// <param name="file">Path to the project file</param> /// <returns>Project using data loaded from <paramref name="file"/></returns> private static BlamLib.CheApe.Project Open(string file) { BlamLib.CheApe.Project proj = new BlamLib.CheApe.Project(BlamVersion.Halo1_CE, file); Managers.FileManager fm = new Managers.FileManager(file); fm.OpenForRead(); fm.Manage(proj); fm.Read(); fm.Close(); return(new ProjectState(proj).Project); }
/// <summary> /// Create a new project file and object /// </summary> /// <param name="file">Path to the project file</param> /// <returns>Read to use Project object</returns> private static BlamLib.CheApe.Project Create(string file) { BlamLib.CheApe.Project proj = new BlamLib.CheApe.Project(BlamVersion.Halo2, file); Managers.FileManager fm = new Managers.FileManager(file); fm.CreateForWrite(); fm.Manage(proj); fm.Write(); fm.Close(); return new ProjectState(proj).Project; }
/// <summary> /// Open an existing project file /// </summary> /// <param name="file">Path to the project file</param> /// <returns>Project using data loaded from <paramref name="file"/></returns> private static BlamLib.CheApe.Project Open(string file) { BlamLib.CheApe.Project proj = new BlamLib.CheApe.Project(BlamVersion.Halo2, file); Managers.FileManager fm = new Managers.FileManager(file); fm.OpenForRead(); fm.Manage(proj); fm.Read(); fm.Close(); return new ProjectState(proj).Project; }