• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IMouse类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IMouse的典型用法代码示例。如果您正苦于以下问题:C# IMouse类的具体用法?C# IMouse怎么用?C# IMouse使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IMouse类属于命名空间,在下文中一共展示了IMouse类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SetUp

 public void SetUp()
 {
     stubKeyboard = MockRepository.GenerateStub<IKeyboard>();
     stubMouse = MockRepository.GenerateStub<IMouse>();
     stubKeyMapping = MockRepository.GenerateStub<IKeyMapping>();
     gameInput = new GameInput(stubKeyMapping, stubKeyboard, stubMouse);
 }
开发者ID:zakvdm,项目名称:Frenetic,代码行数:7,代码来源:GameInputTests.cs


示例2: MouseButton

 public MouseButton(IMouse mouse, MouseButtonLabel button)
 {
     this.mouse = mouse;
     this.button = button;
     prevPressed = false;
     nowPressed = false;
 }
开发者ID:himapo,项目名称:ccm,代码行数:7,代码来源:MouseButton.cs


示例3: Initialize

 public static void Initialize(         
  IConsole console,
  ISurface surface,
  IStyle style,
  IDrawings drawing,
  IShapes shapes,
  IImages images,
  IControls controls,
  ISounds sounds,         
  IKeyboard keyboard,
  IMouse mouse,
  ITimer timer,
  IFlickr flickr,
  ISpeech speech,
  CancellationToken token)
 {
     TextWindow.Init(console);
      Desktop.Init(surface);
      GraphicsWindow.Init(style, surface, drawing, keyboard, mouse);
      Shapes.Init(shapes);
      ImageList.Init(images);
      Turtle.Init(surface, drawing, shapes);
      Controls.Init(controls);
      Sound.Init(sounds);
      Timer.Init(timer);
      Stack.Init();
      Flickr.Init(flickr);
      Speech.Init(speech);
      Program.Init(token);
 }
开发者ID:mrange,项目名称:funbasic,代码行数:30,代码来源:_Library.cs


示例4: Before

 public void Before()
 {
     this.mouse = A.Fake<IMouse>(wrapped => wrapped.Wrapping(this.CreateMouse()));
     A.CallTo(() => this.mouse.LeftDown()).Invokes(_ => { });
     A.CallTo(() => this.mouse.LeftDown(A<Coordinate>._)).Invokes(_ => { });
     Logger.Debug = Console.WriteLine;
 }
开发者ID:sebastianhallen,项目名称:Priscilla,代码行数:7,代码来源:PriscillaIntegrationsTests.cs


示例5: MoveMouseAction

 /// <summary>
 /// Initializes a new instance of the <see cref="MoveMouseAction"/> class.
 /// </summary>
 /// <param name="mouse">The <see cref="IMouse"/> with which the action will be performed.</param>
 /// <param name="actionTarget">An <see cref="ILocatable"/> describing an element at which to perform the action.</param>
 public MoveMouseAction(IMouse mouse, ILocatable actionTarget)
     : base(mouse, actionTarget)
 {
     if (actionTarget == null)
     {
         throw new ArgumentException("Must provide a location for a move action.", "actionTarget");
     }
 }
开发者ID:RanchoLi,项目名称:selenium,代码行数:13,代码来源:MoveMouseAction.cs


示例6: WindowRelativeMouse

 internal WindowRelativeMouse(IntPtr parenthWnd, IntPtr hWnd, IMouse mouse, INativeMethodWrapper nativeMethodWrapper, IRetrier retry, Settings settings = null)
 {
     this.parenthWnd = parenthWnd;
     this.hWnd = hWnd;
     this.absoluteMouse = mouse;
     this.nativeMethodWrapper = nativeMethodWrapper;
     this.retry = retry;
     this.settings = settings ?? new Settings();
 }
开发者ID:sebastianhallen,项目名称:Priscilla,代码行数:9,代码来源:WindowRelativeMouse.cs


示例7: Before

        public void Before()
        {
            this.hWnd = new IntPtr(1337);
            this.innerMouse = A.Fake<IMouse>();
            this.nativeMethodWrapper = A.Fake<INativeMethodWrapper>();
            this.retrierFactory = new NRetryTimerFactory(0);
            this.retrier = new Retrier(this.retrierFactory);

            this.windowRelativeMouse = new WindowRelativeMouse(this.hWnd, this.hWnd, this.innerMouse, this.nativeMethodWrapper, this.retrier);
        }
开发者ID:sebastianhallen,项目名称:Priscilla,代码行数:10,代码来源:WindowRelativeMouseTests.cs


