public CasparCGService() { connection = new AmcpConnection() { AutoConnect = true, AutoReconnect = true, ReconnectAttempts = 5, KeepAliveEnable = true }; }
public MainWindow() { InitializeComponent(); _connection = new AmcpConnection(HostNameTextBox.Text, 5250) { AutoConnect = true, AutoReconnect = true, ReconnectAttempts = 5, KeepAliveEnable = true }; _connection.ConnectionStateChanged += (s, e) => { Dispatcher.BeginInvoke(new Action(() => { DisplayConnectionState(e.State); if (e.State == ConnectionState.Connected) { LoadServerInfo(); } else { ClearServerInfo(); } })); }; _connection.InternalError += (s, e) => Console.WriteLine(e.Exception.Message); LoadTransition(); }