public void EmulteClickTest()
        {
            WPFMenuItem item = new WPFMenuItem(_ctrl._menuItem);

            item.EmulateClick();
            Assert.IsTrue((bool)_ctrl.menuItemClicked);
        }
 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();
 }
        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();
        }
        /// <summary>
        /// Creates and returns the menu items
        /// </summary>
        private List <WPFMenuItem> CreateMenus()
        {
            var menu = new List <WPFMenuItem>();


            var miEditCustomer = new WPFMenuItem("Edit Customer");

            miEditCustomer.Command = EditCustomerCommand;
            menu.Add(miEditCustomer);

            var miDeleteCustomer = new WPFMenuItem("Delete Customer");

            miDeleteCustomer.Command = DeleteCustomerCommand;
            menu.Add(miDeleteCustomer);

            return(menu);
        }
Beispiel #5
0
        /// <summary>
        /// Creates and returns the menu items
        /// </summary>
        private List <WPFMenuItem> CreateMenus()
        {
            var menu = new List <WPFMenuItem>();

            //create the File Menu
            var miFile = new WPFMenuItem("File");

            var miExit = new WPFMenuItem("Exit")
            {
                IconUrl = @"..\Images\Exit.png"
            };

            miExit.Command = ExitApplicationCommand;
            miFile.Children.Add(miExit);
            menu.Add(miFile);

            //create the Actions Menu
            var miActions = new WPFMenuItem("Actions");

            var miAddCustomer = new WPFMenuItem("Add Customer")
            {
                IconUrl = @"..\Images\Customers.png"
            };

            miAddCustomer.Command = AddCustomerCommand;
            miActions.Children.Add(miAddCustomer);

            var miSearchCustomers = new WPFMenuItem("Search Customers")
            {
                IconUrl = @"..\Images\Search.png"
            };

            miSearchCustomers.Command = SearchCustomersCommand;
            miActions.Children.Add(miSearchCustomers);

            menu.Add(miActions);


            return(menu);
        }
Beispiel #6
0
        /// <summary>
        /// 指定パスにあるフレーズ辞書を現在使用されているフレーズ辞書に統合します。
        /// 統合は後勝ちで実行されます。
        /// </summary>
        /// <param name="srcPdicPath"></param>
        public void MergePdicToCurrent(string srcPdicPath)
        {
            Async       async  = new Async();
            Async       async1 = new Async();
            WPFMenuItem mi     = new WPFMenuItem(rootControl.LogicalTree().ByType <MenuItem>().ByBinding("OptionsCommand").Single());

            mi.EmulateClick(async);
            WindowControl settingsWindow       = rootControl.WaitForNextModal();
            WPFButtonBase mergePhraseDicButton = new WPFButtonBase(settingsWindow.LogicalTree().ByType <Button>().ByBinding("MergePhraseDicCommand").Single());

            mergePhraseDicButton.EmulateClick(async1);
            WindowControl selectDialog = rootControl.WaitForNextModal();

            MergeFile(selectDialog, srcPdicPath);

            WindowControl resultDialog = settingsWindow.WaitForNextModal().WaitForNextModal();

            new NativeButton(resultDialog.IdentifyFromWindowText("OK")).EmulateClick();
            new WPFButtonBase(settingsWindow.LogicalTree().ByType <Button>().ByBinding("OkCommand").Single()).EmulateClick();
            async1.WaitForCompletion();
            async.WaitForCompletion();
        }
        public void TextTest()
        {
            WPFMenuItem item = new WPFMenuItem(_ctrl._menuItem);

            Assert.AreEqual("MenuItem", item.Text);
        }
 public void TextTest()
 {
     WPFMenuItem item = new WPFMenuItem(_ctrl._menuItem);
     Assert.AreEqual("MenuItem", item.Text);
 }
 public void EmulteClickTest()
 {
     WPFMenuItem item = new WPFMenuItem(_ctrl._menuItem);
     item.EmulateClick();
     Assert.IsTrue((bool)_ctrl.menuItemClicked);
 }