private static object EvaluateRecordsetVariable(string mappedParam, VariableDispenser variableDispenser) { try { var mappedParams = mappedParam.Split(new[] { "@" }, StringSplitOptions.RemoveEmptyEntries); Variables variables = null; foreach (string t in mappedParams) { try { string param = t.Split(new[] { "::" }, StringSplitOptions.RemoveEmptyEntries)[1].Replace("[", string.Empty).Replace("]", string.Empty).Replace("@", string.Empty); variableDispenser.LockOneForRead(param, ref variables); object variableObject = variables[0].Value; return(variableObject); } catch (Exception exception) { throw new Exception(exception.Message); } } } catch (Exception exception) { throw new Exception(exception.Message); } return(null); }
private static void LockForRead(VariableDispenser variableDispenser, ref Variables variables, List <string> lockForReadWrite, IEnumerable <string> mappedParams, IDTSComponentEvents componentEvents) { bool refire = false; foreach (string t in mappedParams) { try { string param = t.Split(new[] { "::" }, StringSplitOptions.RemoveEmptyEntries)[1].Replace("[", string.Empty).Replace("]", string.Empty).Replace("@", string.Empty); if (!IsVariableInLockForReadOrWrite(lockForReadWrite, param)) { componentEvents.FireInformation(0, "SSISPowerShell", String.Format("LockForRead: {0} ", param), string.Empty, 0, ref refire); variableDispenser.LockOneForRead(param, ref variables); } } catch (Exception) { componentEvents.FireInformation(0, "SSISPowerShell", String.Format("Unable to LockForRead: {0} ", t), string.Empty, 0, ref refire); } } }