Ejemplo n.º 1
0
        //点击菜单
        void btnmenu_Click(object sender, EventArgs e)
        {
            btnImage = sender;
            BaseItem baseItem = sender as BaseItem;

            if (baseItem.Tag.ToString() != "" && baseItem.Tag.GetType() != typeof(BaseModule))
            {
                BaseMenu menu = (BaseMenu)baseItem.Tag;

                WinMenu winmenu = new WinMenu();
                winmenu.PluginName = menu.DllName;
                winmenu.ControllerName = menu.FunName;

                //winmenu.DllName = menu.DllName;
                //winmenu.FunName = menu.FunName;
                winmenu.IsOutlookBar = menu.MenuLookBar;
                winmenu.IsToolBar = menu.MenuToolBar;
                winmenu.Memo = menu.Memo;
                winmenu.MenuId = menu.MenuId;
                winmenu.ModuleId = menu.ModuleId;
                winmenu.Name = menu.Name;
                winmenu.PMenuId = menu.PMenuId;
                winmenu.SortId = menu.SortId;
                winmenu.UrlPath = InvokeController("GetWebserverUrl").ToString() + menu.UrlName;

                ShowForm(winmenu);
            }
        }
Ejemplo n.º 2
0
        public void ShowForm(WinMenu menu)
        {
            Form form = null;

            if (string.IsNullOrEmpty(menu.PluginName) == false && string.IsNullOrEmpty(menu.ControllerName) == false)
            {
                string controllername = menu.ControllerName.Split(new char[] { '|' })[0];
                string viewname       = menu.ControllerName.Split(new char[] { '|' }).Length > 1 ? menu.ControllerName.Split(new char[] { '|' })[1] : null;

                if (AppGlobal.appType == AppType.Winform)
                {
                    WinformController basec = ControllerHelper.CreateController(menu.PluginName + "@" + controllername);
                    if (string.IsNullOrEmpty(viewname))
                    {
                        form = (Form)basec.DefaultView;
                    }
                    else
                    {
                        form = (Form)basec.iBaseView[viewname];
                    }
                }
            }
            string tabId = "view" + form.GetHashCode();

            ShowForm(form, menu.Name, tabId);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 消息
 /// </summary>
 public Messages()
 {
     this._typeCode    = "";
     this._titleText   = "";
     this._contentText = "";
     _showMenu         = null;
 }
Ejemplo n.º 4
0
        public static void DelteteDataGridViewByIndex(string[] data)
        {
            WinTable table = (WinTable)Robot.FindWinControl(typeof(WinTable), data[0], _root);
            WinRow   row   = new WinRow(table);

            if (data[3] == string.Empty)
            {
                Mouse.Click(table, System.Windows.Forms.MouseButtons.Right);
            }
            else
            {
                row.SearchProperties.Add(WinRow.PropertyNames.RowIndex, data[3]);
                row.Find();
                UITestControlCollection collection = row.GetChildren();
                Mouse.Click(collection[0]);
                Mouse.Click(collection[0], System.Windows.Forms.MouseButtons.Right);
            }
            WinWindow window = new WinWindow();
            WinMenu   menu   = new WinMenu(window);

            menu.SearchProperties[WinMenu.PropertyNames.Name] = data[1];
            WinMenuItem item = new WinMenuItem(menu);

            item.SearchProperties[WinMenuItem.PropertyNames.Name] = data[2];
            Mouse.Click(item);
        }
Ejemplo n.º 5
0
        // Event handler for RLNET's Render event
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            if (_renderRequired)
            {
                _mapConsole.Clear();
                _statConsole.Clear();
                _messageConsole.Clear();

                DungeonMap.Draw(_mapConsole, _statConsole);
                Player.Draw(_mapConsole);
                Player.DrawStats(_statConsole);
                MessageLog.Draw(_messageConsole);


                if (!Globals.BuildingEntranceIsTriggered && !Globals.IsPlayerDead && !Globals.IsBossDead)
                {
                    // Blit the sub consoles to the root console in the correct locations
                    RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight,
                                   _rootConsole, 0, 0);
                    RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight,
                                   _rootConsole, _mapWidth, 0);
                    RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight,
                                   _rootConsole, 0, _screenHeight - _messageHeight);
                }
                else if (Globals.BuildingEntranceIsTriggered)
                {
                    if (Globals.SheriffTriggered)
                    {
                        QuestMenu.CreateQuestMenu(_rootConsole);
                    }
                    else if (Globals.GenericMenuTriggered)
                    {
                        Menu.CreateMenu(_rootConsole);
                    }
                    else
                    {
                        Globals.BuildingEntranceIsTriggered = false;
                    }
                }
                else if (Globals.IsBossDead)
                {
                    WinMenu.CreateWinScreen(_rootConsole);
                }
                else if (Globals.IsPlayerDead)
                {
                    if (Player.Health <= 0)
                    {
                        DeathScreen.CreateDeathScreen(_rootConsole);
                    }
                    else
                    {
                        Globals.IsPlayerDead = false;
                    }
                }
                // Tell RLNET to draw the console that we set
                _rootConsole.Draw();
                _renderRequired = false;
            }
        }
Ejemplo n.º 6
0
        private static WinMenu GetWinMenu(string uiTitle, string uiType)
        {
            var htmlcontrolWin = new WinMenu(Window.Locate(uiTitle, uiType, false));
            var htmlControlWin = htmlcontrolWin;

            htmlControlWin.TechnologyName = TechnologyNameWin;
            return(htmlControlWin);
        }
Ejemplo n.º 7
0
    protected override void Awake()
    {
        base.Awake();
        this.defaultActive = false;

        // Find the single WinMenu object by tag
        instance = GameObject.FindGameObjectsWithTag("WinMenu")[0].GetComponent <WinMenu>();
    }
Ejemplo n.º 8
0
        public static WinMenu GetContextMenu(string controlName = "", string windowTitle = "Image-Pro")
        {
            WinMenu menu = new WinMenu();

            menu.WindowTitles.Add(windowTitle);

            return((WinMenu)menu.FindMatchingControls()[0]);
        }
Ejemplo n.º 9
0
    public void Menu(int n)
    {
        switch (n)
        {
        case 0:
            FrontMenu.SetActive(true);
            About.SetActive(false);
            InternetError.SetActive(false);
            LogIn.SetActive(false);
            WinMenu.SetActive(false);
            PlaceHolder.color = Color.yellow;
            break;

        case 1:
            FrontMenu.SetActive(false);
            LogIn.SetActive(true);
            break;

        case 11:
            if (Application.internetReachability == NetworkReachability.NotReachable)
            {
                LogIn.SetActive(false);
                InternetError.SetActive(true);
            }
            else
            {
                if (PlayerName.text != "")
                {
                    gameManager.PlayerName = PlayerName.text;
                    SceneManager.LoadScene("Bakalaurinis");
                }
                else
                {
                    PlaceHolder.color = Color.red;
                }
            }
            break;

        case 2:
            FrontMenu.SetActive(false);
            About.SetActive(true);
            break;

        case 3:
            Application.Quit();
            break;

        case 4:
            FrontMenu.SetActive(false);
            InternetError.SetActive(true);
            break;

        case 5:
            FrontMenu.SetActive(false);
            WinMenu.SetActive(true);
            break;
        }
    }
Ejemplo n.º 10
0
        /// <summary>
        ///     Tells if a Menu is empty or not.
        /// </summary>
        /// <exception cref="ArgumentNullException">menu</exception>
        public static bool IsEmpty(this WinMenu menu)
        {
            if (menu == null)
            {
                throw new ArgumentNullException("menu");
            }

            return(menu.Items.Count == 0);
        }
Ejemplo n.º 11
0
    private void Start()
    {
        if (winMenu == null)
        {
            winMenu = FindObjectOfType <WinMenu>();
        }

        // winMenu.gameObject.SetActive(false);
    }
Ejemplo n.º 12
0
        IEnumerator EndLevelTransitionRoutine()
        {
            TransitionFader.CreateAndPlayTransition(_endLevelTransitionPrefab);
            float fadeDelay = (_endLevelTransitionPrefab != null) ?
                              _endLevelTransitionPrefab.Delay + _endLevelTransitionPrefab.FadeOnDuration :
                              0f;

            yield return(new WaitForSeconds(fadeDelay));

            WinMenu.Open();
        }
Ejemplo n.º 13
0
    public void PlayerWon(int playerId)
    {
        Time.timeScale = 0;
        if (winMenu == null)
        {
            winMenu = GameObject.FindGameObjectWithTag("WinMenu");
        }
        winMenu.SetActive(true);
        WinMenu winMenuScript = winMenu.GetComponent <WinMenu> ();

        winMenuScript.SetWinner("Winner : Player " + (playerId + 1));
    }
Ejemplo n.º 14
0
 private void resetPanelosition()
 {
     cameraMenu.GetComponent <RectTransform>().anchoredPosition    = Vector2.zero;
     cameraOptions.GetComponent <RectTransform>().anchoredPosition = Vector2.zero;
     cameraGame.GetComponent <RectTransform>().anchoredPosition    = Vector2.zero;
     pauseMenu.GetComponent <RectTransform>().anchoredPosition     = Vector2.zero;
     WinMenu.GetComponent <RectTransform>().anchoredPosition       = Vector2.zero;
     LoseMenu.GetComponent <RectTransform>().anchoredPosition      = Vector2.zero;
     pauseMenu.SetActive(false);
     WinMenu.SetActive(false);
     LoseMenu.SetActive(false);
 }
Ejemplo n.º 15
0
        /// <summary>
        /// clickAction
        /// </summary>
        public void clickAction()
        {
            #region Variable Declarations
            WinButton uIДействияButton1  = this.UIКвазарWindow.UIРеестрпациентовWindow.UIДействияButton.UIДействияButton1;
            WinMenu   uIPopupControlMenu = this.UIActions0Window.UIPopupControlWindow.UIPopupControlMenu;
            #endregion

            // Щелкните "Действия" кнопка
            Mouse.Click(uIДействияButton1);

            // Щелкните "PopupControl" всплывающее меню
            Mouse.Click(new Point(360, 900));
        }
Ejemplo n.º 16
0
 private void btnMenu_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         WinMenu win = new WinMenu();
         win.Show();
         win.WindowState = WindowState.Maximized;
         this.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Ejemplo n.º 17
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public bool CheckRecordedMacroExists(string name)
        {
            ProjectExplorerSplitButton.Click();

            WinMenu uiContextMenu = new WinMenu(this);

            uiContextMenu.WindowTitles.Add("Image-Pro");
            Console.WriteLine("Check Recorded Macro: " + name);

            WinMenuItem UIMenuItem = new WinMenuItem(uiContextMenu);

            UIMenuItem.SearchProperties[UITestControl.PropertyNames.Name] = name;
            return(UIMenuItem.Exists);
        }
        /// <summary>
        /// Check and Click given menu item
        /// </summary>
        /// <param name="menu"></param>
        /// <param name="menuName"></param>
        public static void SelectMenuItem(this WinMenu menu, string menuName)
        {
            //var items = menu.GetChildren();
            //foreach (WinMenuItem item in items)
            //{
            //    if (item.DisplayText == menuName)
            //    {
            //        item.Click();
            //        break;
            //    }
            //}

            menu.SelectMenuItem(menuName, true);
        }
Ejemplo n.º 19
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="name"></param>
        public void SelectRecordedMacro(string name)
        {
            Console.WriteLine("Open Recorded Macro: " + name);
            ProjectExplorerSplitButton.Click();

            WinMenu uiContextMenu = new WinMenu(this);

            uiContextMenu.WindowTitles.Add("Image-Pro");


            WinMenuItem UIMenuItem = new WinMenuItem(uiContextMenu);

            UIMenuItem.SearchProperties[UITestControl.PropertyNames.Name] = name;
            UIMenuItem.Click();
        }
Ejemplo n.º 20
0
 private void OnTriggerEnter(Collider collider)
 {
     // Handle when we complete a lap
     if (collider.GetComponent <FinishLine>() != null)
     {
         this.laps++;
         if (this.laps > maxLaps)
         {
             WinMenu.HandleWin(this.ElapsedTime);
         }
         else
         {
             HUD.UpdateLaps(this.laps, maxLaps);
         }
     }
 }
Ejemplo n.º 21
0
        public static void Main()
        {
            // This must be the exact name of the bitmap font file we are using or it will error.
            string fontFileName = "terminal8x8.png";
            // The title will appear at the top of the console window
            string consoleTitle = "Hunter v0.0";


            // Tell RLNet to use the bitmap font that we specified and that each tile is 8 x 8 pixels
            _rootConsole = new RLRootConsole(fontFileName, _screenWidth, _screenHeight,
                                             8, 8, 1f, consoleTitle);

            // Initialize the sub consoles that we will Blit to the root console
            _mapConsole     = new RLConsole(_mapWidth, _mapHeight);
            _messageConsole = new RLConsole(_messageWidth, _messageHeight);
            _statConsole    = new RLConsole(_statWidth, _statHeight);

            Player           = new Player();
            CommandSystem    = new CommandSystem();
            QuestMenu        = new QuestMenu(_menuWidth, _menuHeight);
            DeathScreen      = new DeathScreen(_menuWidth, _menuHeight);
            WinMenu          = new WinMenu(_menuWidth, _menuHeight);
            Menu             = new Menu(_menuWidth, _menuHeight);
            SchedulingSystem = new SchedulingSystem();

            // Create a new MessageLog and print the random seed used to generate the level
            MessageLog = new MessageLog();
            MessageLog.Add("The rogue arrives on level 1");
            MessageLog.Add("Prepare to fight for your life");

            //Generate the map
            TownMap mapCreation = new TownMap(_mapWidth, _mapHeight);

            //SimpleBsp mapCreation = new SimpleBsp(_mapWidth, _mapHeight);
            //FullRoomBsp mapCreation = new FullRoomBsp(_mapWidth, _mapHeight);

            DungeonMap = mapCreation.CreateMap();
            DungeonMap.UpdatePlayerFieldOfView();


            // Set up a handler for RLNET's Update event
            _rootConsole.Update += OnRootConsoleUpdate;
            // Set up a handler for RLNET's Render event
            _rootConsole.Render += OnRootConsoleRender;
            // Begin RLNET's game loop
            _rootConsole.Run();
        }
        /// <summary>
        /// Check if the menu item exists or not
        /// </summary>
        /// <param name="menu">Parent Menu (Context menu) contorl</param>
        /// <param name="menuName">Display name of menu item</param>
        /// <returns>True if Menu item exists else False</returns>
        public static bool CheckMenuItemExits(this WinMenu menu, string menuName)
        {
            bool exists = false;
            var  items  = menu.GetChildren();

            foreach (var uiTestControl in items)
            {
                var item = (WinMenuItem)uiTestControl;
                if (item.DisplayText == menuName)
                {
                    exists = true;
                    break;
                }
            }

            return(exists);
        }
