Exemplo n.º 1
0
        public static ObjectLibrary LoadObject(string fileName)
        {
            if (fileName == null)
                throw new ArgumentNullException("fileName");

            using (Stream stream = File.OpenRead(fileName))
            using (BinaryReader reader = new BinaryReader(stream))
            {
                ObjectLibrary library = new ObjectLibrary();

                var context = FileFormats.Omf.OmfLoader.LoadObject(reader);
                ObjectModule module = LoadObject(context);
                library.Modules.Add(module);

                library.AssignIdsToSegments();
                library.FileName = fileName;
                return library;
            }
        }