Esempio n. 1
0
        public static bool QueueGuiLockingTask(string taskName, WaitCallback callback, object state)
        {
            if (callback == null)
            {
                throw new ArgumentNullException("callback");
            }

            if (MainForm == null)
            {             //execute directly
                callback(state);
                return(true);
            }

            if (LockedGUIForm == null)
            {
                LockedGUIForm = new FreeCL.Forms.LockedGuiForm();
                LockedGUIForm.Init();
            }

            waitMessage = taskName;
            return(TaskConveyer.QueueExtTask(
                       taskName,
                       callback,
                       state,
                       new WaitCallback(OnStartGuiLockingTask),
                       new WaitCallback(OnEndGuiLockingTask),
                       new WaitCallback(OnExceptionInGuiLockingTask)
                       ));
        }
Esempio n. 2
0
        public static void StartGuiLockingTask(string waitMess)
        {
            if (LockedGUIForm == null)
            {
                LockedGUIForm = new FreeCL.Forms.LockedGuiForm();
                LockedGUIForm.Init();
            }

            waitMessage = waitMess;
            OnStartGuiLockingTask(null);
        }
Esempio n. 3
0
        static public void SyncStart(string message, LockCallback callback, object state)
        {
            if (SyncLockedGUIForm == null)
            {
                SyncLockedGUIForm = new FreeCL.Forms.LockedGuiForm();
                SyncLockedGUIForm.Init();
            }
            SyncLockedGUIForm.savedCallBack     = callback;
            SyncLockedGUIForm.savedState        = state;
            SyncLockedGUIForm.tCallback.Enabled = true;

            SyncLockedGUIForm.StartWaiting(message);

            Application.DoEvents();
        }
Esempio n. 4
0
        public static void SyncStart(string message, LockCallback callback, object state)
        {
            if(SyncLockedGUIForm == null)
            {
                SyncLockedGUIForm = new FreeCL.Forms.LockedGuiForm();
                SyncLockedGUIForm.Init();
            }
            SyncLockedGUIForm.savedCallBack = callback;
            SyncLockedGUIForm.savedState = state;
            SyncLockedGUIForm.tCallback.Enabled = true;

            SyncLockedGUIForm.StartWaiting(message);

            Application.DoEvents();
        }
Esempio n. 5
0
        public static void StartGuiLockingTask(string waitMess)
        {
            if(LockedGUIForm == null)
            {
                LockedGUIForm = new FreeCL.Forms.LockedGuiForm();
                LockedGUIForm.Init();
            }

            waitMessage = waitMess;
            OnStartGuiLockingTask(null);
        }
Esempio n. 6
0
        public static bool QueueGuiLockingTask(string taskName, WaitCallback callback, object state)
        {
            if(callback == null)
                throw new ArgumentNullException("callback");

            if(MainForm == null)
            { //execute directly
                callback(state);
                return true;
            }

            if(LockedGUIForm == null)
            {
                LockedGUIForm = new FreeCL.Forms.LockedGuiForm();
                LockedGUIForm.Init();
            }

            waitMessage = taskName;
            return TaskConveyer.QueueExtTask(
                taskName,
                callback,
                state,
                new WaitCallback(OnStartGuiLockingTask),
                new WaitCallback(OnEndGuiLockingTask),
                new WaitCallback(OnExceptionInGuiLockingTask)
             );
        }