Ejemplo n.º 1
0
        //---------------------------------------------------------------------------------------
        private IVariableDynamique AssureVariableElementCible(CFiltreDynamique filtre, Type typeElement)
        {
            IVariableDynamique variableASupprimer = null;

            foreach (IVariableDynamique variable in filtre.ListeVariables)
            {
                if (variable.Nom == c_champElementSource)
                {
                    if (variable.TypeDonnee.TypeDotNetNatif != typeElement)
                    {
                        variableASupprimer = variable;
                    }
                    else
                    {
                        return(variable);
                    }
                }
            }
            if (variableASupprimer != null)
            {
                filtre.RemoveVariable(variableASupprimer);
            }
            CVariableDynamiqueSysteme newVariable = new CVariableDynamiqueSysteme(filtre);

            newVariable.Nom = c_champElementSource;
            newVariable.SetTypeDonnee(new sc2i.expression.CTypeResultatExpression(typeElement, false));
            filtre.AddVariablePropreAuFiltre(newVariable);
            return(newVariable);
        }