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


C# RepoItemInfo.CreateAdapter方法代码示例

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


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

示例1: MoveTo

        //**********************************************************************
        /// <summary>
        /// Move mouse to given items in the comoponet like List, Table and Tree.
        /// </summary>
        public static void MoveTo(LxScriptItem item)
        {
            object objComponet = item.getComponent();
            RepoItemInfo objComponetInfo = item.getComponentInfo();
            Type objType = objComponet.GetType();

            //MessageBox.Show(objType.Name.ToString());

            if(objType.Name.ToString() == "List")
            {
                RepoItemInfo targetListItemInfo = new RepoItemInfo(objComponetInfo.ParentFolder, "variableListItem",
                                                                   objComponetInfo.Path + "/listitem[@accessiblename='"+ item.getArgText() +"']",
                                                                   10000, null, System.Guid.NewGuid().ToString());
                Ranorex.ListItem targetListItem = targetListItemInfo.CreateAdapter<Ranorex.ListItem>(true);
                targetListItem.MoveTo();
            }

            if(objType.Name.ToString() == "Table")
            {
                RepoItemInfo targetCellInfo = new RepoItemInfo(objComponetInfo.ParentFolder, "variableCell",
                                                                   objComponetInfo.Path + "/row/cell[@text='"+ item.getArgText() +"']",
                                                                   10000, null, System.Guid.NewGuid().ToString());
                Ranorex.Cell targetCell = targetCellInfo.CreateAdapter<Ranorex.Cell>(true);
                targetCell.MoveTo();
            }

            if(objType.Name.ToString() == "Tree")
            {
                int treeLevel = Convert.ToInt32(item.getArgText());
                string strTreelevel = "";
                for(int i = 1 ; i <= treeLevel; i++)
                {
                    strTreelevel += "/treeitem";
                }
                RepoItemInfo targetTreeItemInfo = new RepoItemInfo(objComponetInfo.ParentFolder, "variableTreeItem",
                                                                   objComponetInfo.Path + strTreelevel +"[@accessiblename='"+ item.getArg2Text() +"']",
                                                                   10000, null, System.Guid.NewGuid().ToString());
                Ranorex.TreeItem targetTreeItem = targetTreeItemInfo.CreateAdapter<Ranorex.TreeItem>(true);
                targetTreeItem.MoveTo();
            }
        }
开发者ID:YouwenYao,项目名称:Alex,代码行数:45,代码来源:LxGenericAction.cs

示例2: Select_Item

        //**********************************************************************
        /// <summary>
        /// Click to given items in the comoponet like List, Table and Tree.
        /// </summary>
        public static void Select_Item(LxScriptItem item)
        {
            object objComponet = item.getComponent();
            RepoItemInfo objComponetInfo = item.getComponentInfo();
            Type objType = objComponet.GetType();

            //MessageBox.Show(objType.Name.ToString());

            if(objType.Name.ToString() == "List")
            {
                RepoItemInfo targetListItemInfo = new RepoItemInfo(objComponetInfo.ParentFolder, "variableListItem",
                                                                   objComponetInfo.Path + "/listitem[@accessiblename='"+ item.getArgText() +"']",
                                                                   10000, null, System.Guid.NewGuid().ToString());
                Ranorex.ListItem targetListItem = targetListItemInfo.CreateAdapter<Ranorex.ListItem>(true);
                targetListItem.Click();
            }

            if(objType.Name.ToString() == "Table")
            {
                RepoItemInfo targetCellInfo = new RepoItemInfo(objComponetInfo.ParentFolder, "variableCell",
                                                                   objComponetInfo.Path + "/row/cell[@text='"+ item.getArgText() +"']",
                                                                   10000, null, System.Guid.NewGuid().ToString());
                Ranorex.Cell targetCell = targetCellInfo.CreateAdapter<Ranorex.Cell>(true);
                targetCell.Click();
            }

            if(objType.Name.ToString() == "Tree")
            {

                String Xpos = " ";
                String Ypos = " ";
                String sPoint ="0;0";

                if((!(item.getArg3Text().Trim().Equals("")))&&(!(item.getArg4Text().Trim().Equals(""))))
                {
                    Xpos = item.getArg3Text();
                    Ypos = item.getArg4Text();
                    sPoint =Xpos+";"+Ypos;
                }

                int treeLevel = Convert.ToInt32(item.getArgText());
                string strTreelevel = "";
                string strTreelevelCkb = "";
                for(int i = 1 ; i <= treeLevel; i++)
                {
                    strTreelevel += "/treeitem";
                    strTreelevelCkb += "/checkbox";
                }

                RepoItemInfo targetTreeItemInfo = new RepoItemInfo(objComponetInfo.ParentFolder, "variableTreeItem",
                                                                   objComponetInfo.Path + strTreelevel +"[@accessiblename='"+ item.getArg2Text() +"']",
                                                                   10000, null, System.Guid.NewGuid().ToString());

                if(targetTreeItemInfo.Exists())
                {
                    Ranorex.TreeItem targetTreeItem = targetTreeItemInfo.CreateAdapter<Ranorex.TreeItem>(true);

                    targetTreeItem.Click(sPoint);
                }
                else
                {
                    targetTreeItemInfo = new RepoItemInfo(objComponetInfo.ParentFolder, "variableTreeItem1",
                                                                   objComponetInfo.Path + strTreelevelCkb +"[@accessiblename='"+ item.getArg2Text() +"']",
                                                                   10000, null, System.Guid.NewGuid().ToString());
                    Ranorex.CheckBox targetTreeItemCkb = targetTreeItemInfo.CreateAdapter<Ranorex.CheckBox>(true);
                    targetTreeItemCkb.Click(sPoint);
                }

            }
        }
