Exemple #1
0
        private void buttonStreamer_Click(object sender, EventArgs e)
        {
            switch (vsPropertyType)
            {
            case VsDeviceType.CAMERA:
            {
                VsCamera vsCamera = vsCoreMonitor.GetCameraByName(vsTypeName);
                if (vsCamera == null)
                {
                    return;
                }
                vsCamera.Streaming = !vsCamera.Streaming;
                ActivatePropertyControl(VsDeviceType.CAMERA, vsTypeName);
            }
            break;

            case VsDeviceType.CHANNEL:
            {
                VsChannel vsChannel = vsCoreMonitor.GetChannelByName(vsTypeName);
                if (vsChannel == null)
                {
                    return;
                }

                if (vsChannel.Streaming)
                {
                    vsCoreMonitor.StopStreamChannel(vsTypeName);
                }
                else
                {
                    vsCoreMonitor.StartStreamChannel(vsTypeName, textIp.Text, int.Parse(textPort.Text));
                }
                ActivatePropertyControl(VsDeviceType.CHANNEL, vsTypeName);
            }
            break;

            case VsDeviceType.PAGE:
            {
                VsPage vsPage = vsCoreMonitor.GetPageByName(vsTypeName);
                if (vsPage == null)
                {
                    return;
                }
                vsPage.Streaming = !vsPage.Streaming;
                ActivatePropertyControl(VsDeviceType.PAGE, vsTypeName);
            }
            break;
            }
        }