Exemple #1
0
        private void AttachCameraView()
        {
            switch (vsDeviceType)
            {
            case VsDeviceType.CAMERA:
            {
                if (vsAttachType == VsAttachType.ATTACH_RECEIVER)
                {
                    vsCoreMonitor.DetachCameraView(vsDeviceName, this);
                    // vsCoreMonitor.DetachCameraViewAnalyzer(vsDeviceName, this);

                    vsViewer.Image    = global::Vs.Monitor.Properties.Resources.isys;
                    vsViewer.SizeMode = PictureBoxSizeMode.CenterImage;

                    vsCoreMonitor.AttachCameraViewAnalyzer(vsDeviceName, this);
                    vsAttachType = VsAttachType.ATTACH_ANALYZER;
                }
                else
                {
                    //vsCoreMonitor.DetachCameraView(vsDeviceName, this);
                    vsCoreMonitor.DetachCameraViewAnalyzer(vsDeviceName, this);

                    vsViewer.Image    = global::Vs.Monitor.Properties.Resources.isys;
                    vsViewer.SizeMode = PictureBoxSizeMode.CenterImage;

                    vsCoreMonitor.AttachCameraView(vsDeviceName, this);
                    vsAttachType = VsAttachType.ATTACH_RECEIVER;
                }
                break;
            }

            case VsDeviceType.CHANNEL:
            {
                if (vsAttachType == VsAttachType.ATTACH_RECEIVER)
                {
                    vsCoreMonitor.DetachChannelView(vsDeviceName, this);
                    //vsCoreMonitor.DetachChannelViewAnalyzer(vsDeviceName, this);

                    vsViewer.Image    = global::Vs.Monitor.Properties.Resources.isys;
                    vsViewer.SizeMode = PictureBoxSizeMode.CenterImage;

                    vsCoreMonitor.AttachChannelViewAnalyzer(vsDeviceName, this);
                    vsAttachType = VsAttachType.ATTACH_ANALYZER;
                }
                else
                {
                    //vsCoreMonitor.DetachChannelView(vsDeviceName, this);
                    vsCoreMonitor.DetachChannelViewAnalyzer(vsDeviceName, this);

                    vsViewer.Image    = global::Vs.Monitor.Properties.Resources.isys;
                    vsViewer.SizeMode = PictureBoxSizeMode.CenterImage;

                    vsCoreMonitor.AttachChannelView(vsDeviceName, this);
                    vsAttachType = VsAttachType.ATTACH_RECEIVER;
                }
                break;
            }
            }
        }