开发者ID:YouwenYao,项目名称:Alex,代码行数:74,代码来源:LxGenericAction.cs

示例3: DoubleClick_Item

        //**********************************************************************
        /// <summary>
        /// DoubleClick to given items in the comoponet like List, Table and Tree.
        /// </summary>
        public static void DoubleClick_Item(LxScriptItem item)
        {
            object objComponet = item.getComponent();
            RepoItemInfo objComponetInfo = item.getComponentInfo();
            Type objType = objComponet.GetType();

            //MessageBox.Show(objType.Name.ToString());

            if(objType.Name.ToString() == "List")
            {
                RepoItemInfo targetListItemInfo = new RepoItemInfo(objComponetInfo.ParentFolder, "variableListItem",
                                                                   objComponetInfo.Path + "/listitem[@accessiblename='"+ item.getArgText() +"']",
                                                                   10000, null, System.Guid.NewGuid().ToString());
                Ranorex.ListItem targetListItem = targetListItemInfo.CreateAdapter<Ranorex.ListItem>(true);
                targetListItem.DoubleClick();
            }

            if(objType.Name.ToString() == "Table")
            {
                RepoItemInfo targetCellInfo = new RepoItemInfo(objComponetInfo.ParentFolder, "variableCell",
                                                                   objComponetInfo.Path + "/row/cell[@text='"+ item.getArgText() +"']",
                                                                   10000, null, System.Guid.NewGuid().ToString());
                Ranorex.Cell targetCell = targetCellInfo.CreateAdapter<Ranorex.Cell>(true);
                targetCell.DoubleClick();
            }

            if(objType.Name.ToString() == "Tree")
            {
                int treeLevel = Convert.ToInt32(item.getArgText());
                string strTreelevel = "";
                for(int i = 1 ; i <= treeLevel; i++)
                {
                    strTreelevel += "/treeitem";
                }
                RepoItemInfo targetTreeItemInfo = new RepoItemInfo(objComponetInfo.ParentFolder, "variableTreeItem",
                                                                   objComponetInfo.Path + strTreelevel +"[@accessiblename='"+ item.getArg2Text() +"']",
                                                                   10000, null, System.Guid.NewGuid().ToString());
                Ranorex.TreeItem targetTreeItem = targetTreeItemInfo.CreateAdapter<Ranorex.TreeItem>(true);
                targetTreeItem.DoubleClick();
               /*
                Ranorex.Control treeViewControl = targetTreeItem.Element.As<Ranorex.Control>();
                System.Windows.Forms.TreeNode node = treeViewControl.InvokeMethod(
                                "GetNodeAt",
                                new object[] { targetTreeItem.Element.ClientRectangle.Location + new Size(1, 1) })
                                    as System.Windows.Forms.TreeNode;
                object mynode = node.GetLifetimeService();
                Ranorex.CheckBox mycheckbox = (Ranorex.CheckBox)mynode;
                mycheckbox.Check();
            */

            }
        }
开发者ID:YouwenYao,项目名称:Alex,代码行数:56,代码来源:LxGenericAction.cs


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