/// <summary> /// Evaluate the funcall. /// </summary> /// <param name="sub">Instance of substitution.</param> /// <param name="subContainer">Substitution service.</param> /// <returns>Result of substitution.</returns> public static string Eval(Substitution sub, SubstitutionService subContainer) { if (!sub.IsValid) { return(sub.FuncName); } return(subContainer._groups[sub.Groupname][sub.FuncName](sub.FuncName)); }
/// <summary> /// Get the interpreted value of the function call. /// e.g. /// 1. "${today}" will return today's date in MM/dd/YYYY format. /// 2. "${T-1}" will returns yesterdays date in MM/dd/YYYY format. /// 3. "${Env.Var('PYTHON_HOME')} will return the value of the environment variable "PYTHON_PATH" /// 4. "${Enc.Decode('28asd42=')} will decrypt the encrypted value supplied, /// using the provider setup in the cryptography service. /// </summary> /// <param name="funcCall"></param> /// <returns></returns> public string this[string funcCall] { get { Substitution sub = SubstitutionUtils.Parse(funcCall, this); if (!sub.IsValid) { return(funcCall); } return(SubstitutionUtils.Eval(sub, this)); } }