internal static pathResolverResult resolvePathSegments(this object source, string path,
                                                               pathResolveFlag _flagList)
        {
            string _path = path;

            //  pathResolveFlags flags = _flagList;

            pathSegments pathSeg = new pathSegments(_path, _flagList);

            pathResolverResult output = resolvePathSegments(source, pathSeg, _flagList);

            return(output);
        }
        /// <summary>
        /// Izvrsava kolekciju path segmenata nad prosledjenim objektom
        /// </summary>
        /// <param name="source"></param>
        /// <param name="segments"></param>
        /// <param name="_flagList"></param>
        /// <returns></returns>
        internal static pathResolverResult resolvePathSegments(this object source, pathSegments segments,
                                                               pathResolveFlag _flagList)
        {
            pathResolveFlag flags = _flagList;

            pathResolverResult output = new pathResolverResult();

            output.parent = source as IObjectWithPath;

            output.segments = segments;
            output.path     = segments.path;

            object result     = source;
            object lastResult = source;

            output.missing = new pathSegments();

            pathSegment ps = segments.First();
            int         i  = 0;

            do
            {
                ps     = segments[i];
                result = result.resolvePathSegment(ps, flags);
                if (result == null)
                {
                    output.missing = segments.getSegmentsAfterThis(ps, true);
                    break;
                }
                else
                {
                    lastResult = result;
                }
                i++;
            } while (i < segments.Count);

            if (lastResult != null)
            {
                output.nodeFound.Add(lastResult);
            }

            //foreach (pathSegment ps in segments)
            //{
            //    if (result != null)
            //    {
            //        lastResult = result;

            //    } else
            //    {
            //        output.missing = segments.getSegmentsAfterThis(ps, true);

            //        break;
            //    }
            //}*/
            //if (result != null)
            //{
            //} else if (lastResult != null)
            //{
            //    output.nodeFound.Add(lastResult);
            //}
            return(output);
        }