mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-05 11:42:36 +00:00
Add GetText() sync method
This commit is contained in:
@@ -322,5 +322,14 @@ namespace CefSharp.WinForms
|
||||
managedCefBrowserAdapter.GetText(taskStringVisitor);
|
||||
return taskStringVisitor.Task;
|
||||
}
|
||||
|
||||
public string GetText()
|
||||
{
|
||||
var task = GetTextAsync();
|
||||
|
||||
task.Wait();
|
||||
|
||||
return task.Result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1127,5 +1127,14 @@ namespace CefSharp.Wpf
|
||||
managedCefBrowserAdapter.GetText(taskStringVisitor);
|
||||
return taskStringVisitor.Task;
|
||||
}
|
||||
|
||||
public string GetText()
|
||||
{
|
||||
var task = GetTextAsync();
|
||||
|
||||
task.Wait();
|
||||
|
||||
return task.Result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user