http://stackoverflow.com/a/5964848/262379
/// <summary>
/// C# implementation of Visual Basics With statement
/// </summary>
public static void With<T>(this T _object, Action<T> _action)
{
_action(_object);
}
so that code like this is possible
public static API_Web login(this API_Web api_Web, string username, string password)
{
api_Web.ie.with( (ie) =>
{
ie.field("txtUserName").value(username);
ie.field("txtPassword").value(password);
ie.button("Login").click();
});
return api_Web;
}
http://stackoverflow.com/a/5964848/262379
so that code like this is possible