Ejemplo n.º 23
0
        public void ShowForm(WinMenu menu)
        {
            Form form = null;

            if (string.IsNullOrEmpty(menu.PluginName) == false && string.IsNullOrEmpty(menu.ControllerName) == false)
            {
                string controllername = menu.ControllerName.Split(new char[] { '|' })[0];
                string viewname       = menu.ControllerName.Split(new char[] { '|' }).Length > 1 ? menu.ControllerName.Split(new char[] { '|' })[1] : null;
                if (controllername.Trim() == "")
                {
                    throw new Exception("菜单没有配置好!");
                }

                if (AppGlobal.appType == AppType.Winform)
                {
#if WinformFrame
                    WinformController basec = ControllerHelper.CreateController(menu.PluginName + "@" + controllername);
                    if (string.IsNullOrEmpty(viewname))
                    {
                        form = (Form)basec.DefaultView;
                    }
                    else
                    {
                        form = (Form)basec.iBaseView[viewname];
                    }
#endif
                }
                else if (AppGlobal.appType == AppType.WCFClient)
                {
#if WcfFrame
                    EFWCoreLib.WcfFrame.ClientController.WcfClientController basec = EFWCoreLib.WcfFrame.ClientController.ControllerHelper.CreateController(menu.PluginName + "@" + controllername);
                    if (string.IsNullOrEmpty(viewname))
                    {
                        form = (Form)basec.DefaultView;
                    }
                    else
                    {
                        form = (Form)basec.iBaseView[viewname];
                    }
#endif
                }
            }

            ShowForm(form, menu.Name, menu.MenuId.ToString());
        }
Ejemplo n.º 24
0
    private void Start()
    {
        settings = FindObjectOfType <GameSettings>();

        loseMenu = FindObjectOfType <LoseMenu>();
        winMenu  = FindObjectOfType <WinMenu>();
        quitMenu = FindObjectOfType <QuitMenu>();

        numberOfEnemies = FindObjectsOfType <SmartEnemy>().Length;
        enemiesLeft     = numberOfEnemies;

        foreach (ParticleSystem ps in FindObjectsOfType(typeof(ParticleSystem)))
        {
            ps.Stop();
        }

        CallSettings();
    }
Ejemplo n.º 25
0
        //点击菜单
        void btnmenu_Click(object sender, EventArgs e)
        {
            btnImage = sender;
            BaseItem baseItem = sender as BaseItem;

            if (baseItem.Tag.ToString() != "" && baseItem.Tag.GetType() != typeof(BaseModule))
            {
                BaseMenu menu = (BaseMenu)baseItem.Tag;

                WinMenu winmenu = new WinMenu();
                if (AppGlobal.appType == AppType.Winform)
                {
                    winmenu.PluginName     = menu.DllName;
                    winmenu.ControllerName = menu.FunName;
                }
                //else if (AppGlobal.appType == AppType.WCFClient)
                //{
                //    if (!string.IsNullOrEmpty(menu.FunWcfName))
                //    {
                //        winmenu.PluginName = menu.FunWcfName.Split('@')[0];
                //        winmenu.ControllerName = menu.FunWcfName.Split('@')[1];
                //    }
                //}
                //else if (Program.clienttype == "WEBClient")
                //{
                //    winmenu.DllName = "";
                //    winmenu.FunName = "";
                //}

                //winmenu.DllName = menu.DllName;
                //winmenu.FunName = menu.FunName;
                winmenu.IsOutlookBar = menu.MenuLookBar;
                winmenu.IsToolBar    = menu.MenuToolBar;
                winmenu.Memo         = menu.Memo;
                winmenu.MenuId       = menu.MenuId;
                winmenu.ModuleId     = menu.ModuleId;
                winmenu.Name         = menu.Name;
                winmenu.PMenuId      = menu.PMenuId;
                winmenu.SortId       = menu.SortId;
                winmenu.UrlPath      = InvokeController("GetWebserverUrl").ToString() + menu.UrlName;

                ShowForm(winmenu);
            }
        }
Ejemplo n.º 26
0
    void Start()
    {
        m_CountdownAnimation.SetActive(true);
        StartCoroutine("Countdown");

        m_AudioManager = GameObject.FindGameObjectWithTag("AudioManager").GetComponent <AudioManager>();
        m_Camera       = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <ScreenShake>();

        m_LivesTextP1      = GameObject.FindGameObjectWithTag("LivesTextP1").GetComponent <Text>();
        m_LivesTextP2      = GameObject.FindGameObjectWithTag("LivesTextP2").GetComponent <Text>();
        m_LivesP1          = m_MaxPlayerLives;
        m_LivesP2          = m_MaxPlayerLives;
        m_LivesTextP1.text = "P1: " + m_LivesP1.ToString() + "/" + m_MaxPlayerLives.ToString();
        m_LivesTextP2.text = "P2: " + m_LivesP2.ToString() + "/" + m_MaxPlayerLives.ToString();

        m_PauseMenu         = GetComponent <PauseMenu>();
        m_WinMenu           = GetComponent <WinMenu>();
        m_PauseMenu.enabled = false;
    }
Ejemplo n.º 27
0
        public static void OpenMenuInFilmHireGrid(string cellValue, string rowNumber = "Row 1")
        {
            var rowWithCell = new WinRow(WindowFilmHire());
            rowWithCell.SearchProperties[UITestControl.PropertyNames.Name] = rowNumber;

            var cellToInteract = new WinCell(rowWithCell);
            cellToInteract.SearchProperties[WinCell.PropertyNames.Value] = cellValue;

            var menuWindow = new WinWindow();
            menuWindow.SearchProperties[WinWindow.PropertyNames.AccessibleName] = "DropDown";

            var menu = new WinMenu(menuWindow);
            menu.SearchProperties[UITestControl.PropertyNames.Name] = "DropDown";

            var menuItem = new WinMenuItem(menu);
            menuItem.SearchProperties[UITestControl.PropertyNames.Name] = "Contract Details...";

            Mouse.Click(cellToInteract, MouseButtons.Right);
            Mouse.Click(menuItem);
        }
Ejemplo n.º 28
0
        /// <summary>
        /// RecordedMethod2 - Use 'RecordedMethod2Params' to pass parameters into this method.
        /// </summary>
        public void RecordedMethod2()
        {
            #region Variable Declarations
            WinPane    uIIndexMyASPNETApplicaPane     = this.UIIndexMyASPNETApplicaWindow.UIIndexMyASPNETApplicaPane;
            WinPane    uICreateMyASPNETApplicPane     = this.UIIndexMyASPNETApplicaWindow.UICreateMyASPNETApplicPane;
            WinMenu    uIAutouzupełnianieMenu         = this.UIItemWindow1.UIItemClient.UIAutouzupełnianieMenu;
            WinControl uICreateMyASPNETApplicDocument = this.UIIndexMyASPNETApplicaWindow.UIChromeLegacyWindowWindow.UICreateMyASPNETApplicDocument;
            #endregion

            // Click 'Index - My ASP.NET Application - Google Chrome' pane
            Mouse.Click(uIIndexMyASPNETApplicaPane, new Point(895, 109));

            // Click 'Index - My ASP.NET Application - Google Chrome' pane
            Mouse.Click(uIIndexMyASPNETApplicaPane, new Point(457, 209));

            // Click 'Create - My ASP.NET Application - Google Chrome' pane
            Mouse.Click(uICreateMyASPNETApplicPane, new Point(606, 277));

            // Type 'title{Tab}' in 'Autouzupełnianie' popup menu
            Keyboard.SendKeys(uIAutouzupełnianieMenu, this.RecordedMethod2Params.UIAutouzupełnianieMenuSendKeys, ModifierKeys.None);

            // Type 'd' in 'Create - My ASP.NET Application - Google Chrome' document
            Keyboard.SendKeys(uICreateMyASPNETApplicDocument, this.RecordedMethod2Params.UICreateMyASPNETApplicDocumentSendKeys, ModifierKeys.None);

            // Type 'esci' in 'Autouzupełnianie' popup menu
            Keyboard.SendKeys(uIAutouzupełnianieMenu, this.RecordedMethod2Params.UIAutouzupełnianieMenuSendKeys1, ModifierKeys.None);

            // Type '{Back}' in 'Create - My ASP.NET Application - Google Chrome' document
            Keyboard.SendKeys(uICreateMyASPNETApplicDocument, this.RecordedMethod2Params.UICreateMyASPNETApplicDocumentSendKeys1, ModifierKeys.None);

            // Type 'r' in 'Autouzupełnianie' popup menu
            Keyboard.SendKeys(uIAutouzupełnianieMenu, this.RecordedMethod2Params.UIAutouzupełnianieMenuSendKeys2, ModifierKeys.None);

            // Type 'iption' in 'Create - My ASP.NET Application - Google Chrome' document
            Keyboard.SendKeys(uICreateMyASPNETApplicDocument, this.RecordedMethod2Params.UICreateMyASPNETApplicDocumentSendKeys2, ModifierKeys.None);

            // Click 'Create - My ASP.NET Application - Google Chrome' pane
            Mouse.Click(uICreateMyASPNETApplicPane, new Point(627, 374));
        }
Ejemplo n.º 29
0
 protected override void Initialize()
 {
     MainMenu = new MainMenu();
     MainMenu.Initialise(Content, graphics, this);
     LoseMenu = new LoseMenu();
     LoseMenu.Initialise(Content, this, graphics);
     WinMenu = new WinMenu();
     WinMenu.Initialise(Content, this, graphics);
     ChampionMenu = new ChampionMenu();
     ChampionMenu.Initialise(Content, this, graphics);
     InPlayMenu = new InPlayMenu();
     InPlayMenu.Initialise(Content, this, graphics);
     GameState           = 1;
     Points              = 0;
     RunThroughTheJungle = Content.Load <Song>("RunThroughTheJungle");
     SuzieQ              = Content.Load <Song>("SuzieQ");
     CurrentSong         = RunThroughTheJungle;
     SongDuration        = (float)RunThroughTheJungle.Duration.TotalSeconds;
     CurrentSongTime     = 0f;
     SongStarted         = true;
     MediaPlayer.Volume  = 0.1f;
     base.Initialize();
 }
Ejemplo n.º 30
0
        public void ShowForm(WinMenu menu)
        {
            Form form = null;
            if (string.IsNullOrEmpty(menu.PluginName) == false && string.IsNullOrEmpty(menu.ControllerName) == false)
            {
                string controllername = menu.ControllerName.Split(new char[] { '|' })[0];
                string viewname = menu.ControllerName.Split(new char[] { '|' }).Length > 1 ? menu.ControllerName.Split(new char[] { '|' })[1] : null;
                if (controllername.Trim() == "") throw new Exception("配置的菜单不存在!");

                WinformController basec = ControllerHelper.CreateController(controllername);
                if(basec==null)
                    throw new Exception("配置的菜单不存在!");
                if (string.IsNullOrEmpty(viewname))
                    form = (Form)basec.DefaultView;
                else {
                    if (basec.iBaseView.ContainsKey(viewname) == false)
                        throw new Exception("配置的菜单不存在!");
                    form = (Form)basec.iBaseView[viewname];
                }
            }
            string tabId = "view" + form.GetHashCode();
            ShowForm(form, menu.Name, tabId);
        }
Ejemplo n.º 31
0
        public void ShowForm(WinMenu menu)
        {
            Form form = null;

            if (string.IsNullOrEmpty(menu.PluginName) == false && string.IsNullOrEmpty(menu.ControllerName) == false)
            {
                string controllername = menu.ControllerName.Split(new char[] { '|' })[0];
                string viewname       = menu.ControllerName.Split(new char[] { '|' }).Length > 1 ? menu.ControllerName.Split(new char[] { '|' })[1] : null;
                if (controllername.Trim() == "")
                {
                    throw new Exception("菜单没有配置好!");
                }

                if (AppGlobal.appType == AppType.Winform)
                {
                    WinformController basec = ControllerHelper.CreateController(menu.PluginName + "@" + controllername);
                    if (string.IsNullOrEmpty(viewname))
                    {
                        form = (Form)basec.DefaultView;
                    }
                    else
                    {
                        form = (Form)basec.iBaseView[viewname];
                    }
                }
            }
            else if (string.IsNullOrEmpty(menu.UrlPath) == false)//打开浏览器
            {
                WinformController basec = ControllerHelper.CreateController("MainFrame.UI@wcfclientLoginController");
                form = (Form)basec.iBaseView["FrmWebBrowser"];
                (form as IfrmWebBrowserView).Url = menu.UrlPath;
                (form as IfrmWebBrowserView).NavigateUrl();
            }
            string tabId = "view" + form.GetHashCode();

            ShowForm(form, menu.Name, tabId);
        }
