Ejemplo n.º 1
0
        private void ScanStop(ScanningType st, bool self)
        {
            string end = string.Empty;

            if (self)
            {
                end = "завершено";
            }
            else
            {
                end = "остановлено пользователем";
            }

            switch (st)
            {
            case ScanningType.AddNewSigns:
            {
                addsg.ScanStop();
                while (addsg.IsScanning)
                {
                }
                ms.write_lview_message("Сообщение", "Добавление новых сигнатур " + end, Color.GhostWhite, 3, listView_trace);
            }

            break;

            case ScanningType.CheckSigns:
            {
                srch.ScanStop();
                while (srch.IsScanning)
                {
                }
                ms.write_lview_message("Сообщение", "Сканирование " + end, Color.GhostWhite, 3, listView_trace);
            }
            break;

            default:
                break;
            }

            ms.set_tlabel_property(toolStripStatusLabelScanCnt, count_files.ToString(), "Text");
            ms.set_btn_property(button_begin_scan_add_sign, true, "Enabled");
            ms.set_tbtn_property(toolStripButtonStart, false, "Checked");
            ms.set_tbtn_property(toolStripButtonStart, true, "Enabled");
            ms.set_tbtn_property(toolStripButtonStart, "Начать сканирование", "ToolTipText");

            ms.set_tbtn_property(toolStripButtonPause, false, "Checked");
            ms.set_tbtn_property(toolStripButtonPause, true, "Enabled");
            ms.set_tbtn_property(toolStripButtonPause, "Приостановить сканирование", "ToolTipText");

            ms.set_tbtn_property(toolStripButtonStop, false, "Checked");

            ms.set_fte_property(folderTreeExploer, true, "Enabled");

            ms.set_num_ud_property(numericUpDownMax, true, "Enabled");
            ms.set_num_ud_property(numericUpDownMin, true, "Enabled");

            ms.set_tlabel_property(toolStripStatusLabelScanFile, "(idle)", "Text");
        }
