代码拉取完成,页面将自动刷新
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;
namespace TabHeaderDemo
{
public partial class WaitForm : Frm.FormLink
{
public WaitForm()
{
}
private delegate void SetTextHandler(string text);
}
public class WaitFormService
{
public static void CreateWaitForm()
{
WaitFormService.Instance.CreateForm();
}
public static void CloseWaitForm()
{
WaitFormService.Instance.CloseForm();
}
public static void SetWaitFormCaption(string text)
{
WaitFormService.Instance.SetFormCaption(text);
}
private static WaitFormService _instance;
private static readonly Object syncLock = new Object();
public static WaitFormService Instance
{
get
{
if (WaitFormService._instance == null)
{
lock (syncLock)
{
if (WaitFormService._instance == null)
{
WaitFormService._instance = new WaitFormService();
}
}
}
return WaitFormService._instance;
}
}
private WaitFormService()
{
}
private Thread waitThread;
private WaitForm waitForm;
public void CreateForm()
{
return;
if (waitThread != null)
{
try
{
waitThread.Abort();
}
catch (Exception)
{
}
}
waitThread = new Thread(new ThreadStart(delegate ()
{
waitForm = new WaitForm();
try
{
Application.Run(waitForm);
}
catch(Exception e)
{
}
}));
waitThread.Start();
}
public void CloseForm()
{
if (waitThread != null)
{
try
{
waitThread.Abort();
}
catch (Exception)
{
}
}
}
public void SetFormCaption(string text)
{
if (waitForm != null)
{
try
{
}
catch (Exception)
{
}
}
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。