private void OpenInWowhead(object sender, RoutedEventArgs e) { #if SILVERLIGHT if (App.Current.IsRunningOutOfBrowser) { MyHyperlinkButton button = new MyHyperlinkButton("http://www.wowhead.com/?item=" + ItemInstance.Id); button.ClickMe(); } else { System.Windows.Browser.HtmlPage.Window.Navigate(new Uri("http://www.wowhead.com/?item=" + ItemInstance.Id), "_blank"); } #else System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo("http://www.wowhead.com/?item=" + ItemInstance.Id)); #endif }
private void Download_Http(int itemID) { if (Application.Current.IsRunningOutOfBrowser) { MyHyperlinkButton button = new MyHyperlinkButton(); button.NavigateUri = new Uri(SaveWebConfig() + @"TRDialog_DownloadForm.aspx?" + @"id=" + itemID + "&" + @"start-date=" + this.format_Start_Date + "&" + @"end-date=" + this.format_End_Date, UriKind.Absolute); button.TargetName = "_blank"; button.ClickMe(); } else { MyHyperlinkButton button = new MyHyperlinkButton(); button.NavigateUri = new Uri(SaveWebConfig() + @"TRDialog_DownloadForm.aspx?" + @"id=" + itemID + "&" + @"start-date=" + this.format_Start_Date + "&" + @"end-date=" + this.format_End_Date, UriKind.Absolute); button.TargetName = "_blank"; button.ClickMe(); } }
private void Download_Http(int itemID) { // For Local Testing URL //string URL = @"http://" + SaveWebConfig() + @"/secure/"; // For Online Testing URL //string URL = @"http://" + SaveWebConfig() + @"/secure/"; if (Application.Current.IsRunningOutOfBrowser) { MyHyperlinkButton button = new MyHyperlinkButton(); button.NavigateUri = new Uri(SaveWebConfig() + @"TRDialog_DownloadForm.aspx?" + @"id=" + itemID + "&" + @"start-date=" + this.format_Start_Date + "&" + @"end-date=" + this.format_End_Date, UriKind.Absolute); button.TargetName = "_blank"; button.ClickMe(); } else { /* HtmlWindow html = HtmlPage.Window; html.Navigate(new Uri(@"TRDialog_DownloadForm.aspx?" + @"id=" + itemID + "&" + @"start-date=" + this.format_Start_Date + "&" + @"end-date=" + this.format_End_Date, UriKind.Relative)); * */ MyHyperlinkButton button = new MyHyperlinkButton(); button.NavigateUri = new Uri(SaveWebConfig() + @"TRDialog_DownloadForm.aspx?" + @"id=" + itemID + "&" + @"start-date=" + this.format_Start_Date + "&" + @"end-date=" + this.format_End_Date, UriKind.Absolute); button.TargetName = "_blank"; button.ClickMe(); } }
// 下載Btn event private void DownLoad_Click(object sender, RoutedEventArgs e) { // string URL = "http://" + SaveWebConfig() + "/"; if (Application.Current.IsRunningOutOfBrowser) { MyHyperlinkButton button = new MyHyperlinkButton(); button.NavigateUri = new Uri(SaveWebConfig() + @"TRDialog_DownloadForm.aspx?" + @"id=" + this.Get_Item_ID + "&" + @"start-date=" + string.Format("{0:yyyy-MM-dd hh:mm:ss}", this.Start_Date) + "&" + @"end-date=" + string.Format("{0:yyyy-MM-dd hh:mm:ss}", this.End_Date), UriKind.Absolute); button.TargetName = "_blank"; button.ClickMe(); } else { HtmlWindow html = HtmlPage.Window; html.Navigate(new Uri(@"TRDialog_DownloadForm.aspx?" + @"id=" + this.Get_Item_ID + "&" + @"start-date=" + this.Start_Date + "&" + @"end-date=" + this.End_Date, UriKind.Relative)); } }
private void OpenInWowhead(object sender, RoutedEventArgs e) { #if SILVERLIGHT if (App.Current.IsRunningOutOfBrowser) { MyHyperlinkButton button = new MyHyperlinkButton("http://www.wowhead.com/?item=" + TheItem.Id); button.ClickMe(); } else { System.Windows.Browser.HtmlPage.Window.Navigate(new Uri("http://www.wowhead.com/?item=" + TheItem.Id), "_blank"); } #else System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo("http://www.wowhead.com/?item=" + TheItem.Id)); #endif }
//public static void SliderValueChanged_ToInt32(object sender, RoutedPropertyChangedEventArgs<double> e) //{ // Slider ctrl = sender as Slider; // ctrl.Value = Convert.ToInt32(e.NewValue); //} public static void Navigate(Uri uri) { var hb = new MyHyperlinkButton(uri); }
private void OpenInWowhead(object sender, RoutedEventArgs e) { FrameworkElement fe = sender as FrameworkElement; ItemListItem listItem = fe.DataContext as ItemListItem; #if SILVERLIGHT if (App.Current.IsRunningOutOfBrowser) { MyHyperlinkButton button = new MyHyperlinkButton("http://www.wowhead.com/?item=" + listItem.ItemInstance.Id); button.ClickMe(); } else { System.Windows.Browser.HtmlPage.Window.Navigate(new Uri("http://www.wowhead.com/?item=" + listItem.ItemInstance.Id), "_blank"); } #else System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo("http://www.wowhead.com/?item=" + listItem.ItemInstance.Id)); #endif }