Esempio n. 1
0
        //----< open target html file in pop-up window with html source code and in browse result with web page >---
        private void HTML_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            string selectedFile = (string)ConvertedFiles.SelectedItem;

            selectedFile = System.IO.Path.Combine(path_web, selectedFile);
            if (unselecting)
            {
                unselecting = false;
                return;
            }
            if (swin == null)
            {
                swin = new SelectionWindow();
                swin.setMainWindow(this);
            }
            StreamReader sr = new StreamReader(selectedFile, Encoding.Default);
            string       content;

            while ((content = sr.ReadLine()) != null)
            {
                swin.Add(content.ToString());
            }
            swin.Show();
            SetWebBrowserFeatures(11);
            WebBrowser1.Navigate(new Uri(selectedFile));
        }
Esempio n. 2
0
 //----< this function is to automatically execute some requirements in PJ#4 >----------------
 private void autoexe1(object sender, EventArgs e)
 {
     tab1.SelectedItem = tab1.Items[1];
     htmlbutton.RaiseEvent(new RoutedEventArgs(System.Windows.Controls.Button.ClickEvent));
     if (ConvertedFiles.Items.Count > 0)
     {
         string selectedFile = ConvertedFiles.Items[0].ToString();
         selectedFile = System.IO.Path.GetFileName(selectedFile);
         selectedFile = System.IO.Path.Combine(path_web, selectedFile);
         if (swin == null)
         {
             swin = new SelectionWindow();
             swin.setMainWindow(this);
         }
         StreamReader sr = new StreamReader(selectedFile, Encoding.Default);
         string       content;
         while ((content = sr.ReadLine()) != null)
         {
             swin.Add(content.ToString());
         }
         swin.Show();
         SetWebBrowserFeatures(11);
         WebBrowser1.Navigate(new Uri(selectedFile));
     }
     time1.Stop();
     time2.Tick    += new EventHandler(autoexe2);
     time2.Interval = new TimeSpan(0, 0, 0, 2, 0);
     time2.Start();
 }