示例8: SingleKeyAction

        /// <summary>
        /// Initializes a new instance of the <see cref="SingleKeyAction"/> class.
        /// </summary>
        /// <param name="keyboard">The <see cref="IKeyboard"/> to use in performing the action.</param>
        /// <param name="mouse">The <see cref="IMouse"/> to use in setting focus to the element on which to perform the action.</param>
        /// <param name="actionTarget">An <see cref="ILocatable"/> object providing the element on which to perform the action.</param>
        /// <param name="key">The modifier key (<see cref="Keys.Shift"/>, <see cref="Keys.Control"/>, <see cref="Keys.Alt"/>) to use in the action.</param>
        protected SingleKeyAction(IKeyboard keyboard, IMouse mouse, ILocatable actionTarget, string key)
            : base(keyboard, mouse, actionTarget)
        {
            if (!ModifierKeys.Contains(key))
            {
                throw new ArgumentException("key must be a modifier key (Keys.Shift, Keys.Control, or Keys.Alt)", "key");
            }

            this.key = key;
        }
开发者ID:RanchoLi,项目名称:selenium,代码行数:17,代码来源:SingleKeyAction.cs


示例9: OnMouseClick

        public void OnMouseClick(IMouse mouse, Point location)
        {
            switch (_state)
            {
                case State.WaitLineBeginPoint:
                    _begin = location;
                    _state = State.WaitLineEndPoint;
                    break;

                case State.WaitLineEndPoint:
                    _end = location;
                    _state = State.WaitLineBeginPoint;
                    mouse.DrawPad.Add(new Line(_begin, _end));
                    break;
            }
        }
开发者ID:nick-zhang,项目名称:StatePattern,代码行数:16,代码来源:DrawLineMouseState.cs


示例10: Init

 internal static void Init(
  IStyle style, 
  ISurface surface, 
  IDrawings graphics, 
  IKeyboard keyboard,      
  IMouse mouse)
 {
     _surface = surface;
      _drawings = graphics;
      _keyboard = keyboard;
      _style = style;
      _mouse = mouse;
      PenWidth = 2.0;
      BrushColor = "purple";
      PenColor = "black";
      FontSize = 12;
      FontName = "Tahoma";
 }
开发者ID:mrange,项目名称:funbasic,代码行数:18,代码来源:Include_LIbrary.cs


示例11: KeyDownAction

 /// <summary>
 /// Initializes a new instance of the <see cref="KeyDownAction"/> class.
 /// </summary>
 /// <param name="keyboard">The <see cref="IKeyboard"/> to use in performing the action.</param>
 /// <param name="mouse">The <see cref="IMouse"/> to use in setting focus to the element on which to perform the action.</param>
 /// <param name="actionTarget">An <see cref="ILocatable"/> object providing the element on which to perform the action.</param>
 /// <param name="key">The modifier key (<see cref="Keys.Shift"/>, <see cref="Keys.Control"/>, <see cref="Keys.Alt"/>) to use in the action.</param>
 public KeyDownAction(IKeyboard keyboard, IMouse mouse, ILocatable actionTarget, string key)
     : base(keyboard, mouse, actionTarget, key)
 {
 }
开发者ID:asynchrony,项目名称:Selenium2,代码行数:11,代码来源:KeyDownAction.cs


示例12: Init

 public void Init(IMaze maze, IMouse mouse)
 {
     Maze = maze;
     Mouse = mouse;
 }
开发者ID:Betclic,项目名称:CodingDojo-Katas,代码行数:5,代码来源:StupidSolver.cs


示例13: FindCheese

        /*
         * code reference:
         * http://blogs.msdn.com/b/mattwar/archive/2005/02/11/371274.aspx
         *
         * julia's comment:
         *  1. try to identify the cycle detection / back tracking code
         *  2. Try to understand code.
         */
        public static bool FindCheese(IMouse mouse, int rows, int cols)
        {
            Cell[,] grid = new Cell[rows, cols];

            int r = 0;
            int c = 0;

            // set terminal, so we don't backtrack past the origin

            grid[r, c].prev = 4;

            while (!mouse.IsCheeseHere()) {

                byte d = grid[r,c].next;

                if (d < 4) {

                    // increment so we know what to try next

                    grid[r,c].next++;

                    // determine next relative position

                    int nr = (r + dr[d] + rows) % rows;

                    int nc = (c + dc[d] + cols) % cols;

                    // only try to move to cells we have not already visited

                    if (grid[nr,nc].next == 0 && mouse.Move((Direction)d)) {

                        r = nr;

                        c = nc;

                        // remember how to get back
                        grid[r, c].prev = (byte)((d + 2) % 4);
                    }

                }
                else {

                    // backtrack
                    d = grid[r, c].prev;

                    if (d == 4)
                        return false;

                    mouse.Move((Direction)d);

                    r = (r + dr[d] + rows) % rows;

                    c = (c + dc[d] + cols) % cols;
                }
            }

            return true;
        }
