本文整理汇总了C#中IExecutionContext.AddDialogHandler方法的典型用法代码示例。如果您正苦于以下问题:C# IExecutionContext.AddDialogHandler方法的具体用法?C# IExecutionContext.AddDialogHandler怎么用?C# IExecutionContext.AddDialogHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IExecutionContext
的用法示例。
在下文中一共展示了IExecutionContext.AddDialogHandler方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExecuteAttachDialogHandler
/// <summary>
/// Creates and Add to Browser a especific DialogHandler
/// </summary>
/// <param name="context"></param>
private void ExecuteAttachDialogHandler(IExecutionContext context)
{
switch(this.DialogType)
{
case DialogHandlerType.SimpleJavaAlert:
context.AddDialogHandler(this.dialogId, new WatiN.Core.DialogHandlers.AlertDialogHandler());
break;
case DialogHandlerType.ConfirmDialog:
context.AddDialogHandler(this.dialogId, new WatiN.Core.DialogHandlers.ConfirmDialogHandler());
break;
case DialogHandlerType.OkDialog:
context.AddDialogHandler(this.dialogId, new DialogHandlers.OKDialogHandler());
break;
default:
throw new ExecutionException(string.Format(CultureInfo.InvariantCulture, Resource.ExecuteAttachDialogHandlerInvalidValue, this.DialogType));
}
}
示例2: SetFileName
/// <summary>
/// Sets the <see cref="WatiN.Core.FileUpload.FileName">File name</see> for a file upload element
/// </summary>
/// <param name="context">The execution context used to execute this command</param>
private void SetFileName(IExecutionContext context)
{
context.AddDialogHandler("fileUploadDialog", new WatiN.Core.DialogHandlers.FileUploadDialogHandler(this.ValueToSet));
WatiN.Core.FileUpload fileUpload = (FileUpload) this.FindMethod.Execute(context);
fileUpload.Click();
}