Esempio n. 1
0
        public void SerializeDirectory(WzDirectory dir, string outPath)
        {
            total = dir.CountImages();
            curr  = 0;

            if (!Directory.Exists(outPath))
            {
                WzXmlSerializer.createDirSafe(ref outPath);
            }

            if (outPath.Substring(outPath.Length - 1, 1) != @"\")
            {
                outPath += @"\";
            }

            foreach (WzDirectory subdir in dir.WzDirectories)
            {
                SerializeDirectory(subdir, outPath + subdir.Name + @"\");
            }

            foreach (WzImage img in dir.WzImages)
            {
                SerializeImage(img, outPath + img.Name);
            }
        }
Esempio n. 2
0
        public void SerializeObject(WzObject obj, string outPath)
        {
            //imagesToUnparse.Clear();
            total        = 0; curr = 0;
            this.outPath = outPath;
            if (!Directory.Exists(outPath))
            {
                WzXmlSerializer.createDirSafe(ref outPath);
            }
            if (outPath.Substring(outPath.Length - 1, 1) != @"\")
            {
                outPath += @"\";
            }
            total = CalculateTotal(obj);
            ExportRecursion(obj, outPath);

            /*foreach (WzImage img in imagesToUnparse)
             *  img.UnparseImage();
             * imagesToUnparse.Clear();*/
        }