Ejemplo n.º 1
0
        private void OnHandleCreated(object sender, EventArgs e)
        {
            Logger.Configure(this, log_box);

            about_browser.DocumentStream = Assembly.
                                           GetExecutingAssembly().
                                           GetManifestResourceStream("phoenix.Resources.about.html");

            m_MetricsManager = new Metrics.Manager();
            m_HotkeyManager  = new HotkeyManager(Handle);
            m_AppSettings    = new Settings();
            m_ProcessRunner  = new ProcessRunner();
            m_FileDialog     = new OpenFileDialog();
            m_FolderDialog   = new FolderBrowserDialog();
            m_UpdateManager  = new UpdateManager();
            m_RemoteManager  = new RemoteManager();
            m_ReportManager  = new ReportManager();
            m_RsyncClient    = new RsyncClient();

            m_RemoteManager.OnConnectionOpened += () => { ExecuteOnUiThread(OnMqttConnectionOpen); };
            m_RemoteManager.OnConnectionClosed += () => { ExecuteOnUiThread(OnMqttConnectionClose); };
            m_RemoteManager.OnMessage          += (m, t) => { ExecuteOnUiThread(() => { OnMqttMessage(m, t); }); };

            ApplySettings();

            m_RamUsageSeries = metrics_chart.Series["ram_usage_series"];
            m_CpuUsageSeries = metrics_chart.Series["cpu_usage_series"];
            m_GpuUsageSeries = metrics_chart.Series["gpu_usage_series"];

            notify_icon.Icon = Icon;
            process_monitor_timer.Start();

            // These are executed in a separate thread
            m_ProcessRunner.ProcessStarted += (type) => { ExecuteOnUiThread(() => { OnProcessStart(type); }); };
            m_ProcessRunner.ProcessStopped += (type) => { ExecuteOnUiThread(() => { OnProcessStop(type); }); };

            ToggleMonitoring();
            ResetMqttConnectionLabel();
            ResetWatchButtonLabel();
            ResetReportTabStatus();

            Logger.MainDialog.InfoFormat("Phoenix is up and running on [{0}]."
                                         , RsyncClient.MachineIdentity);

            m_UpdateManager.Check();
            m_PhoenixReady = true;
        }
Ejemplo n.º 2
0
 private void OnGenerateNewKeysClick(object sender, EventArgs e)
 {
     RsyncClient.GenerateKeys();
     UpdateKeyPair();
 }