protected override void OnStartup(StartupEventArgs e) { Init(); base.OnStartup(e); if (e.Args.Length == 0) { new MainWindow().Show(); return; } foreach (var arg in e.Args) { if (UrlChecker.IsLocalSwfFile(arg)) { BrowserWindow.PopupFlashPlayer(arg); } else if (UrlChecker.IsUrl(arg)) { BrowserWindow.Popup(arg); } else { MessageBox.Show($"{LanguageManager.GetString("invalidStartUpParam")}: {arg}"); Environment.Exit(0); } } }
private void OnDrop(DragEventArgs args) { var data = args.Data.GetData(DataFormats.FileDrop) as string[]; if (data != null) { foreach (var item in data) { if (UrlChecker.IsLocalSwfFile(item)) { SwfPlayerWindow.Show(item); } else { BrowserWindow.Show(item); } } } }
private void OpenUrl(string url) { if (string.IsNullOrWhiteSpace(url)) { JsAlertDialog.ShowDialog(LanguageManager.GetString("message_emptyUrl")); return; } url = url.Trim(); if (UrlChecker.IsLocalSwfFile(url)) { SwfPlayerWindow.Show(url); return; } switch (GlobalData.Settings.NavigationType) { case NavigationType.Automatic: { if (!UrlChecker.IsHttpUrl(url)) { url = SearchEngineUtil.GetUrl(url, GlobalData.Settings.SearchEngine); } } break; case NavigationType.SearchOnly: { url = SearchEngineUtil.GetUrl(url, GlobalData.Settings.SearchEngine); } break; case NavigationType.NavigateOnly: { //nothing to do } break; } BrowserWindow.Show(url); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); Init(); if (e.Args.Length == 0) { Views.MainWindow.Show(); return; } foreach (var arg in e.Args) { if (UrlChecker.IsLocalSwfFile(arg)) { SwfPlayerWindow.Show(arg); } else { BrowserWindow.Show(arg); } } }