Пример #1
0
        public void RefreshTable(Library.Library results)
        {
            BindingSource source = new BindingSource();

            source.DataSource        = results;
            dataGridView1.DataSource = source;
        }
Пример #2
0
        private void topMenuOpen_Click(object sender, EventArgs e)
        {
            OpenFileDialog opener = new OpenFileDialog();

            if (opener.ShowDialog() == DialogResult.OK)
            {
                Stream          file       = File.Open(opener.FileName, FileMode.Open);
                BinaryFormatter bFormatter = new BinaryFormatter();
                Library.Library lib        = (Library.Library)bFormatter.Deserialize(file);
                file.Close();
                Program.BookLibrary = lib;
                RefreshTable();
                Enable();
            }
        }