public override void BeforePopulateProperty(ArgHook.HookContext context)
{
if (context.ArgumentValue == string.Empty)
{
var cli = new CliHelper();
ITabCompletionHandler tabHandler;
IHighlighterConfigurator highlighterConfigurator;
if (TabCompletionHandlerType.TryCreate<ITabCompletionHandler>(out tabHandler))
{
cli.Reader.TabHandler.TabCompletionHandlers.Add(tabHandler);
}
if (HighlighterConfiguratorType.TryCreate<IHighlighterConfigurator>(out highlighterConfigurator))
{
cli.Reader.Highlighter = new SimpleSyntaxHighlighter();
highlighterConfigurator.Configure(cli.Reader.Highlighter);
}
context.ArgumentValue = cli.PromptForLine("Enter value for " + context.CurrentArgument.DefaultAlias);
}
}