本文整理汇总了C#中Window.Exists方法的典型用法代码示例。如果您正苦于以下问题:C# Window.Exists方法的具体用法?C# Window.Exists怎么用?C# Window.Exists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Window
的用法示例。
在下文中一共展示了Window.Exists方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleDialog
public override bool HandleDialog(Window window)
{
if (!this.CanHandleDialog(window))
return false;
this._window = window;
while (window.Exists())
Thread.Sleep(200);
return true;
}
示例2: HandleDialog
public override bool HandleDialog(Window window)
{
if (CanHandleDialog(window))
{
_window = window;
while (window.Exists())
{
Thread.Sleep(200);
}
return true;
}
return false;
}
示例3: HandledDownloadProgressDialog
private bool HandledDownloadProgressDialog(Window window)
{
if (IsDownloadProgressDialog(window))
{
DownloadProgressDialog = window;
var openOrRun= new WinButton(4377, new Hwnd(window.Hwnd));
if (openOrRun.Enabled)
{
var close = new WinButton(2, new Hwnd(window.Hwnd));
close.Click();
var actionUntilTimeOut = new TryFuncUntilTimeOut(TimeSpan.FromSeconds(5));
actionUntilTimeOut.Try(() => window.Exists());
// TODO: What to do if the window doesn't close after timeout?
}
return true;
}
return false;
}
示例4: Exists
/// <summary>
/// Determines if a dialog still exists by checking the the existance of the
/// window.Hwnd and checking if the window is visible.
/// </summary>
/// <param name="dialog">The dialog.</param>
/// <returns><c>true</c> if exists and visible, otherwise <c>false</c></returns>
public bool Exists(Window dialog)
{
return dialog.Exists() && dialog.Visible;
}