public bool Remove(IFileClass c) { foreach (Control t in this.CameraPanel.Controls) { IFileView v = t as IFileView; if (v != null && v.FileClass.ID.Equals(c.ID)) { if (t is IVideoView) { IVideoView x = t as IVideoView; x.Stop(); } this.CameraPanel.Controls.Remove(t); this.ShortcutRemove(t as IView); break; } } return(true); }
public void StopAll() { this.Cursor = Cursors.WaitCursor; foreach (Control t in this.CameraPanel.Controls) { IVideoView v = t as IVideoView; if ((v != null) && (v.IsRunning() == true)) { try { v.Stop(); } catch (ApplicationException ex) { MessageBox.Show("[" + v.CameraClass.Name + "]: " + ex.Message); } } } this.Cursor = Cursors.Default; }
public bool Remove(CameraClass c) { foreach (Control t in this.CameraPanel.Controls) { IView v = t as IView; if (v != null) { if (false == v.Owner.ID.Equals(c.ID)) { continue; } if (v is IVideoView) { IVideoView x = (IVideoView)v; x.Stop(); } this.CameraPanel.Controls.Remove(v.Me); this.ShortcutRemove(v); break; } } return(true); }