ab56a9bcf7
SVN-Revision: r240
49 lines
1.3 KiB
C#
49 lines
1.3 KiB
C#
using Lskj.Control;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
namespace RFIDManagement
|
|
{
|
|
public partial class FrmBrower : Form
|
|
{
|
|
public int OutTime = 10;
|
|
public FrmWebBrowser WebBrowser;
|
|
public SynchronizationContext SyncContext;
|
|
public FrmBrower()
|
|
{
|
|
InitializeComponent();
|
|
SyncContext = SynchronizationContext.Current;
|
|
WebBrowser = new FrmWebBrowser();
|
|
WebBrowser.Dock = DockStyle.Fill;
|
|
this.Controls.Add(WebBrowser);
|
|
this.Load += OnFrmBrowerLoad;
|
|
}
|
|
private void OnFrmBrowerLoad(object sender, EventArgs e)
|
|
{
|
|
Task task = new Task(async () =>
|
|
{
|
|
await Task.Delay(OutTime);
|
|
SyncContext.Post(CloseWindow, null);
|
|
});
|
|
task.Start();
|
|
}
|
|
public void LoadUrl(string url)
|
|
{
|
|
WebBrowser.FrmLoad(url);
|
|
}
|
|
public void CloseWindow(object state)
|
|
{
|
|
this.Close();
|
|
this.Dispose();
|
|
}
|
|
}
|
|
}
|