示例#1
0
        private void BrowserOnConsoleMessage(object sender, ConsoleMessageEventArgs consoleMessageEventArgs)
        {     
            if (isIgnoredMarket)
            {
                Console.WriteLine("[IGNORED][Bet365]Console: " + consoleMessageEventArgs.Message);
                return;
            }
            Console.WriteLine("[Bet365]Console: " + consoleMessageEventArgs.Message);
            if (consoleMessageEventArgs.Message.Contains("Mixed Content"))
            {
                isLoad = true;
                browser.LoadingStateChanged += BrowserOnLoadingStateChanged;
                browser.EvaluateScriptAsync("clickToTennis()");
                BrowserOnLoadingStateChanged(sender,new LoadingStateChangedEventArgs(null, false, false, false));
            }
            if (consoleMessageEventArgs.Message[0] == '1')
            {
                var tmp = consoleMessageEventArgs.Message.Split('|');
                var elem = tmp[1];
                var scores = JsonConvert.DeserializeObject<List<Scores>>(elem);
                var player1 = scores[0];
                var player2 = scores[1];
                var eventId = player1.name + "|" + player2.name;
                if ((!string.IsNullOrWhiteSpace(prevScoreOne)) && (!string.IsNullOrWhiteSpace(prevScoreTwo)))
                {
                    var score1 = player1.score;
                    var score2 = player2.score;
                    if (!((score1 == "0") && (score2 == "0")))
                        if (((score1 == "0") && (score1 != prevScoreOne)) || ((score2 == "0") && (score2 != prevScoreTwo)))
                            return;
                }
                foreach (var currentMarket in allMarkets.ParsingInfo.AllMarketsHashSet)
                {
                    if (!(string.IsNullOrEmpty(currentMarket.Bet365EventId)) &&(currentMarket.Bet365EventId.Equals(eventId)))
                    {
                        prevScoreOne = player1.score;
                        prevScoreTwo = player2.score;
                        currentMarket.Player1.ScoreBet366 = player1.score;
                        currentMarket.Player2.ScoreBet366 = player2.score;
                        PlayerChanged?.Invoke(new ScoreUpdEventArgs(currentMarket));
                        break;
                    }
                }
            }

            if (consoleMessageEventArgs.Message[0] == '2')
            {
                var elem = consoleMessageEventArgs.Message.Split('/');
                var tmp = elem[1].Split('|');
                if (tmp.Length == 2)
                {
                    var player1Message = tmp[0];
                    var player2Message = tmp[1];
                    MessageChanged?.Invoke(new MessagesEventArgs(TypeDBO.Bet365, player1Message, player2Message));
                    
                }

            }
        }
示例#2
0
 private void Browser_ConsoleMessageUiThreadSafe(object sender, ConsoleMessageEventArgs args)
 {
     BrowserConsole.AppendText(string.Format(
         "Line: {0} | Source: {1} | Message: {2}{3}",
         args.Line,
         args.Source,
         args.Message,
         Environment.NewLine
         ));
 }
 private void Cwb_ConsoleMessage(object sender, CefSharp.ConsoleMessageEventArgs e)
 {
     try
     {
         if (ConsoleMessageEvent != null)
         {
             //TODO: Need to fix this so we can send a string and not the ConsoleMessageEventArgs
             ConsoleMessageEvent(this, e);
         }
     }
     catch (Exception)
     {
         throw;
     }
     // Raise an Event for frmMain log
 }
示例#4
0
        private void BrowserOnConsoleMessage(object sender, ConsoleMessageEventArgs e)
        {
            if (isIgnoredMarket)
            {
                Debug.WriteLine("[IGNORED][SkyBet]Console: " + e.Message);
                return;
            }
            Debug.WriteLine("[SkyBet]Console: " + e.Message);
            if (e.Message.Contains("FINISHED"))
            {
                State = ThreadState.Stopped;
            }
            if (e.Message[0] == '1')
            {
                var tmp = e.Message.Split('|');
                var main = tmp[1];
                var scores = JsonConvert.DeserializeObject<List<Scores>>(main);

                var score1 = scores[1].score;
                var score2 = scores[2].score;
                var eventId = scores[0].eventId;
                if ((!string.IsNullOrWhiteSpace(prevScoreOne)) && (!string.IsNullOrWhiteSpace(prevScoreTwo)))
                {
                    if (!((score1 == "0") && (score2 == "0")))
                        if (((score1 == "0") && (score1 != prevScoreOne)) || ((score2 == "0") && (score2 != prevScoreTwo)))
                            return;
                }
                foreach (var currentMarket in allMarkets.ParsingInfo.AllMarketsHashSet)
                {
                    if ((!string.IsNullOrWhiteSpace(currentMarket.SkyBetEventId)) && (currentMarket.SkyBetEventId.Equals(eventId)))
                    {
                        prevScoreOne = score1;
                        prevScoreTwo = score2;
                        currentMarket.Player1.ScoreSkyBet = score1;
                        currentMarket.Player2.ScoreSkyBet = score2;
                        PlayerChanged?.Invoke(new ScoreUpdEventArgs(currentMarket));
                        break;
                    }
                }
            }
            if (e.Message[0] == '2')
            {
                var str = e.Message.Split('|');
                var elem = str[1];
                MessageChanged?.Invoke(new MessagesEventArgs(elem,TypeDBO.SkyBet));
            }
        }
