ExpectAction
Specifies behavior for expected expression.
using Renci.SshNet.Common;
using System;
using System.Text.RegularExpressions;
namespace Renci.SshNet
{
public class ExpectAction
{
public Regex Expect { get; set; }
public Action<string> Action { get; set; }
public ExpectAction(Regex expect, Action<string> action)
{
ThrowHelper.ThrowIfNull(expect, "expect");
ThrowHelper.ThrowIfNull(action, "action");
Expect = expect;
Action = action;
}
public ExpectAction(string expect, Action<string> action)
{
ThrowHelper.ThrowIfNull(expect, "expect");
ThrowHelper.ThrowIfNull(action, "action");
Expect = new Regex(Regex.Escape(expect));
Action = action;
}
}
}