Ejemplo n.º 32
0
        public string GridExport(string GridName, string WhenExported)
        {
            string Fileoutput = String.Empty;
            Trace.WriteLine("Inside GridExport method , waiting");
            System.Threading.Thread.Sleep(5000);
            WinWindow ItemWindow = new WinWindow(GetMainWindow());
            ItemWindow.SearchProperties[WinWindow.PropertyNames.ClassName] = "#32770";
            ItemWindow.SearchProperties[WinWindow.PropertyNames.Instance] = "45";
            ItemWindow.WindowTitles.Add(new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString());

            WinControl ItemDialog = new WinControl(ItemWindow);
            ItemDialog.SearchProperties[UITestControl.PropertyNames.ControlType] = "Dialog";
            ItemDialog.WindowTitles.Add(new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString());

            WinClient Grid = new WinClient(ItemDialog);
            Grid.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
            Grid.SearchProperties[WinControl.PropertyNames.Name] = "Spread Control (spr32d70)";
            Grid.SearchProperties[WinControl.PropertyNames.ClassName] = "fpSpread70";
            Grid.WindowTitles.Add(new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString());

            Grid.DrawHighlight();
            var GridPostion = Grid.BoundingRectangle;
            Point GridClick = new Point(GridPostion.X + 75, GridPostion.Y + 75);
            Mouse.Move(GridClick);
            Trace.WriteLine("Moved mouse to gridclick position");
            Mouse.Click(MouseButtons.Right);
            Trace.WriteLine("Right Clicked on Grid " + GridName);
            System.Threading.Thread.Sleep(1800);

            WinWindow ItemWin2 = new WinWindow();
            ItemWin2.SearchProperties[WinWindow.PropertyNames.AccessibleName] = "Context";
            ItemWin2.SearchProperties[WinWindow.PropertyNames.ClassName] = "#32768";

            WinMenu ContextMenu = new WinMenu(ItemWin2);
            ContextMenu.SearchProperties[WinMenu.PropertyNames.Name] = "Context";

            WinMenuItem ExportItem = new WinMenuItem(ContextMenu);
            ExportItem.SearchProperties[WinMenuItem.PropertyNames.Name] = "Export...";
            Mouse.Hover(ExportItem);
            Mouse.Click(ExportItem);
            Trace.WriteLine("Clicked Export Context Menu Button on grid " + GridName);

            switch (GridName)
            {
                case "BeamWellGroupConfig":
                    {
                        string BeamConfigExportLocation = ExportLocation;
                        string BeamConfigExportFileName = ConfigurationManager.AppSettings["BeamConfigExportFileName"];

                        WinWindow SaveBeamWellConfig = new WinWindow();
                        SaveBeamWellConfig.SearchProperties.Add(new PropertyExpression(WinWindow.PropertyNames.Name, "Save Beam Well Group Configuration", PropertyExpressionOperator.Contains));
                        SaveBeamWellConfig.SearchProperties[WinWindow.PropertyNames.ClassName] = "#32770";
                        SaveBeamWellConfig.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save Beam Well Group Configuration", PropertyExpressionOperator.Contains).ToString()));

                        WinWindow ItemWindowDialog = new WinWindow(SaveBeamWellConfig);
                        ItemWindowDialog.SearchProperties[WinWindow.PropertyNames.ClassName] = "ToolbarWindow32";
                        //ItemWindowDialog.SearchProperties[WinWindow.PropertyNames.Instance] = "4";
                        ItemWindowDialog.WindowTitles.Add((new PropertyExpression(WinToolBar.PropertyNames.Name, "Save Beam Well Group Configuration", PropertyExpressionOperator.Contains).ToString()));

                        WinToolBar LocationBar = new WinToolBar(ItemWindowDialog);
                        LocationBar.WindowTitles.Add((new PropertyExpression(WinToolBar.PropertyNames.Name, "Save Beam Well Group Configuration", PropertyExpressionOperator.Contains).ToString()));

                        WinButton PreviousLocation = new WinButton(LocationBar);
                        PreviousLocation.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                        PreviousLocation.SearchProperties[WinButton.PropertyNames.Name] = "Previous Locations";
                        PreviousLocation.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save Beam Well Group Configuration", PropertyExpressionOperator.Contains).ToString()));

                        Mouse.Click(PreviousLocation);
                        Trace.WriteLine("Clicked Previous Location on Save Dialog ");

                        WinWindow ItemWin1 = new WinWindow(SaveBeamWellConfig);
                        ItemWin1.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                        ItemWin1.SearchProperties.Add(WinWindow.PropertyNames.ControlId, "41477");
                        ItemWin1.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save Beam Well Group Configuration", PropertyExpressionOperator.Contains).ToString()));

                        WinEdit AddressEdit = new WinEdit(ItemWin1);
                        AddressEdit.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                        AddressEdit.SearchProperties.Add(WinEdit.PropertyNames.Name, "Address");
                        AddressEdit.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save Beam Well Group Configuration", PropertyExpressionOperator.Contains).ToString()));

                        AddressEdit.Text = BeamConfigExportLocation;
                        Trace.WriteLine("Set export ouput path to " + BeamConfigExportLocation);

                        //Keyboard.SendKeys(BeamConfigExportLocation);
                        Keyboard.SendKeys("{ENTER}");
                        Trace.WriteLine("Set ENTER key");

                        WinPane DPane = new WinPane(SaveBeamWellConfig);
                        DPane.SearchProperties[WinControl.PropertyNames.Name] = "Details Pane";
                        DPane.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save Beam Well Group Configuration", PropertyExpressionOperator.Contains).ToString()));

                        WinComboBox FileName = new WinComboBox(DPane);
                        FileName.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                        FileName.SearchProperties.Add(WinComboBox.PropertyNames.Name, "File name:");
                        FileName.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save Beam Well Group Configuration", PropertyExpressionOperator.Contains).ToString()));

                        FileName.EditableItem = BeamConfigExportFileName + WhenExported;
                        Trace.WriteLine("Set FileName of export file to " + BeamConfigExportFileName + WhenExported);
                        WinButton SaveExport = new WinButton(SaveBeamWellConfig);
                        SaveExport.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                        SaveExport.SearchProperties.Add(WinButton.PropertyNames.Name, "Save");
                        SaveExport.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save Beam Well Group Configuration", PropertyExpressionOperator.Contains).ToString()));

                        Mouse.Click(SaveExport);
                        Trace.WriteLine("Save Export button clicked");
                        Fileoutput = (BeamConfigExportLocation + BeamConfigExportFileName + WhenExported + ".txt");
                        CheckIfExportExists(Fileoutput);

                        break;
                    }
                case "MOP":
                    {
                        string MOPExportLocation = ExportLocation;
                        string MOPExportFileName = ConfigurationManager.AppSettings["MOPExportFileName"];

                        WinWindow SaveMOP = new WinWindow();
                        SaveMOP.SearchProperties.Add(new PropertyExpression(WinWindow.PropertyNames.Name, "Save Well Status_MOP_Type History", PropertyExpressionOperator.Contains));
                        SaveMOP.SearchProperties[WinWindow.PropertyNames.ClassName] = "#32770";
                        SaveMOP.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save Well Status_MOP_Type History", PropertyExpressionOperator.Contains).ToString()));

                        WinWindow ItemWindowDialog = new WinWindow(SaveMOP);
                        ItemWindowDialog.SearchProperties[WinWindow.PropertyNames.ClassName] = "ToolbarWindow32";
                        //ItemWindowDialog.SearchProperties[WinWindow.PropertyNames.Instance] = "4";
                        ItemWindowDialog.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save Well Status_MOP_Type History", PropertyExpressionOperator.Contains).ToString()));

                        WinToolBar LocationBar = new WinToolBar(ItemWindowDialog);
                        LocationBar.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save Well Status_MOP_Type History", PropertyExpressionOperator.Contains).ToString()));

                        WinButton PreviousLocation = new WinButton(LocationBar);
                        PreviousLocation.SearchProperties[WinButton.PropertyNames.Name] = "Previous Locations";
                        PreviousLocation.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save Well Status_MOP_Type History", PropertyExpressionOperator.Contains).ToString()));

                        Mouse.Click(PreviousLocation);
                        Trace.WriteLine("Clicked Previous Location on Save Dialog ");

                        WinWindow ItemWin1 = new WinWindow(SaveMOP);
                        ItemWin1.SearchProperties.Add(WinWindow.PropertyNames.ControlId, "41477");
                        ItemWin1.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save Well Status_MOP_Type History", PropertyExpressionOperator.Contains).ToString()));

                        WinEdit AddressEdit = new WinEdit(ItemWin1);
                        AddressEdit.SearchProperties.Add(WinEdit.PropertyNames.Name, "Address");
                        AddressEdit.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save Well Status_MOP_Type History", PropertyExpressionOperator.Contains).ToString()));

                        AddressEdit.Text = MOPExportLocation;
                        Trace.WriteLine("Set export ouput path to " + MOPExportLocation);

                        //Keyboard.SendKeys(BeamConfigExportLocation);
                        Keyboard.SendKeys("{ENTER}");
                        Trace.WriteLine("Set ENTER key");

                        WinPane DPane = new WinPane(SaveMOP);
                        DPane.SearchProperties[WinControl.PropertyNames.Name] = "Details Pane";
                        DPane.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save Well Status_MOP_Type History", PropertyExpressionOperator.Contains).ToString()));

                        WinComboBox FileName = new WinComboBox(DPane);
                        FileName.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                        FileName.SearchProperties.Add(WinComboBox.PropertyNames.Name, "File name:");
                        FileName.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save Well Status_MOP_Type History", PropertyExpressionOperator.Contains).ToString()));

                        FileName.EditableItem = MOPExportFileName + WhenExported;
                        Trace.WriteLine("Set FileName of export file to " + MOPExportFileName + WhenExported);
                        WinButton SaveExport = new WinButton(SaveMOP);
                        SaveExport.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                        SaveExport.SearchProperties.Add(WinButton.PropertyNames.Name, "Save");
                        SaveExport.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save Well Status_MOP_Type History", PropertyExpressionOperator.Contains).ToString()));

                        Mouse.Click(SaveExport);
                        Trace.WriteLine("Save Export button clicked");
                        Fileoutput = (MOPExportLocation + MOPExportFileName + WhenExported + ".txt");
                        CheckIfExportExists(Fileoutput);
                        break;
                    }
                case "ESPGroupConfigGrid":
                    {
                        string ESPGroupConfigGridExportLocation = ExportLocation;
                        string ESPGroupConfigGridExportFileName = ConfigurationManager.AppSettings["ESPConfigExportFileName"];

                        WinWindow SaveESPGroupConfigGrid = new WinWindow();
                        SaveESPGroupConfigGrid.SearchProperties.Add(new PropertyExpression(WinWindow.PropertyNames.Name, "Save ESP Well Group Configuration", PropertyExpressionOperator.Contains));
                        SaveESPGroupConfigGrid.SearchProperties[WinWindow.PropertyNames.ClassName] = "#32770";
                        SaveESPGroupConfigGrid.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save ESP Well Group Configuration", PropertyExpressionOperator.Contains).ToString()));

                        WinWindow ItemWindowDialog = new WinWindow(SaveESPGroupConfigGrid);
                        ItemWindowDialog.SearchProperties[WinWindow.PropertyNames.ClassName] = "ToolbarWindow32";
                        //ItemWindowDialog.SearchProperties[WinWindow.PropertyNames.Instance] = "4";
                        ItemWindowDialog.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save ESP Well Group Configuration", PropertyExpressionOperator.Contains).ToString()));

                        WinToolBar LocationBar = new WinToolBar(ItemWindowDialog);
                        LocationBar.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save ESP Well Group Configuration", PropertyExpressionOperator.Contains).ToString()));

                        WinButton PreviousLocation = new WinButton(LocationBar);
                        PreviousLocation.SearchProperties[WinButton.PropertyNames.Name] = "Previous Locations";
                        PreviousLocation.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save ESP Well Group Configuration", PropertyExpressionOperator.Contains).ToString()));

                        Mouse.Click(PreviousLocation);
                        Trace.WriteLine("Clicked Previous Location on Save Dialog ");

                        WinWindow ItemWin1 = new WinWindow(SaveESPGroupConfigGrid);
                        ItemWin1.SearchProperties.Add(WinWindow.PropertyNames.ControlId, "41477");
                        ItemWin1.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save ESP Well Group Configuration", PropertyExpressionOperator.Contains).ToString()));

                        WinEdit AddressEdit = new WinEdit(ItemWin1);
                        AddressEdit.SearchProperties.Add(WinEdit.PropertyNames.Name, "Address");
                        AddressEdit.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save ESP Well Group Configuration", PropertyExpressionOperator.Contains).ToString()));

                        AddressEdit.Text = ESPGroupConfigGridExportLocation;
                        Trace.WriteLine("Set export ouput path to " + ESPGroupConfigGridExportLocation);

                        //Keyboard.SendKeys(BeamConfigExportLocation);
                        Keyboard.SendKeys("{ENTER}");
                        Trace.WriteLine("Set ENTER key");

                        WinPane DPane = new WinPane(SaveESPGroupConfigGrid);
                        DPane.SearchProperties[WinControl.PropertyNames.Name] = "Details Pane";
                        DPane.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save ESP Well Group Configuration", PropertyExpressionOperator.Contains).ToString()));

                        WinComboBox FileName = new WinComboBox(DPane);
                        FileName.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                        FileName.SearchProperties.Add(WinComboBox.PropertyNames.Name, "File name:");
                        FileName.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save ESP Well Group Configuration", PropertyExpressionOperator.Contains).ToString()));

                        FileName.EditableItem = ESPGroupConfigGridExportFileName + WhenExported;
                        Trace.WriteLine("Set FileName of export file to " + ESPGroupConfigGridExportFileName + WhenExported);
                        WinButton SaveExport = new WinButton(SaveESPGroupConfigGrid);
                        SaveExport.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                        SaveExport.SearchProperties.Add(WinButton.PropertyNames.Name, "Save");
                        SaveExport.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save ESP Well Group Configuration", PropertyExpressionOperator.Contains).ToString()));

                        Mouse.Click(SaveExport);
                        Trace.WriteLine("Save Export button clicked");
                        Fileoutput = (ESPGroupConfigGridExportLocation + ESPGroupConfigGridExportFileName + WhenExported + ".txt");
                        CheckIfExportExists(Fileoutput);
                        break;
                    }
                case "PCPGroupConfigGrid":
                    {
                        string PCPGroupConfigGridExportLocation = ExportLocation;
                        string PCPGroupConfigGridExportFileName = ConfigurationManager.AppSettings["PCPConfigExportFileName"];

                        WinWindow SavePCPGroupConfigGrid = new WinWindow();
                        SavePCPGroupConfigGrid.SearchProperties.Add(new PropertyExpression(WinWindow.PropertyNames.Name, "Save PCP Well Group Configuration", PropertyExpressionOperator.Contains));
                        SavePCPGroupConfigGrid.SearchProperties[WinWindow.PropertyNames.ClassName] = "#32770";
                        SavePCPGroupConfigGrid.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save PCP Well Group Configuration", PropertyExpressionOperator.Contains).ToString()));

                        WinWindow ItemWindowDialog = new WinWindow(SavePCPGroupConfigGrid);
                        ItemWindowDialog.SearchProperties[WinWindow.PropertyNames.ClassName] = "ToolbarWindow32";
                        //ItemWindowDialog.SearchProperties[WinWindow.PropertyNames.Instance] = "4";
                        ItemWindowDialog.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save PCP Well Group Configuration", PropertyExpressionOperator.Contains).ToString()));

                        WinToolBar LocationBar = new WinToolBar(ItemWindowDialog);
                        LocationBar.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save PCP Well Group Configuration", PropertyExpressionOperator.Contains).ToString()));

                        WinButton PreviousLocation = new WinButton(LocationBar);
                        PreviousLocation.SearchProperties[WinButton.PropertyNames.Name] = "Previous Locations";
                        PreviousLocation.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save PCP Well Group Configuration", PropertyExpressionOperator.Contains).ToString()));

                        Mouse.Click(PreviousLocation);
                        Trace.WriteLine("Clicked Previous Location on Save Dialog ");

                        WinWindow ItemWin1 = new WinWindow(SavePCPGroupConfigGrid);
                        ItemWin1.SearchProperties.Add(WinWindow.PropertyNames.ControlId, "41477");
                        ItemWin1.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save PCP Well Group Configuration", PropertyExpressionOperator.Contains).ToString()));

                        WinEdit AddressEdit = new WinEdit(ItemWin1);
                        AddressEdit.SearchProperties.Add(WinEdit.PropertyNames.Name, "Address");
                        AddressEdit.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save PCP Well Group Configuration", PropertyExpressionOperator.Contains).ToString()));

                        AddressEdit.Text = PCPGroupConfigGridExportLocation;
                        Trace.WriteLine("Set export ouput path to " + PCPGroupConfigGridExportLocation);

                        //Keyboard.SendKeys(BeamConfigExportLocation);
                        Keyboard.SendKeys("{ENTER}");
                        Trace.WriteLine("Set ENTER key");

                        WinPane DPane = new WinPane(SavePCPGroupConfigGrid);
                        DPane.SearchProperties[WinControl.PropertyNames.Name] = "Details Pane";
                        DPane.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save PCP Well Group Configuration", PropertyExpressionOperator.Contains).ToString()));

                        WinComboBox FileName = new WinComboBox(DPane);
                        FileName.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                        FileName.SearchProperties.Add(WinComboBox.PropertyNames.Name, "File name:");
                        FileName.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save PCP Well Group Configuration", PropertyExpressionOperator.Contains).ToString()));

                        FileName.EditableItem = PCPGroupConfigGridExportFileName + WhenExported;
                        Trace.WriteLine("Set FileName of export file to " + PCPGroupConfigGridExportFileName + WhenExported);
                        WinButton SaveExport = new WinButton(SavePCPGroupConfigGrid);
                        SaveExport.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                        SaveExport.SearchProperties.Add(WinButton.PropertyNames.Name, "Save");
                        SaveExport.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "Save PCP Well Group Configuration", PropertyExpressionOperator.Contains).ToString()));

                        Mouse.Click(SaveExport);
                        Trace.WriteLine("Save Export button clicked");
                        Fileoutput = (PCPGroupConfigGridExportLocation + PCPGroupConfigGridExportFileName + WhenExported + ".txt");
                        CheckIfExportExists(Fileoutput);
                        break;
                    }
                //PCPGroupConfigGrid
            }

            return Fileoutput;
        }
Ejemplo n.º 33
0
        public void CloseOpenGrid(string GridName)
        {
            switch (GridName)
            {
                case "BeamWellGroupConfig":
                    {
                        WinWindow ConfigWindow = new WinWindow(GetMainWindow());
                        ConfigWindow.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                        //ConfigWindow.SearchProperties[WinWindow.PropertyNames.ControlId] = "203";
                        ConfigWindow.WindowTitles.Add(new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString());

                        WinControl ButtonImage = new WinControl(ConfigWindow);
                        ButtonImage.SearchProperties[UITestControl.PropertyNames.Name] = "Beam Well Group Configuration";
                        ButtonImage.SearchProperties[UITestControl.PropertyNames.ControlType] = "Image";
                        ButtonImage.WindowTitles.Add(new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString());
                        Mouse.Click(ButtonImage);
                        Trace.WriteLine("Clicked Grid " + GridName);
                        System.Threading.Thread.Sleep(2000);
                        Mouse.Click(ButtonImage);
                        Trace.WriteLine("Clicked Grid " + GridName);

                        break;
                    }
                case "MOP":
                    {
                        WinWindow ConfigWindow = new WinWindow(GetMainWindow());
                        ConfigWindow.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                        //ConfigWindow.SearchProperties[WinWindow.PropertyNames.ControlId] = "202";
                        ConfigWindow.WindowTitles.Add(new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString());

                        WinControl ButtonImage = new WinControl(ConfigWindow);
                        ButtonImage.SearchProperties[UITestControl.PropertyNames.Name] = "Well Status/MOP/Type History";
                        ButtonImage.SearchProperties[UITestControl.PropertyNames.ControlType] = "Image";
                        ButtonImage.WindowTitles.Add(new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString());
                        Mouse.Click(ButtonImage);
                        Trace.WriteLine("Clicked Grid " + GridName);
                        System.Threading.Thread.Sleep(2000);
                        Mouse.Click(ButtonImage);
                        Trace.WriteLine("Clicked Grid " + GridName);

                        break;
                    }
                case "ESPGroupConfigGrid":
                    {
                        WinWindow ConfigWindow = new WinWindow(GetMainWindow());
                        ConfigWindow.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                        //ConfigWindow.SearchProperties[WinWindow.PropertyNames.ControlId] = "203";
                        ConfigWindow.WindowTitles.Add(new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString());

                        WinControl ButtonImage = new WinControl(ConfigWindow);
                        ButtonImage.SearchProperties[UITestControl.PropertyNames.Name] = "ESP Well Group Configuration";
                        ButtonImage.SearchProperties[UITestControl.PropertyNames.ControlType] = "Image";
                        ButtonImage.WindowTitles.Add(new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString());
                        Mouse.Click(ButtonImage);
                        Trace.WriteLine("Clicked Grid " + GridName);
                        System.Threading.Thread.Sleep(2000);
                        Mouse.Click(ButtonImage);
                        Trace.WriteLine("Clicked Grid " + GridName);

                        break;
                    }
                case "PCPGroupConfigGrid":
                    {
                        WinWindow ConfigWindow = new WinWindow(GetMainWindow());
                        ConfigWindow.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                        //ConfigWindow.SearchProperties[WinWindow.PropertyNames.ControlId] = "203";
                        ConfigWindow.WindowTitles.Add(new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString());

                        WinControl ButtonImage = new WinControl(ConfigWindow);
                        ButtonImage.SearchProperties[UITestControl.PropertyNames.Name] = "PCP Well Group Configuration";
                        ButtonImage.SearchProperties[UITestControl.PropertyNames.ControlType] = "Image";
                        ButtonImage.WindowTitles.Add(new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString());
                        Mouse.Click(ButtonImage);
                        Trace.WriteLine("Clicked Grid " + GridName);
                        System.Threading.Thread.Sleep(2000);
                        Mouse.Click(ButtonImage);
                        Trace.WriteLine("Clicked Grid " + GridName);

                        break;
                    }
                //PCPGroupConfigGrid

            }
            WinWindow ContxtMenu = new WinWindow();
            ContxtMenu.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
            ContxtMenu.SearchProperties[WinWindow.PropertyNames.AccessibleName] = "Context";
            ContxtMenu.SearchProperties[WinWindow.PropertyNames.ClassName] = "#32768";

            WinMenu UiContextMenu = new WinMenu(ContxtMenu);
            UiContextMenu.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
            UiContextMenu.SearchProperties[WinMenu.PropertyNames.Name] = "Context";

            WinMenuItem UiContextMenuItem = new WinMenuItem(UiContextMenu);
            UiContextMenuItem.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
            UiContextMenuItem.SearchProperties[WinMenuItem.PropertyNames.Name] = "Close";

            Mouse.Click(UiContextMenuItem);
            Trace.WriteLine("Clicked Grid Close");
        }