示例#5
0
        void Web_ConsoleMessage(object sender, CefSharp.ConsoleMessageEventArgs e)
        {
            if ((ThreemaDesktop.ActiveForm == this))
            {
                return;
            }

            if (e.Message.Contains("New Message"))
            {
                // Wenn Letzte Nachricht (100) neue Nachricht (101) -> nicht abspielen
                if (this.last_Notification + 10 < UnixTimeNow())
                {
                    System.Console.WriteLine("New Message");
                    this.last_Notification = UnixTimeNow();
                    return;
                }
                return;
            }
        }
 void SpotifyEnabledBrowser_ConsoleMessage(object sender, ConsoleMessageEventArgs e)
 {
     Log.DebugFormat("From {0} Line {1}:  {2}", e.Source, e.Line, e.Message);
 }
示例#7
0
 public bool OnConsoleMessage(IWebBrowser browserControl, ConsoleMessageEventArgs consoleMessageArgs)
 {
     return true;
 }
示例#8
0
 private void HandleConsoleMessage(object sender, ConsoleMessageEventArgs e)
 {
     MessageBox.Show(e.Source + ":" + e.Line + " " + e.Message, "JavaScript console message");
 }
示例#9
0
 private void BrowserOnConsoleMessage(object sender, ConsoleMessageEventArgs e)
 {
     Log.InfoFormat("Browser message - [Line: {0}, Source: {1}] : , Message: {2}", e.Line, e.Source, e.Message);
 }
示例#10
0
 private void OnBrowserConsoleMessage(object sender, ConsoleMessageEventArgs args)
 {
     // DisplayOutput(string.Format("Line: {0}, Source: {1}, Message: {2}", args.Line, args.Source, args.Message));
 }
示例#11
0
 bool IDisplayHandler.OnConsoleMessage(IWebBrowser browserControl, ConsoleMessageEventArgs consoleMessageArgs)
 {
     return false;
 }
示例#12
0
 void webBrowser_ConsoleMessage(object sender, ConsoleMessageEventArgs e)
 {
     if (debugMode)
     {
         // Add to a log, maybe?
     }
 }
示例#13
0
        private void _onBrowserConsoleMessage(object sender, CefSharp.ConsoleMessageEventArgs e)
        {
            string message = e.Message.ToString();

            this.AddMessage(message);
        }
 private void BrowserConsoleMessage(object sender, ConsoleMessageEventArgs e)
 {
     Console.WriteLine(e.Message);
 }
示例#15
0
 private void browser_ConsoleMessage(object sender, ConsoleMessageEventArgs e)
 {
     WriteLog(String.Format("{2}\r\n\tLine: {0}\r\n\tMessage: {1}", e.Line, e.Message, System.Reflection.MethodBase.GetCurrentMethod().Name));
 }
示例#16
0
 void BrowserConsoleMessage(object sender, ConsoleMessageEventArgs e)
 {
     string messageText = String.Format("{0}: {1} ({2})", e.Line, e.Message, e.Source);
       LogMessage("CONSOLE MESSAGE: " + messageText);
 }
        private void Cwb_StatusMessage(object sender, CefSharp.StatusMessageEventArgs e)
        {
            try
            {
                lblStatusText.Text = e.Value.ToString();
                ConsoleMessageEventArgs cmea = new ConsoleMessageEventArgs(e.Value.ToString(), "Internal", 0);
                ConsoleMessageEvent(this, cmea);
            }
            catch (Exception)
            {

                throw;
            }
        }
 private void LogConsoleMessage(object sender, ConsoleMessageEventArgs e)
 {
     m_Log.WarnFormat("{0} at {1}:{2}", e.Message, new Uri(e.Source).LocalPath.TrimStart('/'), e.Line);
 }
示例#19
0
 private void Browser_ConsoleMessage(object sender, CefSharp.ConsoleMessageEventArgs e)
 {
     Console.Write(e.Message);
 }
示例#20
0
 private void consoleReceiveHandler(object sender, ConsoleMessageEventArgs e)
 {
     this.Invoke((Action<object>)((obj) =>
     {
         if (char.IsNumber(e.Message[0]))
         {
             browserConsole.AppendText(e.Message + "\n");
             startSearch(e.Message.Trim());
         }
     }), new Object());
 }
示例#21
0
 private void WebViewConsoleMessage(object sender, CefSharp.ConsoleMessageEventArgs e)
 {
     OnConsoleMessageReceived(e.Message);
 }
示例#22
0
 private void Browser_ConsoleMessage(object sender, CefSharp.ConsoleMessageEventArgs e)
 {
     Console.WriteLine("Browser logged: " + e.Message);
 }
示例#23
0
 void c_WebBrowser_ConsoleMessage(object sender, ConsoleMessageEventArgs e)
 {
     System.Diagnostics.Debugger.Log(1, "Console", e.Source + ":" + e.Line + " - " + e.Message + "\r\n");
 }
 static void OnConsoleMessage(object sender, ConsoleMessageEventArgs e) {
     MainLog.Logger.Info("CEF: " + e.Message  + " [" + e.Source + ":" + e.Line + "]");
 }
示例#25
0
 private void OnWebBrowserConsoleMessage(object sender, ConsoleMessageEventArgs e)
 {
     OutputMessage = e.Message;
 }