Ejemplo n.º 1
0
        /// <summary>
        /// Make sure to poll tables when the form loads
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Form1_Load(object sender, System.EventArgs e)
        {
            // Load poker site plugins
            foreach (string file in Directory.GetFiles(Application.StartupPath + "\\Plugins\\Sites", "*.dll"))
            {
                IPokerTable sitePlugin = PluginHandler.LoadPlugin <IPokerTable>(file);

                if (sitePlugin != null)
                {
                    sitePlugin.Core = this;
                    SitePlugins.Add(sitePlugin);
                }
            }

            // Start thread that polls for new table windows
            Thread tablePoller = new Thread(new ThreadStart(delegate()
            {
                // Poll tables right away
                pollTables();

                // Sleep preset time between table polls
                Thread.Sleep(timeBetweenTablePolls);
            }));

            tablePoller.Start();

            //TODO: Load form size & position

            //TODO: Set global key hook listener
            // Set the global key hook
            //actHook = new UserActivityHook();
            //actHook.KeyDown += new KeyEventHandler(myKeyDown);
        }
Ejemplo n.º 2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Load & run startup plugins
            foreach (string file in Directory.GetFiles(Application.StartupPath + "\\Plugins\\Startup", "*.dll"))
            {
                IStartupPlugin startupPlugin = PluginHandler.LoadPlugin <IStartupPlugin>(file);

                if (startupPlugin != null)
                {
                    startupPlugin.Run();
                }
            }

            Application.Run(new Form1());
        }