예제 #1
0
 //定义触发事件的方法
 protected virtual void OnNewFrame(FrameReceivedArgs e)
 {
     // 第二种做法
     //EventHandler<FrameReceivedArgs> temp = NewFrame;
     //if (temp != null)
     //{
     //    temp(this, e);
     //}
     NewFrame?.Invoke(this, e); // 这是被注释掉的部分的简化版本,VS给我优化的
 }
예제 #2
0
        // 包装好事件参数,调用事件触发函数。
        public void ReceivedNewFrame(string s, byte[] b)
        {
            FrameReceivedArgs e = new FrameReceivedArgs(s, b);

            OnNewFrame(e);
        }
예제 #3
0
 private void Notification_NewFrame(object sender, FrameReceivedArgs e)
 {
     throw new NotImplementedException();
 }