开发者ID:jianminchen,项目名称:AlgorithmsPractice,代码行数:66,代码来源:MousingAround.cs


示例14: MoveToHandler

 public MoveToHandler(IMouse mouse, IElementFactory elementFactory)
 {
     this.mouse = mouse;
     this.elementFactory = elementFactory;
 }
开发者ID:leeaa,项目名称:winappdriver,代码行数:5,代码来源:MoveToHandler.cs


示例15: MoveToOffsetAction

 /// <summary>
 /// Initializes a new instance of the <see cref="MoveToOffsetAction"/> class.
 /// </summary>
 /// <param name="mouse">The <see cref="IMouse"/> with which the action will be performed.</param>
 /// <param name="actionTarget">An <see cref="ILocatable"/> describing an element at which to perform the action.</param>
 /// <param name="offsetX">The horizontal offset from the origin of the target to which to move the mouse.</param>
 /// <param name="offsetY">The vertical offset from the origin of the target to which to move the mouse.</param>
 public MoveToOffsetAction(IMouse mouse, ILocatable actionTarget, int offsetX, int offsetY)
     : base(mouse, actionTarget)
 {
     this.offsetX = offsetX;
     this.offsetY = offsetY;
 }
开发者ID:kaushik9k,项目名称:Selenium2,代码行数:13,代码来源:MoveToOffsetAction.cs


示例16: ClickElementHandler

 public ClickElementHandler(IMouse mouse, IOverlay overlay, IElementFactory elementFactory)
 {
     this.mouse = mouse;
     this.overlay = overlay;
     this.elementFactory = elementFactory;
 }
开发者ID:shaunstanislaus,项目名称:winappdriver,代码行数:6,代码来源:ClickElementHandler.cs


示例17: MouseAction

 /// <summary>
 /// Initializes a new instance of the <see cref="MouseAction"/> class.
 /// </summary>
 /// <param name="mouse">The <see cref="IMouse"/> with which the action will be performed.</param>
 /// <param name="target">An <see cref="ILocatable"/> describing an element at which to perform the action.</param>
 public MouseAction(IMouse mouse, ILocatable target)
     : base(target)
 {
     this.mouse = mouse;
 }
开发者ID:asynchrony,项目名称:Selenium2,代码行数:10,代码来源:MouseAction.cs


示例18: SendKeysAction

 /// <summary>
 /// Initializes a new instance of the <see cref="SendKeysAction"/> class.
 /// </summary>
 /// <param name="keyboard">The <see cref="IKeyboard"/> to use in performing the action.</param>
 /// <param name="mouse">The <see cref="IMouse"/> to use in setting focus to the element on which to perform the action.</param>
 /// <param name="actionTarget">An <see cref="ILocatable"/> object providing the element on which to perform the action.</param>
 /// <param name="keysToSend">The key sequence to send.</param>
 public SendKeysAction(IKeyboard keyboard, IMouse mouse, ILocatable actionTarget, string keysToSend)
     : base(keyboard, mouse, actionTarget)
 {
     this.keysToSend = keysToSend;
 }
开发者ID:v4viveksharma90,项目名称:selenium,代码行数:12,代码来源:SendKeysAction.cs


示例19: MouseWheel

 public MouseWheel(IMouse mouse)
 {
     this.mouse = mouse;
     prevWheel = 0;
 }
开发者ID:himapo,项目名称:ccm,代码行数:5,代码来源:MouseWheel.cs


示例20: ClickAction

 /// <summary>
 /// Initializes a new instance of the <see cref="ClickAction"/> class.
 /// </summary>
 /// <param name="mouse">The <see cref="IMouse"/> with which the action will be performed.</param>
 /// <param name="actionTarget">An <see cref="ILocatable"/> describing an element at which to perform the action.</param>
 public ClickAction(IMouse mouse, ILocatable actionTarget)
     : base(mouse, actionTarget)
 {
 }
开发者ID:v4viveksharma90,项目名称:selenium,代码行数:9,代码来源:ClickAction.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IMouseInformation类代码示例发布时间:2022-05-24
下一篇:
C# IMoniker类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap