private long InsertFileData(FileStream dvdfileStream, WDevFile file, out long length, out bool isCompuress)
        {
            var read = file.fileInfo.OpenRead();

            byte[] data = new byte[read.Length];

            long postion = dvdfileStream.Position;

            length = 0;

            if (read.Read(data, 0, data.Length) == read.Length)
            {
                data = DevFile.Compress(data, out isCompuress);

                dvdfileStream.Write(data, 0, data.Length);

                length = data.Length;

                return(postion);
            }
            else
            {
                isCompuress = false;
                return(-1);
            }
        }
        public void AddDirectory(string path)
        {
            List <string> files = new List <string>();

            var dirinfo = new DirectoryInfo(path);

            if (!dirinfo.Exists)
            {
                throw new FileNotFoundException("File Not Find:" + path);
            }

            GetFile(dirinfo, files);



            foreach (var item in files)
            {
                FileInfo file = new FileInfo(item);

                string pathx = file.DirectoryName.Substring(dirinfo.Parent.FullName.Length, file.DirectoryName.Length - dirinfo.Parent.FullName.Length);

                if (pathx[0] != '/' || pathx[0] != '\\')
                {
                    pathx = "/" + pathx;
                }

                if (pathx[pathx.Length - 1] != '/' || pathx[pathx.Length - 1] != '\\')
                {
                    pathx = pathx + "/";
                }

                if (string.IsNullOrEmpty(pathx))
                {
                    pathx = "/";
                }

                string PathByPack = pathx.Replace("\\", "/");

                PathByPack = PathByPack.Replace("//", "/");


                WDevFile tmp = new WDevFile(file.Name, PathByPack, file.FullName);

                if (WFileList.Find(p => p.FileName == file.Name && p.Path == PathByPack) == null)
                {
                    WFileList.Add(tmp);
                }
            }
        }
        public void AddFile(string fullFileName, string PathByPack)
        {
            if (string.IsNullOrEmpty(PathByPack))
            {
                PathByPack = "/";
            }

            PathByPack = PathByPack.Replace("\\", "/");

            FileInfo file = new FileInfo(fullFileName);

            if (!file.Exists)
            {
                throw new FileNotFoundException("File not find:" + fullFileName);
            }

            WDevFile tmp = new WDevFile(file.Name, PathByPack, file.FullName);

            if (WFileList.Find(p => p.FileName == file.Name && p.Path == PathByPack) == null)
            {
                WFileList.Add(tmp);
            }
        }