Пример #1
0
        /// <summary>
        /// Загрузка настроек из файла
        /// </summary>
        public static void LoadSetting()
        {
            try
            {
                BinaryFormatter binFormat1 = new BinaryFormatter();

                using (Stream fStream1 = File.OpenRead(Filesetting1))
                {
                    AppSetting = (SettingAPP)binFormat1.Deserialize(fStream1);
                }

                using (Stream fStream2 = File.OpenRead(Filesetting2))
                {
                    ControllerSetting = (SettingController)binFormat1.Deserialize(fStream2);
                }

                using (Stream fStream3 = File.OpenRead(Filesetting3))
                {
                    RenderSetting = (SettingRender)binFormat1.Deserialize(fStream3);
                }

                using (Stream fStream4 = File.OpenRead(Filesetting4))
                {
                    PanelSetting = (SettingPanels)binFormat1.Deserialize(fStream4);
                }
            }
            catch (Exception)
            {
                //throw;
            }
        }
Пример #2
0
        /// <summary>
        /// Загрузка настроек из файла
        /// </summary>
        public static void LoadSetting()
        {
            try
            {
                BinaryFormatter binFormat1 = new BinaryFormatter();

                using (Stream fStream1 = File.OpenRead(Filesetting1))
                {
                    AppSetting = (SettingAPP)binFormat1.Deserialize(fStream1);
                }

                using (Stream fStream2 = File.OpenRead(Filesetting2))
                {
                    ControllerSetting = (SettingController)binFormat1.Deserialize(fStream2);
                }

                using (Stream fStream3 = File.OpenRead(Filesetting3))
                {
                    RenderSetting = (SettingRender)binFormat1.Deserialize(fStream3);
                }

                using (Stream fStream4 = File.OpenRead(Filesetting4))
                {
                    PanelSetting = (SettingPanels)binFormat1.Deserialize(fStream4);
                }
            }
            catch (Exception)
            {
                //throw;
            }
        }