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


C# Screen.DragDrop方法代码示例

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


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

示例1: DragAndDrop

 /// <summary>
 /// This Method Performs Drag and Drop an element from scrolllist to Workfield by Sikuli4net
 /// </summary>
 /// <param name="scrollElement">Scroll Element class</param>
 public void DragAndDrop(ScrollElement scrollElement)
 {
     Pattern pattern_Drag = new Pattern(Configuration.PathToImgs()+scrollElement.GetImageDragPatern());
     Pattern pattern_Drop = new Pattern(Configuration.PathToImgs() + "wrk.png",0.5f);
     Screen scrn = new Screen();
     scrn.DragDrop(pattern_Drag,pattern_Drop);
 }
开发者ID:MixolydianBY,项目名称:AutomationDemo,代码行数:11,代码来源:MainForm.cs

示例2: DragDrop

 public bool DragDrop(string clickPattern_path,string dropPattern_path,
     Point clickPattern_offset,Point dropPattern_offset,
     double clickPattern_similar = 0.5, double dropPattern_similar = 0.5)
 {
     Pattern clickPattern = new Pattern(clickPattern_path, clickPattern_offset, clickPattern_similar);
     Pattern dropPattern = new Pattern(dropPattern_path, dropPattern_offset, dropPattern_similar);
     Screen scrn = new Screen();
     try
     {
         scrn.DragDrop(clickPattern, dropPattern);
     }
     catch
     {
         return false;
     }
     return true;
 }
开发者ID:OVRLab,项目名称:SeleniumPP,代码行数:17,代码来源:IDesktop.cs

示例3: LogInTest

        public void LogInTest()
        {
            //Screen
            Screen loginPage = new Screen();

            //Pattern

            Pattern nextButton = new Pattern(Path.Combine(AppDomain.CurrentDomain.BaseDirectory + @"Images\nextButton.png"));
            Pattern userNameInput = new Pattern(Path.Combine(AppDomain.CurrentDomain.BaseDirectory + @"Images\emailInput.png"));

            Pattern userPassInput = new Pattern(Path.Combine(AppDomain.CurrentDomain.BaseDirectory + @"Images\passwordInput.png"));
            Pattern signInButton = new Pattern(Path.Combine(AppDomain.CurrentDomain.BaseDirectory + @"Images\signInButton.png"));

            //Waiting until the user name input is present
            loginPage.Wait(userNameInput);

            //Setting user name and password
            loginPage.Type(userNameInput, "[email protected]", KeyModifier.NONE);

            //Clicking on the Next button
            loginPage.Click(nextButton);

            //Waiting until the password input is present
            loginPage.Wait(userPassInput);

            //Setting user name and password
            loginPage.Type(userPassInput, "123456789abcd!", KeyModifier.NONE);

            //Clicking on the "Sign in" button
            loginPage.Click(signInButton);

            //Drag and drop

            //Screen
            Screen gmailPage = new Screen();

            Pattern moreIcon = new Pattern(Path.Combine(AppDomain.CurrentDomain.BaseDirectory + @"Images\moreApp.png"));
            Pattern driveIcon = new Pattern(Path.Combine(AppDomain.CurrentDomain.BaseDirectory + @"Images\driveIcon.png"));

            Pattern trashOption = new Pattern(Path.Combine(AppDomain.CurrentDomain.BaseDirectory + @"Images\trashOption.png"));
            Pattern pdfFile = new Pattern(Path.Combine(AppDomain.CurrentDomain.BaseDirectory + @"Images\pdfFile.png"));

            //Clicking on the more icon
            gmailPage.Wait(moreIcon);
            gmailPage.Click(moreIcon);

            //Waiting Drive icon
            gmailPage.Wait(driveIcon);

            //Clicking on the Drive Icon
            gmailPage.Click(driveIcon);

            //Waiting elements
            gmailPage.Wait(pdfFile,40);
            gmailPage.Wait(trashOption);
            gmailPage.DragDrop(pdfFile, trashOption);
        }
开发者ID:nvega-ms,项目名称:SikuliDotNetExample,代码行数:57,代码来源:TestClass.cs


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