Esempio n. 1
0
        // 打开文件。
        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);
        }
Esempio n. 2
0
        //

        // 新建文件。
        public static bool New()
        {
            _PhylogeneticTree = new PhylogeneticTree();

            _Package = Package.CreateNew();

            return(true);
        }