private void processToolBarCommand(object sender, EventArgs e, String strAction) { if (strAction == "back") { if (m_backHistory.Count > 0) { Uri destination = m_backHistory.Peek(); m_webBrowser.Navigate(destination); } return; } if (strAction == "forward" && m_forwardHistory.Count > 0) { Uri destination = m_forwardHistory.Peek(); m_webBrowser.Navigate(destination); return; } if (strAction == "home") { String strHomePage = RhoRuby.getStartPage(); strHomePage = canonicalizeRhoUrl(strHomePage); m_webBrowser.Navigate(new Uri(strHomePage)); return; } if (strAction == "log") { showLogScreen(); return; } if (strAction == "options") { String curUrl = RhoRuby.getOptionsPage(); curUrl = canonicalizeRhoUrl(curUrl); m_webBrowser.Navigate(new Uri(curUrl)); return; } if (strAction == "refresh" && m_currentUri != null) { m_webBrowser.Navigate(m_currentUri); return; } if (strAction == "sync") { SyncThread.doSyncAllSources(true); return; } strAction = canonicalizeRhoUrl(strAction); m_webBrowser.Navigate(new Uri(strAction)); }
private void processToolBarCommand(object sender, EventArgs e, String strAction) { boolean callback = false; if (strAction == "back") { if (m_strAppBackUrl.length() > 0) { processToolBarCommand(this, e, m_strAppBackUrl); } else if (m_backHistory.Count > 0) { Uri destination = m_backHistory.Peek(); m_webBrowser.Navigate(destination); } return; } if (strAction.startsWith("callback:")) { strAction = strAction.substring(9); callback = true; } if (strAction == "forward" && m_forwardHistory.Count > 0) { Uri destination = m_forwardHistory.Peek(); m_webBrowser.Navigate(destination); return; } if (strAction == "home") { String strHomePage = RhoRuby.getStartPage(); strHomePage = canonicalizeRhoUrl(strHomePage); m_webBrowser.Navigate(new Uri(strHomePage)); return; } if (strAction == "log") { showLogScreen(); return; } if (strAction == "options") { String curUrl = RhoRuby.getOptionsPage(); curUrl = canonicalizeRhoUrl(curUrl); m_webBrowser.Navigate(new Uri(curUrl)); return; } if (strAction == "refresh" && m_currentUri != null) { m_webBrowser.Navigate(m_currentUri); return; } if (strAction == "sync") { SyncThread.doSyncAllSources(true); return; } strAction = canonicalizeRhoUrl(strAction); if (callback) { RhoClassFactory.createNetRequest().pushData(strAction, "rho_callback=1", null); } else { m_webBrowser.Navigate(new Uri(strAction)); } }