12345678910111213141516171819202122232425262728293031323334 |
- 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 WWPipeLine.MapBasic
- {
- public partial class WaitingForm : Form
- {
- public WaitingForm(EventHandler<EventArgs> Method, string msg)
- {
- InitializeComponent();
- if (!string.IsNullOrEmpty(msg)) uiLineMsg.Text = msg;
- _Method = Method;
- }
- private EventHandler<EventArgs> _Method;
- private IAsyncResult asyncResult;
- private void WaitingForm_Shown(object sender, EventArgs e)
- {
- asyncResult = _Method.BeginInvoke(null, null, null, null);
- }
- private void timerS_Tick(object sender, EventArgs e)
- {
- if (asyncResult.IsCompleted)
- this.Close();
- }
- }
- }
|