123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- using loadingForm;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace prBrowser.Weblogic
- {
- public partial class loading : Form
- {
- public loading()
- {
- InitializeComponent();
- }
- private void loading_Load(object sender, EventArgs e)
- {
- //this.BackColor = Color.Transparent;
- this.WindowState = FormWindowState.Maximized;
- this.Opacity = 0.6;
- }
- /// <summary>
- /// 关闭命令
- /// </summary>
- public void closeOrder()
- {
- if (this.InvokeRequired)
- {
- //这里利用委托进行窗体的操作,避免跨线程调用时抛异常,后面给出具体定义
- CONSTANTDEFINE.SetUISomeInfo UIinfo = new CONSTANTDEFINE.SetUISomeInfo(new Action(() =>
- {
- while (!this.IsHandleCreated)
- {
- ;
- }
- if (this.IsDisposed)
- return;
- if (!this.IsDisposed)
- {
- this.Dispose();
- }
- }));
- this.Invoke(UIinfo);
- }
- else
- {
- if (this.IsDisposed)
- return;
- if (!this.IsDisposed)
- {
- this.Dispose();
- }
- }
- }
- private void loading_FormClosing(object sender, FormClosingEventArgs e)
- {
- if (!this.IsDisposed)
- {
- this.Dispose(true);
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
- LoadingHelper.CloseForm();//关闭
- }
- }
- class CONSTANTDEFINE
- {
- public delegate void SetUISomeInfo();
- }
- }
|