/// <summary> /// Seek to a position in the video. /// </summary> /// <param name="position">The position to seek to.</param> public void SeekVideo(double position) { var info = GetInfo(); info.VideoPosition = position; OnInfoChanged?.Invoke(info); }
private void TxtBx_TextChanged(object sender, EventArgs e) { if (!_disableUpdate) { OnInfoChanged?.Invoke(this, new EventArgs()); } }
/// <summary> /// Sets the video. /// </summary> /// <param name="url"></param> public void SetVideo(string url) { var info = GetInfo(); info.VideoUrl = url; OnInfoChanged?.Invoke(info); }
private void CmbBxAnnotation_SelectedIndexChanged(object sender, EventArgs e) { if (!_disableUpdate) { OnInfoChanged?.Invoke(this, new EventArgs()); } }
/// <summary> /// A client disconnected. /// </summary> /// <param name="ip">The ip address of the client.</param> /// <param name="port">The port the client was connected to.</param> private void WCFServerService_ClientDisconnected(string ip, int port) { var client = _clients.FirstOrDefault(c => c.IpAddress == ip && c.Port == port); if (client != null) { _clients.Remove(client); _serverInfo.Clients = _clients.ToDictionary(c => c.IpAddress, c => c.Port); OnInfoChanged?.Invoke(_serverInfo); } }
private void gameStatisticsControl1_DoubleClick(object sender, EventArgs e) { var gameStatEditor = new FrmGameStatisticsEditor(gameStatisticsControl1.GameCount, gameStatisticsControl1.WhitePercent, gameStatisticsControl1.NullPercent); if (gameStatEditor.ShowDialog() == DialogResult.OK) { gameStatisticsControl1.SetStatistics(gameStatEditor.GameCount, gameStatEditor.WhiteCount, gameStatEditor.DrawCount); if (!_disableUpdate) { OnInfoChanged?.Invoke(this, new EventArgs()); } } }
/// <summary> /// A client could not be reached. /// </summary> /// <param name="client">The client.</param> /// <param name="e">The exception.</param> private void HandleClientError(Client client, Exception e) { var cl = _clients.FirstOrDefault(c => c.IpAddress == client.IpAddress && c.Port == client.Port); if (cl != null) { lock (_clients) { _clients.Remove(cl); _serverInfo.Clients = _clients.GroupBy(c => c.IpAddress).Select(g => g.First()).ToDictionary(c => c.IpAddress, c => c.Port); OnInfoChanged?.Invoke(_serverInfo); } } }
/// <summary> /// The client connected. /// </summary> /// <param name="client">The connected client.</param> private void WCFServerService_ClientConnected(Client client) { if (!_clients.Any(c => c.IpAddress == client.IpAddress && c.Port == client.Port)) { _clients.Add(client); _serverInfo.Clients = _clients.GroupBy(c => c.IpAddress).Select(g => g.First()).ToDictionary(c => c.IpAddress, c => c.Port); OnInfoChanged?.Invoke(_serverInfo); var currentsong = _player.GetCurrentSong(); if (currentsong != null) { Play(currentsong, client); } } }
/// <summary> /// Disconnect from the server. /// </summary> /// <returns>The musicplayer.</returns> public IMusicPlayer Disconnect() { if (_factory.State == CommunicationState.Opened) { try { _server.Goodbye(); _factory.Close(); } catch { } } _factory.Abort(); OnInfoChanged?.Invoke(null); base.Dispose(); return(null); }