コード例 #1
0
        public void Initialize()
        {
            string filePath = System.IO.Path.GetFullPath(Utils.GetAppDirectory() + "\\Settings\\Base.xml");

            _settingData = new SettingData();
            if (System.IO.File.Exists(filePath))
            {
                XmlSerializer serializer = new XmlSerializer(typeof(SettingData));
                using (System.IO.StreamReader reader = new System.IO.StreamReader(filePath, Encoding.UTF8))
                {
                    _settingData = (SettingData)serializer.Deserialize(reader);
                    reader.Close();
                }
            }

            TextBoxNiconicoMailAddress.Text = _settingData.NiconicoMailaddress;
            PasswordNiconico.Password       = _settingData.NiconicoPassword;
            CheckBoxRunningStart.IsChecked  = _settingData.AutoRun;
            LoadCommunities();

            if (_settingData.AutoRun)
            {
                NiconicoAlertStart();
            }
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: noto0648/Namalert
        public void Initialize()
        {
            string filePath = System.IO.Path.GetFullPath(Utils.GetAppDirectory() + "\\Settings\\Base.xml");
            _settingData = new SettingData();
            if (System.IO.File.Exists(filePath))
            {
                XmlSerializer serializer = new XmlSerializer(typeof(SettingData));
                using (System.IO.StreamReader reader = new System.IO.StreamReader(filePath, Encoding.UTF8))
                {
                    _settingData = (SettingData)serializer.Deserialize(reader);
                    reader.Close();
                }
            }

            TextBoxNiconicoMailAddress.Text = _settingData.NiconicoMailaddress;
            PasswordNiconico.Password = _settingData.NiconicoPassword;
            CheckBoxRunningStart.IsChecked = _settingData.AutoRun;
            LoadCommunities();

            if(_settingData.AutoRun)
            {
                NiconicoAlertStart();
            }
        }