Ejemplo n.º 1
0
        public static LibraryData AddBaseLib(LibraryData oldLib)
        {
            LibraryData lb = new LibraryData();

            FileInfo precompFile = new FileInfo("Base.LibraryData");

            if (!precompFile.Exists)
            {
                MessageBox.Show("Unable to load baselibrary. Base.LibraryData File not found.");
                return(oldLib);
            }

            IFormatter formatter = new BinaryFormatter();
            Stream     stream    = precompFile.OpenRead();

            try
            {
                lb.Join((LibraryData)formatter.Deserialize(stream));
                lb.JoinNew(oldLib);
                stream.Close();
            }
            catch (Exception err)
            {
                stream.Close();

                MessageBox.Show("Error parsing library.");
                return(oldLib);
            }

            return(lb);
        }