Example #1
0
        public void Load(string filename)
        {
            FileInfo = new FileInfo(filename);
            var imgFilename = Path.Combine(Path.GetDirectoryName(filename), Path.GetFileNameWithoutExtension(filename) + ".img");

            if (FileInfo.Exists)
            {
                _format = new DDTIMG(FileInfo.OpenRead(), File.OpenRead((imgFilename)));
            }
        }
Example #2
0
        public bool Identify(string filename)
        {
            var imgFilename = Path.Combine(Path.GetDirectoryName(filename), Path.GetFileNameWithoutExtension(filename) + ".img");

            if (!File.Exists(filename) || !File.Exists(imgFilename))
            {
                return(false);
            }

            try
            {
                var tmp = new DDTIMG(File.OpenRead(filename), File.OpenRead((imgFilename)));
                tmp.Close();
                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }