Esempio n. 1
0
        /// <summary>
        /// Connects to the server and opens camera control
        /// </summary>
        public void Start()
        {
            if (StreamViewerControl == null)
            {
                throw new ArgumentNullException("StreamViewerControl must not be null!");
            }

            if (StreamViewerControl.SourceInfo.CameraControl == null)
            {
                throw new ArgumentNullException("StreamViewerControl.SourceInfo.CameraControl may not be null!");
            }

            if (StreamViewerControl.SourceInfo.CameraControl.PTZType == PTZType.Null)
            {
                throw new NotSupportedException("PTZType.Null is not supported!");
            }

//            if(string.IsNullOrEmpty(StreamViewerControl.ServerAddress))
//            {
//                throw new ArgumentException("StreamViewerControl.ServerAddress must not be empty!");
//            }

            //start listening to SVC's property events
            _svc.PropertyChanged += new PropertyChangedEventHandler(SVC_PropertyChanged);

            client = FutureConcepts.Media.Client.CameraControlClients.ClientFactory.Create(StreamViewerControl.ServerAddress, StreamViewerControl.SourceInfo);

            client.Opened          += new EventHandler(client_Opened);
            client.Closed          += new EventHandler(client_Closed);
            client.PropertyChanged += new PropertyChangedEventHandler(client_PropertyChanged);

            client.Open(new ClientConnectRequest(StreamViewerControl.SourceInfo.SourceName));
        }