예제 #1
0
        private void DeSerial()
        {
            try
            {
                Bak.InstCol();
                string md = Environment.GetFolderPath(Environment.SpecialFolder.Personal);//путь к Документам

                ClassSerilization.DeSerialUserSetting100(out set);
                try
                {
                    md = Environment.GetFolderPath(Environment.SpecialFolder.Personal);//путь к Документам
                    XmlSerializer xs = new XmlSerializer(typeof(ObservableCollection <Bak>));
                    using (StreamReader wr = new StreamReader(md + "\\UranSetUp\\" + "settingBAAK12-100.xml"))
                    {
                        Bak._DataColecBAAK100 = (ObservableCollection <Bak>)xs.Deserialize(wr);
                    }
                }
                catch (Exception)
                {
                    System.Windows.MessageBox.Show("Ошибка серилизации", "Ошибка");
                }
            }
            catch (Exception)
            {
                System.Windows.MessageBox.Show("Ошибка серилизации", "Ошибка");
            }
        }
예제 #2
0
        private void DeSerial()
        {
            try
            {
                ClassTestRan.InstCol();

                ClassSerilization.DeSerialUserSetting100(out set);

                try
                {
                    string md = Environment.GetFolderPath(Environment.SpecialFolder.Personal);//путь к Документам

                    XmlSerializer xs1 = new XmlSerializer(typeof(ObservableCollection <ClassTestRan>));
                    using (StreamReader wr1 = new StreamReader(md + "\\UranSetUp\\" + "ClassTestRanSetting100.xml"))
                    {
                        ClassTestRan._DataColec2 = (ObservableCollection <ClassTestRan>)xs1.Deserialize(wr1);
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("Ошибка серилизации настроек тестового набора");
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Ошибка серилизации общих настроик");
            }
        }
예제 #3
0
        public async Task DeSerial100()
        {
            ClassSerilization.DeSerialUserSetting100(out set);
            string md = Environment.GetFolderPath(Environment.SpecialFolder.Personal);//путь к Документам

            // using (FileStream fs = new FileStream("setting.dat", FileMode.Open))


            FileStream fs;

            try
            {
                ClassSerilization.DeSerialUserSetting100(out set);
                try
                {
                    XmlSerializer xs2 = new XmlSerializer(typeof(ObservableCollection <Bak>));
                    using (StreamReader wr = new StreamReader(md + "\\UranSetUp\\" + "settingBAAK12-100.xml"))
                    {
                        _DataColecBAAK12100 = (ObservableCollection <Bak>)xs2.Deserialize(wr);
                    }
                }
                catch (Exception ex)
                {
                }

                XmlSerializer xs1 = new XmlSerializer(typeof(ObservableCollection <ClassTestRan>));
                using (StreamReader wr1 = new StreamReader(md + "\\UranSetUp\\" + "ClassTestRanSetting100.xml"))
                {
                    _DataColecClassTestRan = (ObservableCollection <ClassTestRan>)xs1.Deserialize(wr1);
                }
            }

            catch (SerializationException)
            {
                MessageBox.Show("ошибка");
            }
            catch (Exception)
            {
                MessageBox.Show("ошибка");
            }

            finally
            {
                // fs.Close();
            }
        }
예제 #4
0
 private void DeSerial()
 {
     ClassSerilization.DeSerialUserSetting100(out set);
 }