Add GetText() sync method

This commit is contained in:
amaitland
2014-05-29 13:03:55 +10:00
parent ab2822c798
commit 9369967c7f
3 changed files with 24 additions and 0 deletions
+9
View File
@@ -322,5 +322,14 @@ namespace CefSharp.WinForms
managedCefBrowserAdapter.GetText(taskStringVisitor);
return taskStringVisitor.Task;
}
public string GetText()
{
var task = GetTextAsync();
task.Wait();
return task.Result;
}
}
}
+9
View File
@@ -1127,5 +1127,14 @@ namespace CefSharp.Wpf
managedCefBrowserAdapter.GetText(taskStringVisitor);
return taskStringVisitor.Task;
}
public string GetText()
{
var task = GetTextAsync();
task.Wait();
return task.Result;
}
}
}
+6
View File
@@ -146,5 +146,11 @@ namespace CefSharp
/// </summary>
/// <returns><see cref="Task{String}"/> that when executed returns the frame display text as a string.</returns>
Task<string> GetTextAsync();
/// <summary>
/// Retrieve the main frame's display text.
/// </summary>
/// <returns>The main frame display text as a string.</returns>
string GetText();
}
}