public WaitPleaseForm(Form _parent, FunctionCallBack _doworkFunction , FunctionCallBack _endworkFunction) { InitializeComponent(); doworkFunction = _doworkFunction; endworkFunction = _endworkFunction; parent = _parent; if (parent == null) { throw new ArgumentNullException("Form must be define"); } if (doworkFunction == null) { throw new ArgumentNullException("Work function must be define"); } this.Owner = parent; }
void EndWork() { if (this.InvokeRequired) { FunctionCallBack d = new FunctionCallBack(EndWork); this.BeginInvoke(d, new object[] { }); } else { parent.Enabled = true; this.Close(); this.Visible = false; //Fix mono BUG this.Dispose(); //Fix mono BUG if (endworkFunction != null) { this.endworkFunction(); } } }
private extern static int Initialize(int id, LoadfileCallBack loadfile, FunctionCallBack funcall);