Ejemplo n.º 2
0
        //Начать сканирование. Только здесь, в этой функции, условия учитываются и выполняются
        private void ScanStart(ScanningType st)
        {
            count_files      = 0;
            count_copy_files = 0;
            ms.set_tbtn_property(toolStripButtonStart, false, "Enabled");
            ms.set_tbtn_property(toolStripButtonStart, "Идет сканирование", "ToolTipText");

            ms.set_tbtn_property(toolStripButtonPause, false, "Checked");
            ms.set_tbtn_property(toolStripButtonPause, "Приостановить сканирование", "ToolTipText");

            ms.set_tbtn_property(toolStripButtonStop, false, "Checked");


            ms.set_fte_property(folderTreeExploer, false, "Enabled");

            ms.set_num_ud_property(numericUpDownMax, false, "Enabled");
            ms.set_num_ud_property(numericUpDownMin, false, "Enabled");

            ms.set_tlabel_property(toolStripStatusLabelScanCnt, count_files.ToString(), "Text");

            switch (st)
            {
            case ScanningType.AddNewSigns:
            {
                //ms.write_lview_message("Сообщение", "Добавление новых сигнатур запущено", Color.GhostWhite, 1, listView_trace);

                //ms.set_tbtn_property(toolStripButtonStart, false, "Checked");
                //ms.set_tbtn_property(toolStripButtonPause, false, "Enabled");
                //ms.set_tbtn_property(toolStripButtonStop, false, "Enabled");
            }
            break;

            case ScanningType.CheckSigns:
            {
                srch.FileSizeMax = (long)Math.Truncate((decimal)ms.get_num_up_down_property(numericUpDownMax, "Value"));
                srch.FileSizeMin = (long)Math.Truncate((decimal)ms.get_num_up_down_property(numericUpDownMin, "Value"));

                ms.write_lview_message("Сообщение", "Сканирование запущено", Color.GhostWhite, 1, listView_trace);

                ms.set_tbtn_property(toolStripButtonStart, true, "Checked");
                ms.set_tbtn_property(toolStripButtonPause, true, "Enabled");
                ms.set_tbtn_property(toolStripButtonStop, true, "Enabled");

                srch.ScanFiles(folderTreeExploer.SelectedFolders);
                //tabControl.SelectedTab = tabPageFirst;
            }
            break;

            default:
                break;
            }

            ms.set_tlabel_property(toolStripStatusLabelScanCnt, count_files.ToString(), "Text");
            ScanStop(st, true);
            ms.write_lview_message("Сканировано", "Файлов: " + count_files.ToString(), Color.DodgerBlue, 5, listView_trace);
            ms.write_lview_message("Скопировано", "Файлов: " + count_copy_files.ToString(), Color.DodgerBlue, 5, listView_trace);
        }
 internal void Start()
 {
     if (this._ibetEngine != null && this._ibetEngine.ibetAgent.State == AgentState.Running)
     {
         this._ibetEngine.Start();
         if (this._sbobetEngine == null || this._sbobetEngine.sboAgent.State != AgentState.Running)
         {
             if (this._ibetEngine.ibetAgent2.State == AgentState.Running)
             {
                 scantype = ScanningType.ibetVSibet;
                 this.lblStatus.Caption = "RUNNING IB vs IB";
             }
             else
             {
                 scantype = ScanningType.ibet;
                 this.lblStatus.Caption = "RUNNING IB STRG";
             }
         }
         else
         {
             scantype = ScanningType.both;
             this.lblStatus.Caption = "RUNNING BOTH";
         }
     }
     if (this._sbobetEngine != null && this._sbobetEngine.sboAgent.State == AgentState.Running)
     {
         this._sbobetEngine.Start();
         if (this._ibetEngine == null || this._ibetEngine.ibetAgent.State != AgentState.Running)
         {
             scantype = ScanningType.sbo;
             this.lblStatus.Caption = "RUNNING SB STRG";
         }
         else
         {
             scantype = ScanningType.both;
             this.lblStatus.Caption = "RUNNING BOTH";
         }
     }
     this._running = true;
     this._forceRefreshTimer.Start();
     this._creditRefreshTimer.Start();
     if (checkEdit10.Checked)
     {
         //this._matchesRefreshTimer.Start();
     }
     
     this.btnStart.Enabled = false;
     this.btnStop.Enabled = true;
     this.btnClear.Enabled = true;
     this.btnSnapShot.Enabled = true;
     this.btnIbetGetInfo.Enabled = false;
     this.btnSbobetGetInfo.Enabled = false;
 }
        public TerminalFormIBETSBO(MainForm mainForm, string currentUserID, int formCount)
        {
            

            this.InitializeComponent();
            List<BetAgentConfig> agents = ConfigurationInstance<BetEngineConfiguration>.GetConfig().Agents;
            this.config = agents[formCount];
            
            
            //list.Add("55640842");
            //Thread thread = new Thread((ThreadStart)(() =>
            //{
            //    this.engineManager = new BetEngineManager();
            //    List<string> list = new List<string>();
            //    this.engineManager.Start(list);
            //}));
            //thread.Start();
            this.scantype = new ScanningType();
            this._ibetMatchs = new Dictionary<string, IbetMatch>();
            this._ibetMatchsSnapShot = new Dictionary<string, IbetMatch>();
            this._sboMatchs = new Dictionary<string, SboMatch>(); 

            this._mainForm = mainForm;
            this._dataService = new App.admin.DataServiceSoapClient();
            this._dataService.AllowRunCompleted += new System.EventHandler<iBet.App.admin.AllowRunCompletedEventArgs>(this._dataService_AllowRunCompleted);
            this._currentUserID = currentUserID;
            this._forceRefreshTimer = new System.Windows.Forms.Timer();
            this._forceRefreshTimer.Interval = 180000;
            this._forceRefreshTimer.Tick += new System.EventHandler(this._forceRefreshTimer_Tick);

            this._creditRefreshTimer = new System.Windows.Forms.Timer();
            this._creditRefreshTimer.Interval = 180000;
            this._creditRefreshTimer.Tick += new System.EventHandler(this._creditRefreshTimer_Tick);

            this._matchesRefreshTimer = new System.Windows.Forms.Timer();
            this._matchesRefreshTimer.Interval = 60000;
            this._matchesRefreshTimer.Tick += new System.EventHandler(this._matchesRefreshTimer_Tick);

            this._oddTransactionHistory = new System.Collections.Generic.Dictionary<string, string>();
            this._listTransaction = new System.Collections.Generic.List<TransactionDTO>();
            this.grdTransaction.DataSource = this._listTransaction;
            this._listSameMatch = new System.Collections.Generic.List<MatchDTO>();
            this.grdSameMatch.DataSource = this._listSameMatch;
            this.listBA = new List<BetAnalyse>();
            this.bl = new List<Bet>();
            this.girdBetList1.DataSource = this.bl;





            //MatchDTO match = new MatchDTO();
            //match.HomeTeamName = "Test Home Team";
            //match.AwayTeamName = "Another Away Team";
            //match.HomeScore = "0";
            //match.AwayScore = "0";
            //match.Minute = 28;
            //match.Half = 1;
            //match.KickOffTime = "20/10 13:41 Live!";
            //match.League = new LeagueDTO();
            //match.League.Name = "Ein Element mit dem gleichen Schlüssel".ToUpper();

            //MatchDTO match2 = new MatchDTO();
            //match2.HomeTeamName = "Test Home Team";
            //match2.AwayTeamName = "Another Away Team";
            //match2.HomeScore = "0";
            //match2.AwayScore = "0";
            //match2.Minute = 28;
            //match2.Half = 1;
            //match2.KickOffTime = "20/10 13:43";
            //match2.League = new LeagueDTO();
            //match2.League.Name = "Ein Element mit dem gleichen Schlüssel".ToUpper();

            //this._listSameMatch.Add(match); this._listSameMatch.Add(match);
            //this._listSameMatch.Add(match); this._listSameMatch.Add(match);
            //this._listSameMatch.Add(match); this._listSameMatch.Add(match);
            //this._listSameMatch.Add(match); this._listSameMatch.Add(match);
            //this._listSameMatch.Add(match2); this._listSameMatch.Add(match2); this._listSameMatch.Add(match2);
            //this._listSameMatch.Add(match2); this._listSameMatch.Add(match2); this._listSameMatch.Add(match2);
            //this._listSameMatch.Add(match2); this._listSameMatch.Add(match2);
            //this.gridView1.RefreshData();
        }
Ejemplo n.º 5
0
        private void ScanStop(ScanningType st, bool self)
        {
            string end = string.Empty;

            if (self)
            {
                end = "завершено";
            }
            else
            {
                end = "остановлено пользователем";
            }

            switch (st)
            {
            case ScanningType.AddNewSigns:
            {
            }

            break;

            case ScanningType.CheckSigns:
            {
                srch.ScanStop();
                while (srch.IsScanning)
                {
                }
                ms.write_lview_message("Сообщение", "Сканирование " + end, Color.GhostWhite, 3, listView_trace);
            }
            break;

            default:
                break;
            }

            ms.set_tlabel_property(toolStripStatusLabelScanCnt, count_files.ToString(), "Text");
            ms.set_tbtn_property(toolStripButtonStart, false, "Checked");
            ms.set_tbtn_property(toolStripButtonStart, true, "Enabled");
            ms.set_tbtn_property(toolStripButtonStart, "Начать сканирование", "ToolTipText");

            ms.set_tbtn_property(toolStripButtonPause, false, "Checked");
            ms.set_tbtn_property(toolStripButtonPause, true, "Enabled");
            ms.set_tbtn_property(toolStripButtonPause, "Приостановить сканирование", "ToolTipText");

            ms.set_tbtn_property(toolStripButtonStop, false, "Checked");

            ms.set_fte_property(folderTreeExploer, true, "Enabled");

            ms.set_num_ud_property(numericUpDownMax, true, "Enabled");
            ms.set_num_ud_property(numericUpDownMin, true, "Enabled");

            ms.set_tlabel_property(toolStripStatusLabelScanFile, "(idle)", "Text");

            //что делать после бекапа
            switch ((int)ms.get_ComboBox_property(comboBox_set_dt, "SelectedIndex"))
            {
            case 0:
            {
                //ничего не делать
            }
            break;

            case 1:
            {
                //установить время
                ms.set_dt_p_property(dateTimePicker_datePrev, DateTime.Now, "Value");      //1
                ms.set_dt_p_property(dateTimePickerTimePrev, DateTime.Now, "Value");       //1

                ms.set_dt_p_property(dateTimePickerDateFwd, DateTime.Now, "Value");        //-1
                ms.set_dt_p_property(dateTimePickerTimeFwd, DateTime.Now, "Value");        //-1
            }
            break;
            //case 2:
            //    {
            //        //установить время и сохранить файл настроек
            //        ms.set_dt_p_property(dateTimePicker_datePrev, DateTime.Now.AddDays(1), "Value");
            //        ms.set_dt_p_property(dateTimePickerTimePrev, DateTime.Now.AddDays(1), "Value");

            //        ms.set_dt_p_property(dateTimePickerDateFwd, DateTime.Now.AddDays(-1), "Value");
            //        ms.set_dt_p_property(dateTimePickerTimeFwd, DateTime.Now.AddDays(-1), "Value");

            //        SaveSettToFile();
            //    }
            //    break;
            default:
                break;
            }
        }