Example #1
0
        public bool Identify(string filename)
        {
            try
            {
                FileInfo = new FileInfo(filename);
                var file2 = Path.Combine(Path.GetDirectoryName(filename), Path.GetFileNameWithoutExtension(filename) + ".viw");
                var file3 = Path.Combine(Path.GetDirectoryName(filename), Path.GetFileNameWithoutExtension(filename));

                if (Path.GetExtension(filename) != ".inf")
                {
                    FileInfo = new FileInfo(Path.Combine(Path.GetDirectoryName(filename), Path.GetFileNameWithoutExtension(filename) + ".inf"));
                }

                if (FileInfo.Exists && File.Exists(file2) && File.Exists(file3))
                {
                    _viw = new VIW(FileInfo.OpenRead(), File.OpenRead(file2), File.OpenRead(file3));
                }
                _viw.Close();
                return(true);
            }
            catch (Exception)
            {
                if (_viw != null)
                {
                    _viw.Close();
                }
                return(false);
            }
        }
Example #2
0
        public void Load(string filename)
        {
            FileInfo = new FileInfo(filename);
            var file2 = Path.Combine(Path.GetDirectoryName(filename), Path.GetFileNameWithoutExtension(filename) + ".inf");
            var file3 = Path.Combine(Path.GetDirectoryName(filename), Path.GetFileNameWithoutExtension(filename));

            if (FileInfo.Exists && File.Exists(file2) && File.Exists(file3))
            {
                _viw = new VIW(FileInfo.OpenRead(), File.OpenRead(file2), File.OpenRead(file3));
            }
        }