Skip to content

Add with method #69

Description

@DinisCruz

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;
        }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions