Esempio n. 1
0
        public ArbitrageBetService()
        {/*
          * try
          * {
          *     CefSharp.CefSettings settings = new CefSharp.CefSettings();
          *     settings.LogSeverity = CefSharp.LogSeverity.Error;
          *    // settings.BrowserSubprocessPath = System.IO.Path.Combine(cefPath, "CefSharp.BrowserSubprocess.exe");
          *     CefSharp.Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null);
          * }catch(Exception ex) { Console.WriteLine(ex.Message); }
          */
            finder = new ArbitrageFinder();

            Marathonbet    marathonbet = new Marathonbet();
            LeonBets       leon        = new LeonBets();
            OlimpBookmaker olimp       = new OlimpBookmaker();

            //    TitanBet titan = new TitanBet();

            finder.AddBookmaker(marathonbet);
            finder.AddBookmaker(leon);
            finder.AddBookmaker(olimp);
            //  finder.AddBookmaker(titan);
            //   var newForks = finder.GetForks();

            try
            {
                //Thread thread = new Thread();
                task = Task.Factory.StartNew(() =>
                {
                    try
                    {
                        while (true)
                        {
                            // Console.WriteLine("here");
                            var newForks = finder.GetForks();

                            lock (lockobj)
                            {
                                forkList = newForks;
                            }
                            // Thread.Sleep(1000);
                        }
                    } catch (Exception ex) { Console.WriteLine(ex); }
                }, CancellationToken.None, TaskCreationOptions.LongRunning, TaskScheduler.Default);

                //  task.Start();
            } catch (Exception ex) { Console.WriteLine(ex.Message); }

            task.ContinueWith((e) => Console.WriteLine("closed"));
        }
Esempio n. 2
0
        public AutoBetting(ObservableCollection <MatchParserModel> Tabs)
        {
            parsersDict.Add(Bookmaker.Marathonbet, new Marathonbet());
            parsersDict.Add(Bookmaker.Leon, new LeonBets());
            parsersDict.Add(Bookmaker.Olimp, new OlimpBookmaker());

            foreach (var parser in parsersDict.Values)
            {
                arbitrageFinder.AddBookmaker(parser);
            }

            this.Tabs = Tabs;
        }