Пример #1
0
        static public T ReadLines <T>(this StreamSystem item, string path, Operation <T, IEnumerable <string> > operation, long milliseconds = StreamSystem.DEFAULT_WAIT)
        {
            T output;

            item.AttemptReadLines <T>(path, operation, out output, milliseconds);
            return(output);
        }
Пример #2
0
        static public AttemptResult AttemptReadLines <T>(this StreamSystem item, string path, Operation <T, IEnumerable <string> > operation, out T output, long milliseconds = StreamSystem.DEFAULT_WAIT)
        {
            T             temp   = default(T);
            AttemptResult result = item.AttemptReadLines(path, delegate(IEnumerable <string> lines) {
                temp = operation(lines);
            }, milliseconds);

            if (result.IsDesired())
            {
                output = temp;
            }
            else
            {
                output = default(T);
            }

            return(result);
        }