예제 #1
0
파일: Program.cs 프로젝트: majohns/faceplay
        static void Main()
        {
            mouseDriven myMouse = new mouseDriven();
            Webdriver   selen   = new Webdriver("http://www.reddit.com");

            bool mode = true;

            Camera cam = new Camera(myMouse, selen, mode, 1);

            bool setup = true;

            cam.aTimer           = new System.Timers.Timer(Camera.timer);
            cam.aTimer.Elapsed  += cam.OnTimedEvent;
            cam.aTimer.AutoReset = true;
            Console.WriteLine("The timer should fire every {0} milliseconds.",
                              cam.aTimer.Interval);
            cam.aTimer.Enabled = true;

            if (setup)    //for debugging/keyboard, set this to false before compiling
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                PXCMSession session;
                pxcmStatus  sts = PXCMSession.CreateInstance(out session);
                if (sts >= pxcmStatus.PXCM_STATUS_NO_ERROR)
                {
                    Application.Run(new MainForm(session));
                    session.Dispose();
                }
            }
        }
예제 #2
0
 public Camera(mouseDriven mou, Webdriver selen, bool mode, int cfgSens)
 {
     mouse    = mou;
     selenium = selen;
     //this.Configure();
     Console.WriteLine("Camera constructor");
     useMouse  = mode;
     mouseSens = cfgSens;
     if (!mode)
     {
         timer = 100;
     }
 }