예제 #1
0
        static public T ReadText <T>(this StreamSystem item, string path, Operation <T, string> operation, long milliseconds = StreamSystem.DEFAULT_WAIT)
        {
            T output;

            item.AttemptReadText <T>(path, operation, out output, milliseconds);
            return(output);
        }
예제 #2
0
        static public string ReadText(this StreamSystem item, string path, long milliseconds = StreamSystem.DEFAULT_WAIT)
        {
            string output;

            item.AttemptReadText(path, out output, milliseconds);
            return(output);
        }
예제 #3
0
        static public AttemptResult AttemptReadText <T>(this StreamSystem item, string path, Operation <T, string> operation, out T output, long milliseconds = StreamSystem.DEFAULT_WAIT)
        {
            T             temp   = default(T);
            AttemptResult result = item.AttemptReadText(path, delegate(string text) {
                temp = operation(text);
            }, milliseconds);

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

            return(result);
        }