Example #1
0
        private void MainForm_Shown(object sender, EventArgs e)
        {
            IIconExtractor extractor = IconExtractor.Default;

            ImageUploadWatcher watcher =
                new ImageUploadWatcher()
            {
                PathToWatch = Properties.Settings.Default.ImageUploadPool,
            };

            Presenter p = new Presenter(this, watcher, extractor);

            p.Start();
        }
Example #2
0
 private void OnConnectionFinished(object ex)
 {
     if (ex != null)
     {
         MessageBox.Show(this,
                         "无法连接摄像头,请检查摄像头后重新连接",
                         "连接错误",
                         MessageBoxButtons.OK,
                         MessageBoxIcon.Error);
     }
     else
     {
         presenter.Start();
         this.faceRecognize.Enabled = true;
     }
 }
Example #3
0
        private void StartCamera(Camera cam)
        {
            ICamera Icam = null;

            if (string.IsNullOrEmpty(Program.directory))
            {
                SanyoNetCamera camera = new SanyoNetCamera();
                camera.IPAddress = cam.IpAddress;
                camera.UserName  = "******";
                camera.Password  = "******";

                try
                {
                    camera.Connect();
                }
                catch (System.Net.Sockets.SocketException)
                {
                    MessageBox.Show("无法连接摄像头,请检查摄像头后重新连接");
                    return;
                }
                catch (System.Net.WebException)
                {
                    MessageBox.Show("无法连接摄像头,请检查摄像头后重新连接");
                    return;
                }


                Icam = camera;

                StartRecord(cam);

                Properties.Settings.Default.LastSelCamID = cam.ID;
            }
            else
            {
                MockCamera mc = new MockCamera(Program.directory);
                mc.Repeat = true;
                Icam      = mc;
            }

            presenter = new Presenter(this, Icam);

            presenter.Start();
        }
Example #4
0
        private void MainForm_Shown(object sender, EventArgs e)
        {
            IIconExtractor extractor = IconExtractor.Default;

            ImageUploadWatcher watcher =
                new ImageUploadWatcher() { PathToWatch = Properties.Settings.Default.ImageUploadPool, };

            Presenter p = new Presenter(this, watcher, extractor);
            p.Start();
        }
Example #5
0
        private void StartCamera(Camera cam)
        {
            ICamera Icam = null;

            if (string.IsNullOrEmpty(Program.directory))
            {

                SanyoNetCamera camera = new SanyoNetCamera();
                camera.IPAddress = cam.IpAddress;
                camera.UserName = "******";
                camera.Password = "******";

                try
                {
                    camera.Connect();
                }
                catch (System.Net.Sockets.SocketException)
                {
                    MessageBox.Show("无法连接摄像头,请检查摄像头后重新连接");
                    return;
                }
                catch (System.Net.WebException)
                {
                    MessageBox.Show("无法连接摄像头,请检查摄像头后重新连接");
                    return;
                }

                Icam = camera;

                StartRecord(cam);

                Properties.Settings.Default.LastSelCamID = cam.ID;

            }
            else
            {
                MockCamera mc = new MockCamera(Program.directory);
                mc.Repeat = true;
                Icam = mc;
            }

            presenter = new Presenter(this, Icam);

            presenter.Start();
        }