Ejemplo n.º 1
0
 public MainForm()
 {
     InitializeComponent();
     DoubleBuffered = true;
     SetStyle(ControlStyles.ResizeRedraw, true);
     _itemsSrorage = new ItemsSrorage();
 }
Ejemplo n.º 2
0
        private void Load()  //load
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter = "XML files (*.xml)|*.xml";
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                XmlSerializer serializer = new XmlSerializer(typeof(ItemsSrorage));

                using (FileStream fs = new FileStream(ofd.FileName, FileMode.Open))
                {
                    _itemsSrorage = (ItemsSrorage)serializer.Deserialize(fs);
                }
            }
        }