Ejemplo n.º 1
0
        public int GetMaxNumberOfExecutions(Guid curDlid, IList <string> expressions)
        {
            int             result = 1;
            ErrorResultTO   errors;
            IBinaryDataList bdl = FetchBinaryDataList(curDlid, out errors);

            // Loop each expression to find the total number of executions ;)
            // ReSharper disable LoopCanBeConvertedToQuery
            foreach (var exp in expressions)
            // ReSharper restore LoopCanBeConvertedToQuery
            {
                IList <IIntellisenseResult> parts = Parser.ParseExpressionIntoParts(exp, bdl.FetchIntellisenseParts());
                // ReSharper disable LoopCanBeConvertedToQuery
                foreach (IIntellisenseResult p in parts)
                // ReSharper restore LoopCanBeConvertedToQuery
                {
                    result = Math.Max(result, FetchNumberOfExecutions(p, bdl));
                }
            }

            return(result);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Parses the token for match.
        /// </summary>
        /// <param name="exp">The exp.</param>
        /// <param name="canidateParts">The canidate parts.</param>
        /// <returns></returns>
        public IIntellisenseResult ParseTokenForMatch(string exp, IList <IDev2DataLanguageIntellisensePart> canidateParts)
        {
            IIntellisenseResult part;

            // first check part cache ;)
            if (!_partsCache.TryGetValue(exp, out part))
            {
                // if cache miss, find the part and cache ;)
                IList <IIntellisenseResult> parts = _parser.ParseExpressionIntoParts(exp, canidateParts);
                int pos = 0;
                while (pos < parts.Count && part == null)
                {
                    if (parts[pos].Option.DisplayValue.Equals(exp) && parts[pos].Type == enIntellisenseResultType.Selectable)
                    {
                        part             = parts[pos];
                        _partsCache[exp] = part; //stach in cache ;)
                    }

                    pos++;
                }
            }

            return(part);
        }