Beispiel #1
0
        public bool Save(Node node, string targetLocation)
        {
            ArchiveType at = ArchiveUtil.FindCompatibleArchiveType(targetLocation);

            if (at == ArchiveType.None)
            {
                return(false);
            }

            IArchive arc = ArchiveUtil.CreateArchive(at);

            if (arc == null)
            {
                return(false);
            }

            return(arc.SaveTo(node, targetLocation));
        }
Beispiel #2
0
        public Node Load(string targetLocation)
        {
            ArchiveType at = ArchiveUtil.FindCompatibleArchiveType(targetLocation);

            if (at == ArchiveType.None)
            {
                Logging.Instance.Log("No compatible archive found.");
                return(null);
            }

            Logging.Instance.Log("Creating archive '{0}'", at);
            IArchive arc = ArchiveUtil.CreateArchive(at);

            if (arc == null)
            {
                Logging.Instance.Log("CreateArchive() failed.");
                return(null);
            }

            return(arc.LoadFrom(targetLocation));
        }