Пример #1
0
        private void InitCradleOfRomeWatcher()
        {
            XmlConfig config = XmlConfig.CurrentConfig;

            gCradleWatcher = new PB_Library.CradleOfRomeWatcher();
            gCradleWatcher.CradleProgram = config.Get("CradleOfRomeWatcher/Program");
            if (gCradleWatcher.CradleProgram == null)
            {
                return;
            }
            gCradleWatcher.CradleFileDirectory        = config.GetExplicit("CradleOfRomeWatcher/FileDirectory");
            gCradleWatcher.CradleFileSaveDirectory    = config.Get("CradleOfRomeWatcher/FileSaveDirectory");
            gCradleWatcher.CradleFileArchiveDirectory = config.Get("CradleOfRomeWatcher/FileArchiveDirectory");
            //gCradleWatcher.Notify += new PB_Library.NotifyDelegate(Trace);
            gCradleWatcher.Notify += new PB_Library.NotifyDelegate(TraceMessage);
            //gCradleWatcher.CraddleFilesSaved += new CraddleFilesSavedDelegate(CraddleFilesSaved);
            gCradleWatcher.BlitzLevelType = PB_Library.CradleOfRomeBlitzLevelType.Hard;
            if (config.Get("CradleOfRomeWatcher/StartWatcher").zTryParseAs(false))
            {
                gCradleWatcher.Start();
            }

            Trace.WriteLine("CradleOfRomeWatcher/Program : \"{0}\"", gCradleWatcher.CradleProgram);
            Trace.WriteLine("CradleOfRomeWatcher/FileDirectory : \"{0}\"", gCradleWatcher.CradleFileDirectory);
            Trace.WriteLine("CradleOfRomeWatcher/FileSaveDirectory : \"{0}\"", gCradleWatcher.CradleFileSaveDirectory);
            Trace.WriteLine("CradleOfRomeWatcher/FileArchiveDirectory : \"{0}\"", gCradleWatcher.CradleFileArchiveDirectory);
            Trace.WriteLine("CradleOfRomeWatcher/StartWatcher : {0}", gCradleWatcher.IsStarted());
        }
