Пример #1
0
        /// <summary>Removes the file.</summary>
        /// <param name="mdbFile">The MDB file.</param>
        public void RemoveFile(MDBFile mdbFile)
        {
            if (Files.Exist(mdbFile.ID))
            {
                Files.Delete(mdbFile.ID);
            }

            this.LogInfo("Removed file '<red>{0}<default>'", mdbFile.Name);
            if (mdbFile.IsImage)
            {
                foreach (MDBImage imageFile in Images.GetStructs(nameof(MDBImage.FileID), mdbFile.ID))
                {
                    Images.Delete(imageFile.FileID);
                    this.LogInfo("Removed image file <red>{0}", imageFile);
                }
            }
            else
            {
                foreach (MDBAudioFile audioFile in AudioFiles.GetStructs(nameof(MDBAudioFile.FileID), mdbFile.ID))
                {
                    AudioFiles.Delete(audioFile.FileID);
                    this.LogInfo("Removed audio file <red>{0}", audioFile);
                }
            }
        }