Example #1
0
        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;
        }
Example #2
0
 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);