Example #1
0
 public ConquerDatFile(string filename, DatFileType datFileType)
 {
     CurrentFilename    = filename;
     CurrentDatFileType = datFileType;
     if (FindEncryptionKeyByFileType())
     {
         Init();
     }
 }
Example #2
0
        private static string GetExt(DatFileType intf)
        {
            switch (intf)
            {
            case DatFileType.DirTorrentZip:
                return(".zip");

            case DatFileType.Dir7Zip:
                return(".7z");

            default:
                return("");
            }
        }
Example #3
0
        private static bool CheckDir(DatBase db)
        {
            DatFileType dft = db.DatFileType;

            switch (dft)
            {
            // files inside of zips/7zips do not need to be expanded
            case DatFileType.File7Zip:
            case DatFileType.FileTorrentZip:
                return(false);

            // everything else should be fully expanded
            default:
                return(true);
            }
        }
Example #4
0
        private void FileNameCombo_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.selectedComboName = this.FileNameCombo.Items[this.FileNameCombo.SelectedIndex].ToString();
            String[] TmpStr = Enum.GetNames(typeof(DatFileType));
            for (int i = 0; i < TmpStr.Length; i++)
            {
                if (this.selectedComboName.StartsWith(TmpStr[i].ToLower()))
                {
                    this.selectedFileType = (DatFileType)i;
                    break;
                }
            }

            this.Forms_Init(false);
            this.LoadBtn.Enabled = true;
            this.ImpBtn.Enabled  = true;
            this.Forms_Update();
        }
Example #5
0
        public static void CleanFilenamesFixDupes(DatDir dDir)
        {
            DatBase[]   arrDir       = dDir.ToArray();
            string      lastName     = "";
            DatFileType lastFileType = DatFileType.UnSet;
            int         matchCount   = 0;

            foreach (DatBase db in arrDir)
            {
                string      thisName = db.Name;
                DatFileType fileType = db.DatFileType;

                if (lastFileType == fileType && lastName.ToLowerInvariant() == thisName.ToLowerInvariant())
                {
                    Debug.WriteLine("Found match = " + lastName + " , " + thisName);

                    string path1 = Path.GetExtension(thisName);
                    string path0 = thisName.Substring(0, thisName.Length - path1.Length);

                    db.Name = path0 + "_" + matchCount + path1;
                    Debug.WriteLine("New filename = " + db.Name);
                    matchCount += 1;
                }
                else
                {
                    matchCount   = 0;
                    lastName     = thisName;
                    lastFileType = fileType;
                }

                if (db is DatDir ddir)
                {
                    CleanFilenamesFixDupes(ddir);
                }
            }
        }
Example #6
0
 public DatFile(DatFileType type) : base(type)
 {
 }
Example #7
0
        private void FileNameCombo_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.selectedComboName = this.FileNameCombo.Items[this.FileNameCombo.SelectedIndex].ToString();
            String[] TmpStr = Enum.GetNames(typeof(DatFileType));
            for (int i = 0; i < TmpStr.Length; i++)
            {
                if (this.selectedComboName.StartsWith(TmpStr[i].ToLower()))
                {
                    this.selectedFileType = (DatFileType)i;
                    break;
                }
            }

            this.Forms_Init(false);
            this.LoadBtn.Enabled = true;
            this.ImpBtn.Enabled = true;
            this.Forms_Update();
        }
Example #8
0
 protected DatBase(DatFileType type)
 {
     DatFileType = type;
 }
Example #9
0
 private static FileType ConvE(DatFileType inft)
 {
     return(ConvList[(int)inft]);
 }
Example #10
0
 public DatFileTypeAttribute(DatFileType fileType)
 {
     FileType = fileType;
 }