private LocalParameter[] ParseText(OracleCommand command, string commandText, out bool isQuery) { OracleParameterCollection parameters = command.Parameters; ArrayList list = new ArrayList(); Regex sqlTokenParser = GetSqlTokenParser(); isQuery = false; bool flag = false; for (Match match = sqlTokenParser.Match(commandText); Match.Empty != match; match = match.NextMatch()) { if (!match.Groups[_commentGroup].Success) { if ((match.Groups[_identifierGroup].Success || match.Groups[_stringGroup].Success) || match.Groups[_otherGroup].Success) { flag = true; } else if (match.Groups[_queryGroup].Success) { if (!flag) { isQuery = true; } } else if (match.Groups[_parameterMarkerGroup].Success) { string parameterName = match.Groups[_parameterMarkerGroup].Value.Substring(1); this._usedParameterNames[parameterName] = null; int index = parameters.IndexOf(parameterName); if (0 > index) { string str2 = ":" + parameterName; index = parameters.IndexOf(str2); } if (0 <= index) { list.Add(new LocalParameter(index, match.Index, match.Length)); } } } } LocalParameter[] array = new LocalParameter[list.Count]; list.CopyTo(array, 0); return(array); }
public override int IndexOf(string parameterName) { return(parcol.IndexOf(parameterName)); }