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


C# IMouse类代码示例

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


IMouse类属于命名空间,在下文中一共展示了IMouse类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: Actions

        /// <summary>
        /// Initializes a new instance of the <see cref="Actions"/> class.
        /// </summary>
        /// <param name="driver">The <see cref="IWebDriver"/> object on which the actions built will be performed.</param>
        public Actions(IWebDriver driver)
        {
            IHasInputDevices inputDevicesDriver = driver as IHasInputDevices;
            if (inputDevicesDriver == null)
            {
                IWrapsDriver wrapper = driver as IWrapsDriver;
                while (wrapper != null)
                {
                    inputDevicesDriver = wrapper.WrappedDriver as IHasInputDevices;
                    if (inputDevicesDriver != null)
                    {
                        break;
                    }

                    wrapper = wrapper.WrappedDriver as IWrapsDriver;
                }
            }

            if (inputDevicesDriver == null)
            {
                throw new ArgumentException("The IWebDriver object must implement or wrap a driver that implements IHasInputDevices.", "driver");
            }

            this.keyboard = inputDevicesDriver.Keyboard;
            this.mouse = inputDevicesDriver.Mouse;
        }
开发者ID:JacquesBonet,项目名称:selenium-1,代码行数:30,代码来源:Actions.cs

示例15: Start

    void Start()
    {
        Mouse = MouseManager.Instance;
        //Gamepads = GamepadsManager.Instance;
        DestinationDistance = 100;

        introTrack = GetComponentsInChildren<AudioSource>()[1];
    }
开发者ID:Collegiennes,项目名称:picoBattle,代码行数:8,代码来源:CameraOrbit.cs


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