Пример #2
0
        public Pib_TrayIcon(TrayIcon trayIcon)
        {
            //gTrayIcon = new TrayIcon();
            gTrayIcon = trayIcon;

            gTrayIcon.NotifyIcon.Text              = "Pib";
            gTrayIcon.NotifyIcon.MouseDoubleClick += new MouseEventHandler(notifyIcon_MouseDoubleClick);

            gmMain                   = zForm.CreateMenuItem("Pib &main", true, new EventHandler(m_main_Click));
            gmCraddleSaveFile        = zForm.CreateMenuItem("&Craddle save file", true, new EventHandler(m_craddle_save_file_Click));
            gmRunCraddle             = zForm.CreateMenuItem("&Run craddle", false, new EventHandler(m_run_craddle_Click));
            gmRunCraddleLastLevel    = zForm.CreateMenuItem("&Run craddle last level", false, new EventHandler(m_run_craddle_last_level_Click));
            gmDeleteCraddleLastLevel = zForm.CreateMenuItem("&Delete craddle last level", false, new EventHandler(m_delete_craddle_last_level_Click));
            InitCradleOfRomeWatcher();
            if (gCradleWatcher.IsStarted())
            {
                gmCraddleSaveFile.Checked = true;
            }
            else
            {
                gmCraddleSaveFile.Checked = false;
            }
            //RunCraddleSaveFile();
            //UpdateRunCradleMenu();
            //ToolStripMenuItem mBackup = zmenu.CreateMenuItem("&Backup", false, new EventHandler(m_backup_Click));
            gmAbortCurrentTask         = zForm.CreateMenuItem("&Abort current task", false, new EventHandler(m_abort_current_task_Click));
            gmAbortCurrentTask.Enabled = false;
            //gmRunTaskRapidshare = zmenu.CreateMenuItem("Run rapidshare &download", false, new EventHandler(m_RunTaskRapidshare_Click));
            //gmAbortTaskRapidshare = zmenu.CreateMenuItem("Ab&ort rapidshare download", false, new EventHandler(m_AbortTaskRapidshare_Click));
            //gmAbortTaskRapidshare.Enabled = false;
            //ToolStripMenuItem mAddFilesTubeDownload = zmenu.CreateMenuItem("Add &FilesTube download", false, new EventHandler(m_Add_FilesTubeDownload_Click));
            //ToolStripMenuItem mAddRapidshareDownload = zmenu.CreateMenuItem("Add &Rapidshare download", false, new EventHandler(m_AddRapidshareDownload_Click));

            gmSqlServerService = zForm.CreateMenuItem("Sql server service", false, new EventHandler(m_sql_server_service_Click));
            InitSqlServerService();
            UpdateMenuItemSqlServerService();
            ToolStripMenuItem mTestProcess           = zForm.CreateMenuItem("Test &process", false, new EventHandler(m_TestProcess_Click));
            ToolStripMenuItem mTestThread1           = zForm.CreateMenuItem("Test_Thread.TestThread1 (bloque)", false, new EventHandler(m_TestThread1_Click));
            ToolStripMenuItem mTestThread2           = zForm.CreateMenuItem("Test_Thread.TestThread2 (ne bloque pas)", false, new EventHandler(m_TestThread2_Click));
            ToolStripMenuItem mRunUnfinishedThread   = zForm.CreateMenuItem("Run unfinished thread", false, new EventHandler(m_RunUnfinishedThread_Click));
            ToolStripMenuItem mAbortUnfinishedThread = zForm.CreateMenuItem("Abort unfinished thread", false, new EventHandler(m_AbortUnfinishedThread_Click));
            ToolStripMenuItem mQuit = zForm.CreateMenuItem("&Quit", false, new EventHandler(m_quit_Click));

            //gTrayIcon.NotifyMenu = gTrayIcon.CreateMenuStrip(new ToolStripItem[] {
            gTrayIcon.AddMenuItems(
                gmMain,
                new ToolStripSeparator(),
                gmCraddleSaveFile,
                gmRunCraddle,
                gmRunCraddleLastLevel,
                gmDeleteCraddleLastLevel,
                new ToolStripSeparator(),
                //mBackup,
                gmAbortCurrentTask,
                //new ToolStripSeparator(),
                //gmRunTaskRapidshare,
                //gmAbortTaskRapidshare,
                //mAddFilesTubeDownload,
                //mAddRapidshareDownload,
                new ToolStripSeparator(),
                gmSqlServerService,
                new ToolStripSeparator(),
                mTestProcess,
                mTestThread1,
                mTestThread2,
                new ToolStripSeparator(),
                mQuit);
            gTrayIcon.NotifyMenu.Opening           += new CancelEventHandler(NotifyMenu_Opening);
            WindowsApp.CurrentWindowsApp.NotifyMenu = gTrayIcon.NotifyMenu;

            main.gMainForm.VisibleChanged += new EventHandler(MainForm_VisibleChanged);
        }
Пример #3
0
        private void InitCradleOfRomeWatcher()
        {
            XmlConfig config = XmlConfig.CurrentConfig;
            gCradleWatcher = new PB_Library.CradleOfRomeWatcher();
            gCradleWatcher.CradleProgram = config.Get("CradleOfRomeWatcher/Program");
            if (gCradleWatcher.CradleProgram == null)
                return;
            gCradleWatcher.CradleFileDirectory = config.GetExplicit("CradleOfRomeWatcher/FileDirectory");
            gCradleWatcher.CradleFileSaveDirectory = config.Get("CradleOfRomeWatcher/FileSaveDirectory");
            gCradleWatcher.CradleFileArchiveDirectory = config.Get("CradleOfRomeWatcher/FileArchiveDirectory");
            //gCradleWatcher.Notify += new PB_Library.NotifyDelegate(Trace);
            gCradleWatcher.Notify += new PB_Library.NotifyDelegate(TraceMessage);
            //gCradleWatcher.CraddleFilesSaved += new CraddleFilesSavedDelegate(CraddleFilesSaved);
            gCradleWatcher.BlitzLevelType = PB_Library.CradleOfRomeBlitzLevelType.Hard;
            if (config.Get("CradleOfRomeWatcher/StartWatcher").zTryParseAs(false))
                gCradleWatcher.Start();

            Trace.WriteLine("CradleOfRomeWatcher/Program : \"{0}\"", gCradleWatcher.CradleProgram);
            Trace.WriteLine("CradleOfRomeWatcher/FileDirectory : \"{0}\"", gCradleWatcher.CradleFileDirectory);
            Trace.WriteLine("CradleOfRomeWatcher/FileSaveDirectory : \"{0}\"", gCradleWatcher.CradleFileSaveDirectory);
            Trace.WriteLine("CradleOfRomeWatcher/FileArchiveDirectory : \"{0}\"", gCradleWatcher.CradleFileArchiveDirectory);
            Trace.WriteLine("CradleOfRomeWatcher/StartWatcher : {0}", gCradleWatcher.IsStarted());
        }