/// <summary> /// Setup the callback for recieved data and loss of conneciton /// </summary> /// <param name="app"></param> public void SetupRecieveCallback(alta_class_net app) { try { AsyncCallback recieveData = new AsyncCallback(app.OnRecievedData); m_sock.BeginReceive(m_byBuff, 0, m_byBuff.Length, SocketFlags.None, recieveData, this); } catch (Exception ex) { Console.WriteLine("Recieve callback setup failed! {0}", ex.Message); } }
public Player() { InitializeComponent(); Define.keySerect = DateTime.Now.ToString().MD5String(); this.imgVideo.Stretch = App.setting.ModeVideo; this.Topmost = App.setting.Topmost; this.Top = App.setting.Top; this.Left = App.setting.Left; this.alta_volume.Value = App.setting.Volume; this.Tcp_Server = new alta_class_net(Define.keySerect); this.Tcp_Server.StopVlc += Tcp_Server_StopVlc; this.Tcp_Server.PlayVlc += Tcp_Server_PlayVlc; this.Tcp_Server.TurnOffApp += Tcp_Server_TurnOffApp; this.Tcp_Server.SendPlaying += Tcp_Server_SendPlaying; this.WindowState = App.setting.WindowState; myVlcControl.PositionChanged += VlcControlOnPositionChanged; myVlcControl.TimeChanged += VlcControlOnTimeChanged; myVlcControl.Paused += myVlcControl_Paused; myVlcControl.Playing += myVlcControl_Playing; myVlcControl.Stopped += myVlcControl_Stopped; myVlcControl.PlaybackMode = PlaybackModes.Loop; this.flag_Load_Data = true; }
private void UIRootView_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (this.clock != null) this.clock.Controller.Stop(); this.mainClock.Controller.Stop(); this.ClockMouse.Controller.Stop(); if (myVlcControl.IsPlaying) myVlcControl.Stop(); // Config.Write(App.FileName, App.setting); this.Tcp_Server = null; VlcContext.CloseAll(); }