Ejemplo n.º 34
0
        public WinMenuItem GetCardItem(string CardName)
        {
            WinWindow ItemWindow = new WinWindow();
            ItemWindow.SearchProperties[WinWindow.PropertyNames.AccessibleName] = "Context";
            ItemWindow.SearchProperties[WinWindow.PropertyNames.ClassName] = "#32768";

            WinMenu Context = new WinMenu(ItemWindow);
            Context.SearchProperties[WinMenu.PropertyNames.Name] = "Context";

            WinMenuItem ReturnThis = new WinMenuItem();

            switch(CardName)
            {
                case "CurrentCard":
                    {
                        WinMenuItem CardToGet = new WinMenuItem(Context);
                        CardToGet.SearchProperties[WinMenuItem.PropertyNames.Name] = "Current Card";
                        CardToGet.SearchConfigurations.Add(SearchConfiguration.ExpandWhileSearching);
                        ReturnThis = CardToGet;
                        break;
                    }
                case "LastFullCard":
                    {
                        WinMenuItem CardToGet = new WinMenuItem(Context);
                        CardToGet.SearchProperties[WinMenuItem.PropertyNames.Name] = "Last Full Card";
                        CardToGet.SearchConfigurations.Add(SearchConfiguration.ExpandWhileSearching);
                        ReturnThis = CardToGet;
                        break;
                    }
            }
            return ReturnThis;
        }
 public static void DeleteDataGridViewByIndex(string[] data)
 {
     WinTable table = (WinTable)Robot.FindWinControl(typeof(WinTable), data[0], _root);
     WinRow row = new WinRow(table);
     if (data[3] == string.Empty)
     {
         Mouse.Click(table, System.Windows.Forms.MouseButtons.Right);
     }
     else
     {
         row.SearchProperties.Add(WinRow.PropertyNames.RowIndex, data[3]);
         row.Find();
         UITestControlCollection collection = row.GetChildren();
         Mouse.Click(collection[0]);
         Mouse.Click(collection[0], System.Windows.Forms.MouseButtons.Right);
     }
     WinWindow window = new WinWindow();
     WinMenu menu = new WinMenu(window);
     menu.SearchProperties[WinMenu.PropertyNames.Name] = data[1];
     WinMenuItem item = new WinMenuItem(menu);
     item.SearchProperties[WinMenuItem.PropertyNames.Name] = data[2];
     Mouse.Click(item);
 }
