// 打开文件。 public static bool Open(string fileName) { bool result = true; #if !DEBUG try #endif { _Package = Package.OpenFromFile(fileName, out IPackageContent packageContent); _PhylogeneticTree = new PhylogeneticTree(); packageContent.TranslateTo(_PhylogeneticTree); } #if !DEBUG catch { _PhylogeneticTree = new PhylogeneticTree(); _Package?.Close(); _Package = Package.CreateNew(); result = false; } #endif return(result); }
// // 新建文件。 public static bool New() { _PhylogeneticTree = new PhylogeneticTree(); _Package = Package.CreateNew(); return(true); }