ALE.FileSystem.File.ReadAllText C# (CSharp) Method

ReadAllText() public static method

public static ReadAllText ( string path, Encoding encoding, string>.Action callback ) : void
path string
encoding System.Text.Encoding
callback string>.Action
return void
        public static void ReadAllText(string path, Encoding encoding, Action<Exception, string> callback)
        {
            if (callback == null) throw new ArgumentNullException("callback");
            if (encoding == null) throw new ArgumentNullException("encoding");
            FileReadAllAsync(path, (ex, buffer) =>
                                                {
                                                    try
                                                    {
                                                        if (ex != null) throw ex;
                                                        var text = encoding.GetString(buffer);
                                                        EventLoop.Pend(() => callback(null, text));
                                                    } catch (Exception ex2)
                                                    {
                                                        EventLoop.Pend(() => callback(ex2, null));
                                                    }
                                                });
        }

Same methods

File::ReadAllText ( string path, string>.Action callback ) : void