//读取配置
        private void ReadConfig()
        {
            // bool StaringRun = Convert.ToBoolean(ConfigurationManager.AppSettings["StaringRun"]);
            bool firstRun = ClipBoardSet.Default.FirstRun;



            if (firstRun == true)
            {
                Window settingWindow = new MainWindow();
                settingWindow.Show();
                MyVariable.Variable.SettingLoaded = true;
                ClipBoardSet.Default.FirstRun     = false;
                ClipBoardSet.Default.Save();
            }
            else
            {
                this.Hide();
            }


            int index = ClipBoardSet.Default.LanguageIndex; //取语言索引

            PublicFunction.LanguageShow(index);             //设置语言
            InitializationIcon();                           //初始化托盘图标
        }
Exemple #2
0
 // private Forms.NotifyIcon NotifyIcon;
 public MainWindow()
 {
     InitializeComponent();
     SettingPlans.Children.Clear();
     SettingPlans.Children.Add(new Welcome());
     PublicFunction.LanguageShow(ClipBoardSet.Default.LanguageIndex);//根据配置文件设置用户语言
 }
Exemple #3
0
        public Gensetting()
        {
            InitializeComponent();



            CbStaringRun.IsChecked = ClipBoardSet.Default.StartUp;
            CbPlayVoice.IsChecked  = ClipBoardSet.Default.PlayVoice;

            if (ClipBoardSet.Default.VoicePath != "" && ClipBoardSet.Default.VoicePath != null)
            {
                TbVoicePath.Text = ClipBoardSet.Default.VoicePath;
            }
            else
            {
                TbVoicePath.Text = Directory.GetCurrentDirectory() + @"\sounds\lovely.wav";
                ClipBoardSet.Default.VoicePath = TbVoicePath.Text;
            }


            TbHistoryNumber.Text = ClipBoardSet.Default.HistoryNumber.ToString();
            //  MessageBox.Show(ClipBoardSet.Default.HistoryNumber.ToString());
            LanguageList.SelectedIndex = ClipBoardSet.Default.LanguageIndex;
            PublicFunction.LanguageShow(LanguageList.SelectedIndex);
        }
Exemple #4
0
        //语言选择框中语言被改变后,重载UI语言
        private void LanguageList_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ClipBoardSet.Default.LanguageIndex = LanguageList.SelectedIndex;
            ClipBoardSet.Default.Save();

            int index = LanguageList.SelectedIndex;

            PublicFunction.LanguageShow(index);
        }