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

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


                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)
                {
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Ошибка серилизации");
            }
        }
Пример #3
0
        private void DeSerial()
        {
            try
            {
                string md = Environment.GetFolderPath(Environment.SpecialFolder.Personal);//путь к Документам

                FileStream fs = new FileStream(md + "\\UranSetUp\\" + "ClassOtborNeutron.dat", FileMode.Open);
                try
                {
                    BinaryFormatter bf = new BinaryFormatter();
                    otb = (ClassOtborNeutron)bf.Deserialize(fs);
                    fs.Close();
                }
                catch (SerializationException)
                {
                    System.Windows.MessageBox.Show("ошибка");
                    fs.Close();
                }
                finally
                {
                    fs.Close();
                }

                Bak.InstCol();


                FileStream fs1 = new FileStream(md + "\\UranSetUp\\" + "setting.dat", FileMode.Open);
                try
                {
                    BinaryFormatter bf1 = new BinaryFormatter();
                    set = (UserSetting)bf1.Deserialize(fs1);
                }
                catch (SerializationException)
                {
                    System.Windows.MessageBox.Show("ошибка");
                }
                finally
                {
                    fs1.Close();
                }
                try
                {
                    XmlSerializer xs = new XmlSerializer(typeof(ObservableCollection <Bak>));
                    using (StreamReader wr = new StreamReader(md + "\\UranSetUp\\" + "setting1.xml"))
                    {
                        Bak._DataColec1 = (ObservableCollection <Bak>)xs.Deserialize(wr);
                        wr.Close();
                    }
                }
                catch (Exception)
                {
                }
            }
            catch (Exception)
            {
                System.Windows.MessageBox.Show("Ошибка серилизации");
            }
        }
Пример #4
0
        private void Button_Click_4(object sender, RoutedEventArgs e)
        {
            object f   = listNoTail100.SelectedItem;
            Bak    bak = (Bak)f;

            int xx = Bak._DataColec1.IndexOf(bak);

            Bak.DelKl100(xx);

            listNoTail100.ItemsSource = Bak._DataColecBAAK100;
        }
Пример #5
0
        private void Button_Click_3(object sender, RoutedEventArgs e)
        {
            AddKl100 winAddKl100 = new AddKl100();

            if (winAddKl100.ShowDialog() == true)
            {
                Bak.AddKl100(winAddKl100.Name2, winAddKl100.IP, winAddKl100.NameB);

                listNoTail100.ItemsSource = Bak._DataColecBAAK100;
            }
            else
            {
            }
        }
Пример #6
0
        private void DeSerial()
        {
            Bak.InstCol();
            string     md = Environment.GetFolderPath(Environment.SpecialFolder.Personal);//путь к Документам
            FileStream fs = new FileStream(md + "\\UranSetUp\\" + "setting.dat", FileMode.Open);

            BinaryFormatter bf = new BinaryFormatter();

            set = (UserSetting)bf.Deserialize(fs);



            fs.Close();
        }
Пример #7
0
        private void Button_Click_4(object sender, RoutedEventArgs e)
        {
            object f   = listNoTail.SelectedItem;
            Bak    bak = (Bak)f;

            int xx = Bak._DataColec1.IndexOf(bak);

            Bak.DelKl(xx);
            var BakGroups2 = from user in Bak._DataColec1
                             where user.BAAK12NoT == true
                             orderby user.KLIP
                             select user;

            listNoTail.ItemsSource = BakGroups2.ToList();
        }
Пример #8
0
        private void Button_Click_3(object sender, RoutedEventArgs e)
        {
            PageAddKlNoTail winAddKl1 = new PageAddKlNoTail();

            if (winAddKl1.ShowDialog() == true)
            {
                Bak.AddKl(winAddKl1.Name2, winAddKl1.IP, winAddKl1.NameB, true);
                var BakGroups2 = from user in Bak._DataColec1
                                 where user.BAAK12NoT == true
                                 orderby user.KLIP
                                 select user;
                listNoTail.ItemsSource = BakGroups2.ToList();
            }
            else
            {
            }
        }
Пример #9
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            AddKl winAddKl = new AddKl();

            if (winAddKl.ShowDialog() == true)
            {
                Bak.AddKl(winAddKl.Name2, winAddKl.IP, winAddKl.NameB, winAddKl.BAAK12NoTail);
                var BakGroups1 = from user in Bak._DataColec1
                                 where user.BAAK12NoT == false
                                 orderby user.KLIP
                                 select user;
                list1.ItemsSource = BakGroups1.ToList();
            }
            else
            {
            }
        }
Пример #10
0
        private void DeSerial()
        {
            try
            {
                Bak.InstCol();
                ClassTestRan.InstCol();
                string     md = Environment.GetFolderPath(Environment.SpecialFolder.Personal);//путь к Документам
                FileStream fs = new FileStream(md + "\\UranSetUp\\" + "setting.dat", FileMode.Open);
                try
                {
                    BinaryFormatter bf = new BinaryFormatter();
                    set = (UserSetting)bf.Deserialize(fs);
                }
                catch (SerializationException)
                {
                    System.Windows.MessageBox.Show("ошибка");
                }
                finally
                {
                    fs.Close();
                }

                try
                {
                    XmlSerializer xs1 = new XmlSerializer(typeof(ObservableCollection <ClassTestRan>));
                    using (StreamReader wr1 = new StreamReader(md + "\\UranSetUp\\" + "ClassTestRanSetting1.xml"))
                    {
                        ClassTestRan._DataColec2 = (ObservableCollection <ClassTestRan>)xs1.Deserialize(wr1);
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("Ошибка серилизации настроек тестового набора");
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Ошибка серилизации общих настроик");
            }
        }