Ejemplo n.º 1
0
        /// ////////////////////////////////////////////
        public static void RegisterAction(IActionSurServeur action)
        {
            CInfoActionServeur info = new CInfoActionServeur(action.CodeType, action.Libelle, action.Description, action.NomsParametres);

            m_listeInfosActions.Add(info);
            m_tableCodeActionToType[action.CodeType] = action.GetType();
            m_listeInfosActions.Sort(new InfoActionComparer());
        }
Ejemplo n.º 2
0
        /// ////////////////////////////////////////////
        public CResultAErreur ExecuteAction(string strCodeAction, Hashtable valeursParametres)
        {
            //Alloue l'action
            Type           tp     = (Type)m_tableCodeActionToType[strCodeAction];
            CResultAErreur result = CResultAErreur.True;

            if (tp == null)
            {
                result.EmpileErreur(I.T("No action with the code '@1' exists|104", strCodeAction));
                return(result);
            }
            IActionSurServeur action = null;

            try
            {
                action = (IActionSurServeur)Activator.CreateInstance(tp);
            }
            catch
            {
                result.EmpileErreur(I.T("Impossible to allocate an action of the @1 type|105", strCodeAction));
                return(result);
            }
            return(action.Execute(IdSession, valeursParametres));
        }