public RegisteredRequestState Update(UpdateRequestState updateRegistry) { throw new NotImplementedException(); }
private void MainWindow_Load(object sender, EventArgs e) { // // First, attempt to connect to remote core // ConnectDlg connectDlg = new ConnectDlg(); string errorMsg = null; bool connect_ok = false; string amuleHost = "", amulePort = ""; while (!connect_ok) { if (connectDlg.ShowDialog() == DialogResult.OK) { amuleHost = connectDlg.Host(); amulePort = connectDlg.Port(); string pass = connectDlg.Pass(); int amulePort_int = 0; try { amulePort_int = Convert.ToInt16(amulePort, 10); }catch (Exception) { MessageBox.Show("Invalid port number", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); continue; } connect_ok = m_amuleRemote.ConnectToCore(amuleHost, amulePort_int, pass, ref errorMsg); if (!connect_ok) { Console.WriteLine("Connect failed '{0}'", errorMsg); MessageBox.Show(errorMsg, "Connection to aMule core failed", MessageBoxButtons.OK, MessageBoxIcon.Stop); } } else { Application.Exit(); return; } } textLinktatus.Text = "aMule core on [" + amuleHost + ":" + amulePort + "]"; Text = "aMule remote control [" + amuleHost + ":" + amulePort + "]"; Size = m_settings.MainWindowSize; m_amuleRemote.SetECHandler(new amuleMainECHanler(this)); // // Connection OK at this point // m_download_status_ctrl = new amuleDownloadStatusList(); m_dload_info = new DownloadQueueContainer(m_download_status_ctrl); m_download_status_ctrl.ItemContainer = m_dload_info; m_download_status_ctrl.OnCancelItem += new DownloadStatusListEventHandler(m_download_status_ctrl_OnCancelItem); m_download_status_ctrl.OnPauseItem += new DownloadStatusListEventHandler(m_download_status_ctrl_OnPauseItem); m_download_status_ctrl.OnResumeItem += new DownloadStatusListEventHandler(m_download_status_ctrl_OnResumeItem); m_shared_list_ctrl = new amuleSharedFilesList(); m_shared_info = new SharedFileListContainer(m_shared_list_ctrl); m_search_ctrl = new amuleSearchControl(); m_updateTimer = new Timer(); m_updateTimer.Tag = this; m_updateTimer.Tick += new EventHandler(UpdateTimerProc); m_updateTimer.Interval = 1000; m_updateTimer.Start(); // default - download list view panelMain.Controls.Add(m_download_status_ctrl); // for testing set needed state! m_req_state = UpdateRequestState.MainInfo; }