当前位置: 首页>>代码示例>>C#>>正文


C# Async.WaitForCompletion方法代码示例

本文整理汇总了C#中Codeer.Friendly.Async.WaitForCompletion方法的典型用法代码示例。如果您正苦于以下问题:C# Async.WaitForCompletion方法的具体用法?C# Async.WaitForCompletion怎么用?C# Async.WaitForCompletion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Codeer.Friendly.Async的用法示例。


在下文中一共展示了Async.WaitForCompletion方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestCellActivateAsync

		public void TestCellActivateAsync()
		{
			var async = new Async();

			_grid.Rows[ 0 ].Cells[ 1 ].EmulateActivate( async );
			async.WaitForCompletion();
			_grid.Rows[ 0 ].Cells[ 1 ].IsActive.IsTrue();
		}
开发者ID:Codeer-Software,项目名称:Friendly.MultiRow.Win,代码行数:8,代码来源:TestBase.cs

示例2: TestActivateAsync

 public void TestActivateAsync()
 {
     var panes = _dock.GetPanes();
     panes[0].EmulateActivate();
     var async = new Async();
     panes[1].EmulateActivate(async);
     async.WaitForCompletion();
     _dock.ActivePane.HeaderText.Is("Pane2");
 }
开发者ID:Codeer-Software,项目名称:Friendly.XamControls,代码行数:9,代码来源:XamDockManagerTest.cs

示例3: EmulteClickTestAsync

 public void EmulteClickTestAsync()
 {
     WPFMenuItem item = new WPFMenuItem(_ctrl._menuItemMessage);
     Async async = new Async();
     WindowControl windowControl = WindowControl.FromZTop(_app);
     item.EmulateClick(async);
     new NativeMessageBox(windowControl.WaitForNextModal()).EmulateButtonClick("OK");
     async.WaitForCompletion();
 }
开发者ID:Roommetro,项目名称:Friendly.WPFStandardControls,代码行数:9,代码来源:WPFMenuItemTest.cs

示例4: TestEmulateClickAsync

 public void TestEmulateClickAsync()
 {
     var item = _ribbon.ApplicationMenu.GetItem("b", "b-1", "b-1-1");
     ((bool)_dlg.Dynamic().b_1_1_clicked).IsFalse();
     Async a = new Async();
     item.EmulateClick(a);
     a.WaitForCompletion();
     ((bool)_dlg.Dynamic().b_1_1_clicked).IsTrue();
 }
开发者ID:Codeer-Software,项目名称:Friendly.XamControls,代码行数:9,代码来源:XamRibbonTest.cs

示例5: EmulteChangeSelectedAsyncTest

 public void EmulteChangeSelectedAsyncTest()
 {
     WPFTreeViewItem item = new WPFTreeViewItem(_ctrl._item1);
     Async async = new Async();
     WindowControl windowControl = WindowControl.FromZTop(_app);
     item.EmulateChangeSelected(true, async);
     new NativeMessageBox(windowControl.WaitForNextModal()).EmulateButtonClick("OK");
     async.WaitForCompletion();
 }
开发者ID:Roommetro,项目名称:Friendly.WPFStandardControls,代码行数:9,代码来源:WPFTreeViewItemTest.cs

示例6: TestNet

 public void TestNet()
 {
     Async async = new Async();
     app[typeof(MessageBox), "Show", async]("Message", "Title", MessageBoxButtons.OK, MessageBoxIcon.Information);
     NativeMessageBox msg = new NativeMessageBox(main.WaitForNextModal());
     Assert.AreEqual("Title", msg.Title);
     Assert.AreEqual("Message", msg.Message);
     msg.EmulateButtonClick("OK");
     async.WaitForCompletion();
 }
开发者ID:Codeer-Software,项目名称:Friendly.Windows.NativeStandardControls,代码行数:10,代码来源:NativeMessageBoxTest.cs

示例7: ButtonEntry_EmulateClickAndGetMessage

 public string ButtonEntry_EmulateClickAndGetMessage()
 {
     Async async = new Async();
     ButtonEntry.EmulateClick(async);
     var msgBox = new NativeMessageBox(Window.WaitForNextModal());
     var msg = msgBox.Message;
     msgBox.EmulateButtonClick("OK");
     async.WaitForCompletion();
     return msg;
 }
开发者ID:Codeer-Software,项目名称:HandsOn14-3,代码行数:10,代码来源:AddFormDriver.cs

示例8: TestEmulateCheckAsync

 public void TestEmulateCheckAsync()
 {
     _app.Type<WPFToggleButtonTest>().AddToggleEvent(_toggle.AppVar);
     Async async = new Async();
     WindowControl main = WindowControl.FromZTop(_app);
     _toggle.EmulateCheck(true, async);
     new NativeMessageBox(main.WaitForNextModal()).EmulateButtonClick("OK");
     async.WaitForCompletion();
     Assert.IsTrue((bool)_toggle.IsChecked);
 }
开发者ID:Roommetro,项目名称:Friendly.WPFStandardControls,代码行数:10,代码来源:WPFToggleButtonTest.cs

示例9: TestNative

 public void TestNative()
 {
     Async async = new Async();
     app[GetType(), "MessageBoxA", async](0, "Message", "Title", 0);
     NativeMessageBox msg = new NativeMessageBox(WindowControl.WaitForIdentifyFromWindowText(app, "Title"));
     Assert.AreEqual("Title", msg.Title);
     Assert.AreEqual("Message", msg.Message);
     msg.EmulateButtonClick("OK");
     async.WaitForCompletion();
 }
开发者ID:Codeer-Software,项目名称:Friendly.Windows.NativeStandardControls,代码行数:10,代码来源:NativeMessageBoxTest.cs

示例10: TestEmulateChangeValueAsync

        public void TestEmulateChangeValueAsync()
        {
            var slider = new WPFSlider(_target);

            _app[GetType(), "ChangeValueEvent"](slider.AppVar);
            var async = new Async();
            slider.EmulateChangeValue(TestValue, async);
            new NativeMessageBox(_mainWindow.WaitForNextModal()).EmulateButtonClick("OK");
            async.WaitForCompletion();
            Assert.AreEqual(TestValue, slider.Value);
        }
开发者ID:Roommetro,项目名称:Friendly.WPFStandardControls,代码行数:11,代码来源:WPFSliderTest.cs

示例11: SelectedIndexAsync

 public void SelectedIndexAsync()
 {
     app.Type<WPFListBoxTest>().AddSelectionEvent(listBox.AppVar);
     Async async = new Async();
     WindowControl main = WindowControl.FromZTop(app);
     listBox.EmulateChangeSelectedIndex(3, async);
     new NativeMessageBox(main.WaitForNextModal()).EmulateButtonClick("OK");
     async.WaitForCompletion();
     int index = listBox.SelectedIndex;
     Assert.AreEqual(3, index);
 }
开发者ID:Roommetro,项目名称:Friendly.WPFStandardControls,代码行数:11,代码来源:WPFListBoxTest.cs

示例12: Wpf

        public void Wpf()
        {
            var app = new WindowsAppFriend(Process.Start("Wpf.exe"));
            AppVar window = app.Type().System.Windows.Application.Current.MainWindow;
            var logicalTree = window.LogicalTree();
            var buttonModal = new WPFButtonBase(logicalTree.ByBinding("CommandModal").Single());
            var buttonModeless = new WPFButtonBase(logicalTree.ByBinding("CommandModeless").Single());

            //モーダレスは通常はそのままでOK
            buttonModeless.EmulateClick();
            var next = app.Type().System.Windows.Application.Current.Windows[1];
            next.Title = "aaa";

            //でもたまに変なことしているやつがいれば注意
            //まあ、こっち使った方が無難
            var nextW = WindowControl.WaitForIdentifyFromWindowText(app, "aaa");
            nextW.Dynamic().Close();

            //モーダルは要注意
            var current = new WindowControl(window);

            {
                var a = new Async();
                buttonModal.EmulateClick(a);
                var modal = current.WaitForNextModal();
                modal.Dynamic().Close();
                a.WaitForCompletion();
            }

            //連続で出るやつはもっと注意
            var buttonModalSequential = new WPFButtonBase(logicalTree.ByBinding("CommandModalSequential").Single());
            {
                var a = new Async();
                buttonModalSequential.EmulateClick(a);

                var modal1 = current.WaitForNextModal();
                modal1.Dynamic().Close();
                modal1.WaitForDestroy();

                var modal2 = current.WaitForNextModal();
                modal2.Dynamic().Close();
                modal2.WaitForDestroy();

                a.WaitForCompletion();
            }

            Process.GetProcessById(app.ProcessId).Kill();
        }
开发者ID:Ishikawa-Tatsuya,项目名称:AsiyanAutomationAlliance,代码行数:48,代码来源:画面遷移.cs

示例13: WindowsAppFriend

        public void Friendlyなめんなよ()
        {
            var app = new WindowsAppFriend(Process.Start("WinForms.exe"));
            var form = app.Type().System.Windows.Forms.Application.OpenForms[0];
            WindowsAppExpander.LoadAssembly(app, GetType().Assembly);

            var button = new FormsButton(form._buttonFile);
            var a = new Async();
            button.EmulateClick(a);
            var dlg = new WindowControl(form).WaitForNextModal();

            OpenFile(dlg, @"c:\TestData\data.txt");

            a.WaitForCompletion();
            Process.GetProcessById(app.ProcessId).Kill();
        }
开发者ID:Ishikawa-Tatsuya,项目名称:AsiyanAutomationAlliance,代码行数:16,代码来源:知らない画面は避ける.cs

示例14: TestExecutingExceptionNotComplate

        public void TestExecutingExceptionNotComplate()
        {
            WindowControl window = WindowControl.FromZTop(app);
            Async async = new Async();
            app[typeof(MessageBox), "Show", async]("");
            Assert.IsNull(async.ExecutingException);
            WindowControl next = window.WaitForNextModal();

            next.IdentifyFromZIndex(1).SetFocus();
            next.IdentifyFromZIndex(1).SequentialMessage(
                new MessageInfo(0x0201, 0x0001, 0),
                new MessageInfo(0x0202, 0x0000, 0));

            async.WaitForCompletion();
        }
开发者ID:Codeer-Software,项目名称:FriendlyBaseTest,代码行数:15,代码来源:TestAsyncInterface.cs

示例15: GetItemEmulateChangeSelectedAsync

 public void GetItemEmulateChangeSelectedAsync()
 {
     WindowControl windowControl = WindowControl.FromZTop(app);
     var item = listBox.GetItem(99);
     app.Type(GetType()).MessageBoxEvent(item);
     var a = new Async();
     item.EmulateChangeSelected(true, a);
     Assert.IsTrue(item.IsSelected);
     new NativeMessageBox(windowControl.WaitForNextModal()).EmulateButtonClick("OK");
     a.WaitForCompletion();
 }
开发者ID:Roommetro,项目名称:Friendly.WPFStandardControls,代码行数:11,代码来源:WPFListBoxTest.cs


注:本文中的Codeer.Friendly.Async.WaitForCompletion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。