/// <summary> /// Démarre une action /// </summary> /// <param name="process"></param> /// <param name="nIdSession"></param> /// <returns></returns> public static CResultAErreur RunEventMultiple(IDeclencheurAction declencheur, CObjetDonneeAIdNumerique[] objetsCibles, bool bHideProgress) { CFormExecuteProcess form = new CFormExecuteProcess(); form.Top = 0; form.Left = Screen.PrimaryScreen.WorkingArea.Width / 2 - form.Width / 2; if (declencheur is IDeclencheurActionManuelle) { bHideProgress |= ((IDeclencheurActionManuelle)declencheur).HideProgress; } if (bHideProgress) { CInfoDeclencheurProcess infoDeclencheur = new CInfoDeclencheurProcess(TypeEvenement.Manuel); return(declencheur.RunEventMultiple(objetsCibles, infoDeclencheur, null)); } else { IAsyncResult res = form.m_runEventMultiples.BeginInvoke(declencheur, objetsCibles, new AsyncCallback(form.OnEndProcess), null); form.ShowDialog(); //Bloque le code ici ! CResultAErreur result = form.m_runEventMultiples.EndInvoke(res); return(result); } }
/// ///////////////////////////////////////////////////////////////////////// private CResultAErreur RunEventMultiplesPrivate(IDeclencheurAction declencheur, CObjetDonneeAIdNumerique[] objetsCibles) { CInfoDeclencheurProcess infoDeclencheur = new CInfoDeclencheurProcess(TypeEvenement.Manuel); return(declencheur.RunEventMultiple(objetsCibles, infoDeclencheur, this)); }