Example #1
0
        private void BuildDataFromFoldersV1(DirectoryInfo directoryInfo)
        {
            string dir = directoryInfo.FullName.Replace(help.GetUntilOrEmpty(directoryInfo.FullName, "Data"), "");

            RSDKv1.DataFile.DirInfo dirinfo = new RSDKv1.DataFile.DirInfo();

            dir.Replace("\\", "/");

            dirinfo.Directory = dir + "/";

            if (directoryInfo.GetFiles().Length > 0)
            {
                Datav1.Directories.Add(dirinfo);
                DirID++;
            }

            foreach (FileInfo file in directoryInfo.GetFiles())
            {
                RSDKv1.DataFile.FileInfo File = new RSDKv1.DataFile.FileInfo();

                File.DirID        = (byte)(DirID - 1);
                File.FullFileName = file.FullName.Replace(help.GetUntilOrEmpty(file.FullName, "Data"), "");

                RSDKv1.Reader reader = new RSDKv1.Reader(file.FullName);

                File.Filedata = reader.ReadBytes(reader.BaseStream.Length);
                File.fileSize = (uint)reader.BaseStream.Length;

                reader.Close();

                File.FileName = Path.GetFileName(file.FullName);

                Datav1.Files.Add(File);
            }

            foreach (DirectoryInfo subdir in directoryInfo.GetDirectories())
            {
                BuildDataFromFoldersV1(subdir);
            }
        }
Example #2
0
 public void Setup(RSDKv1.DataFile.FileInfo file)
 {
     Dataver          = 1;
     FileDatav1       = file;
     FileNameBox.Text = FileDatav1.FileName;
 }