private async void LoadUri_Click(object sender, RoutedEventArgs e) { if (mediaPlayer == null || adaptiveContentModels == null || loggerControl == null) { return; } Uri uri; if (!Uri.TryCreate(UriBox.Text, UriKind.Absolute, out uri)) { loggerControl.Log("Malformed Uri in Load text box.", SDKTemplate.Logging.LogViewLoggingLevel.Critical); return; } await CreateNewMediaPlaybackItem(uri); }
public void ConnectTo(string ip) { try { connector.ConnectTo(IPAddress.Parse(ip), Config.PORT); } catch (Exception e) { LogView.Log(e.Message + " " + e.StackTrace); } }
public void ConnectWait() { try { connector.ConnectWait(Config.PORT); } catch (Exception e) { LogView.Log(e.Message + " " + e.StackTrace); } }
public void CancelWait() { Debug.Log("Cancel Wait"); try { connector.CancelWait(); } catch (Exception e) { LogView.Log(e.Message + " " + e.StackTrace); } }
private void Log(string message) { if (logger != null) { logger.Log(message, LogViewLoggingLevel.Information); } else { string logEntry = $"{DateTime.Now:HH:mm:ss.fff} - {message}"; System.Diagnostics.Debug.WriteLine(logEntry); } }
private void Form1_Load(object sender, EventArgs e) { logView = new LogView(); logView.Dock = DockStyle.Fill; logPanel.Controls.Add(logView); logView.Log("Application running", LogView.LogType.Information); AutobotDisconnected(); Form form = this; HIDDLLInterface.ConnectToHID(ref form); clientDataMany = new ClientData[] { }; CreateDropDownButton(); CreateDropDownButtonCombinations(); trayToolStripMenuItem.Checked = Settings.Default.Settings_Tray; topToolStripMenuItem.Checked = Settings.Default.Settings_Top; lastToolStripMenuItem.Checked = Settings.Default.Settings_Last; showReceivedDataToolStripMenuItem.Checked = Settings.Default.Settings_Show_Keys; this.TopMost = Settings.Default.Settings_Top; tcp = new TCPThread(); tcp.OnChangeStatus += Tcp_OnChangeStatus; tcp.OnTriggerServerAction = ClientAction; logView.Log("IP : " + tcp.LocalAddress, LogView.LogType.Information); logView.Log("Port : " + tcp.Port, LogView.LogType.Information); logView.Last = Settings.Default.Settings_Last; Bot.Instance.OnPingTrigger += Instance_OnPingTrigger; tcp.Run(); botQueue = new BotQueue(); botQueue.OnErrorOccured += BotQueue_OnErrorOccured; }
public ushort SendDeliverNotify(Packet packet, Action <bool, ushort> onDeliverNotify) { try { ushort seq = this.client.SendDeliverNotify(packet); if (this.deliverNotifyTable.ContainsKey(seq)) { deliverNotifyTable[seq] = onDeliverNotify; } else { deliverNotifyTable.Add(seq, onDeliverNotify); } return(seq); } catch (Exception e) { LogView.Log(e.Message + " " + e.StackTrace); } return(0); }
private void BotQueue_OnErrorOccured(string message, LogView.LogType logType) { logView.Log(message?.ToString(), logType); }