Beispiel #1
0
 public bool Save()
 {
     try
     {
         UserCodeSetInstance.SaveStyleToFile();
         UserCodeSet userCodeSet   = cbUserCodeSet.SelectedItem as UserCodeSet;
         string      userCodeSetId = null;
         if (userCodeSet != null)
         {
             userCodeSetId = userCodeSet.Id;
         }
         TradeDataClient.GetClientInstance().getMainWindow().uscHangqing.ResetBlockButtons();
         //JYDataServer.getServerInstance().getMainWindow().userCodeSetBar.ResetUserCodeSetButtons(userCodeSetId);
         IsUpdated = true;
         return(true);
     }
     catch (Exception ex)
     {
         Util.Log(ex.ToString());
         return(false);
     }
 }
        private void btnReportSetting_Click(object sender, RoutedEventArgs e)
        {
            ChooseContract chooseContract = new ChooseContract();

            chooseContract.DataContext = this._MainWindow;
            Window codeSetWindow = CommonUtil.GetWindow("合约设置", chooseContract, _MainWindow);

            codeSetWindow.Closed += new EventHandler(codeSetWindow_Closed);
            ObservableCollection <UserCodeSet> lstUserCodeSet = UserCodeSetInstance.GetUserCodeSetList();
            int         i           = 0;
            UserCodeSet userCodeSet = null;

            foreach (var item in lstUserCodeSet)
            {
                userCodeSet = item as UserCodeSet;
                if (defaultButton != null && defaultButton.Content.ToString() == userCodeSet.Name)
                {
                    break;
                }
                i += 1;
            }
            chooseContract.cbUserCodeSet.SelectedIndex = i;
            codeSetWindow.ShowDialog();
        }