Beispiel #1
0
        private void SettingsToUI()
        {
            AppOptSettings appSettings = AppOptSettings.Load();

            if (appSettings != null)
            {
                if (appSettings.ShutcutKeys != null)
                {
                    tb_Buy_Sell1.Text  = appSettings.ShutcutKeys.Buy_On_Sell1.ToString();
                    tb_Sell_Buy1.Text  = appSettings.ShutcutKeys.Sell_On_Buy1.ToString();
                    tb_Buy_Buy1.Text   = appSettings.ShutcutKeys.Buy_On_Buy1.ToString();
                    tb_Sell_Sell1.Text = appSettings.ShutcutKeys.Sell_On_Sell1.ToString();

                    tb_CancelOrder.Text      = appSettings.ShutcutKeys.CancelOrder.ToString();
                    tb_CloseAllPosition.Text = appSettings.ShutcutKeys.CloseAllPosition.ToString();

                    tb_NormalSpeedPlay.Text = appSettings.ShutcutKeys.NormalSpeedPlay.ToString();
                }
            }
        }
Beispiel #2
0
        private void UIToSettings()
        {
            AppOptSettings appSettings = new AppOptSettings();

            appSettings.ShutcutKeys = new ShutcutKeySettings();
            if (!String.IsNullOrEmpty(tb_Buy_Sell1.Text))
            {
                appSettings.ShutcutKeys.Buy_On_Sell1 = (Keys)Enum.Parse(typeof(Keys), tb_Buy_Sell1.Text);
            }
            if (!String.IsNullOrEmpty(tb_Buy_Buy1.Text))
            {
                appSettings.ShutcutKeys.Buy_On_Buy1 = (Keys)Enum.Parse(typeof(Keys), tb_Buy_Buy1.Text);
            }

            if (!String.IsNullOrEmpty(tb_Sell_Sell1.Text))
            {
                appSettings.ShutcutKeys.Sell_On_Sell1 = (Keys)Enum.Parse(typeof(Keys), tb_Sell_Sell1.Text);
            }
            if (!String.IsNullOrEmpty(tb_Sell_Buy1.Text))
            {
                appSettings.ShutcutKeys.Sell_On_Buy1 = (Keys)Enum.Parse(typeof(Keys), tb_Sell_Buy1.Text);
            }
            if (!String.IsNullOrEmpty(tb_CancelOrder.Text))
            {
                appSettings.ShutcutKeys.CancelOrder = (Keys)Enum.Parse(typeof(Keys), tb_CancelOrder.Text);
            }
            if (!String.IsNullOrEmpty(tb_CloseAllPosition.Text))
            {
                appSettings.ShutcutKeys.CloseAllPosition = (Keys)Enum.Parse(typeof(Keys), tb_CloseAllPosition.Text);
            }

            if (!String.IsNullOrEmpty(tb_NormalSpeedPlay.Text))
            {
                appSettings.ShutcutKeys.NormalSpeedPlay = (Keys)Enum.Parse(typeof(Keys), tb_NormalSpeedPlay.Text);
            }

            appSettings.Save();
        }
Beispiel #3
0
 public void LoadAppSetting()
 {
     AppSetting = AppOptSettings.Load();
 }