Ejemplo n.º 36
0
        public void GetChartClient(string Item)
        {
            WinWindow ItemWindow = new WinWindow(GetMainWindow());
            ItemWindow.SearchProperties[WinWindow.PropertyNames.ClassName] = "OlectraChart2D";
            ItemWindow.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString())); ;

            WinClient ChartClient = new WinClient(ItemWindow);
            ChartClient.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString())); ;

            Mouse.Click(ChartClient, MouseButtons.Right);
            Trace.WriteLine("Right Clicked on Chart");

            WinWindow ItemWindow2 = new WinWindow();
            ItemWindow2.SearchProperties[WinWindow.PropertyNames.AccessibleName] = "Context";
            ItemWindow2.SearchProperties[WinWindow.PropertyNames.ClassName] = "#32768";

            WinMenu Context = new WinMenu(ItemWindow2);
            Context.SearchProperties[WinMenu.PropertyNames.Name] = "Context";

            WinMenuItem ShowDownholeCardToGet = new WinMenuItem(Context);
            ShowDownholeCardToGet.SearchProperties[WinMenuItem.PropertyNames.Name] = "Show Downhole Cards";
            ShowDownholeCardToGet.SearchConfigurations.Add(SearchConfiguration.ExpandWhileSearching);

            WinMenuItem HideDownholeCardToGet = new WinMenuItem(Context);
            HideDownholeCardToGet.SearchProperties[WinMenuItem.PropertyNames.Name] = "Hide Downhole Cards";
            HideDownholeCardToGet.SearchConfigurations.Add(SearchConfiguration.ExpandWhileSearching);

            switch (Item)
            {
                case "ShowDownHoleCards":
                    {
                        if (ShowDownholeCardToGet.Exists)
                        {
                            Mouse.Click(ShowDownholeCardToGet);
                            Trace.WriteLine("Clicked Show Downhole Cards from context menu");
                        }
                        break;
                    }
                case "HideDownHoleCards":
                    {
                        if (HideDownholeCardToGet.Exists)
                        {
                            Mouse.Click(HideDownholeCardToGet);
                            Trace.WriteLine("Clicked Hide Downhole Cards from context menu");
                        }
                        break;
                    }

            }
        }
Ejemplo n.º 37
0
 public static WinControl GetDropDownControl(string name, string type, WinWindow parent)
 {
     WinWindow dropDownWindow = new WinWindow();
     dropDownWindow.SearchProperties[WinWindow.PropertyNames.AccessibleName] = "DropDown";
     dropDownWindow.SearchProperties.Add(new PropertyExpression(WinWindow.PropertyNames.ClassName, "WindowsForms10.Window", PropertyExpressionOperator.Contains));
     dropDownWindow.WaitForControlReady();
     WinMenu menu = new WinMenu(dropDownWindow);
     menu.SearchProperties[WinMenu.PropertyNames.Name] = "DropDown";
     menu.WaitForControlReady();
     WinControl uIControl = new WinControl(menu);
     uIControl.SearchProperties.Add("ControlType", type);
     uIControl.SearchProperties.Add("Name", name);
     uIControl.WaitForControlReady();
     return uIControl;
 }
Ejemplo n.º 38
0
 public static WinControl GetRightClickControl(string name, string type)
 {
     WinWindow uIWindow = new WinWindow();
     uIWindow.SearchProperties[WinWindow.PropertyNames.AccessibleName] = "Context";
     uIWindow.SearchProperties[WinWindow.PropertyNames.ClassName] = "#32768";
     uIWindow.WaitForControlReady();
     WinMenu uIMenu = new WinMenu(uIWindow);
     uIMenu.SearchProperties[WinMenu.PropertyNames.Name] = "Context";
     uIMenu.WaitForControlReady();
     WinControl uIControl = new WinControl(uIMenu);
     uIControl.SearchProperties.Add("ControlType", type);
     uIControl.SearchProperties.Add("Name", name);
     uIControl.WaitForControlReady();
     return uIControl;
 }