12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace LYFZ.Software.UI
- {
- public partial class frmOfficalWebsiteVideo : Form
- {
- public frmOfficalWebsiteVideo()
- {
- InitializeComponent();
- }
-
-
-
-
- public static bool IsDialogOpen()
- {
- bool bResult = false;
- foreach (System.Windows.Forms.Form frm in System.Windows.Forms.Application.OpenForms)
- {
- if (frm.Name == typeof(frmOfficalWebsiteVideo).Name)
- {
- bResult = true;
- break;
- }
- }
- return bResult;
- }
-
-
-
-
- public static frmOfficalWebsiteVideo GetDialogHandler()
- {
- frmOfficalWebsiteVideo handler = null;
- foreach (System.Windows.Forms.Form frm in System.Windows.Forms.Application.OpenForms)
- {
- if (frm.Name == typeof(frmOfficalWebsiteVideo).Name)
- {
- handler = (frmOfficalWebsiteVideo)frm;
- break;
- }
- }
- return handler;
- }
-
-
-
-
- public static void SetVideo(string video_url)
- {
- try
- {
- frmOfficalWebsiteVideo handler = GetDialogHandler();
- if (handler == null)
- {
- handler = new frmOfficalWebsiteVideo();
- handler.webBrowser1.Url = new Uri(video_url);
- handler.Show();
- }
- else
- {
- handler.Activate();
- handler.webBrowser1.Url = new Uri(video_url);
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.Message);
- }
- }
- }
- }
|