public TestServices With( IAssetLoader assetLoader = null, IFocusManager focusManager = null, IInputManager inputManager = null, Func <IKeyboardDevice> keyboardDevice = null, IKeyboardNavigationHandler keyboardNavigation = null, Func <IMouseDevice> mouseDevice = null, IRuntimePlatform platform = null, IPlatformRenderInterface renderInterface = null, IRenderTimer renderLoop = null, IScheduler scheduler = null, IStandardCursorFactory standardCursorFactory = null, IStyler styler = null, Func <Styles> theme = null, IPlatformThreadingInterface threadingInterface = null, IWindowImpl windowImpl = null, IWindowingPlatform windowingPlatform = null) { return(new TestServices( assetLoader: assetLoader ?? AssetLoader, focusManager: focusManager ?? FocusManager, inputManager: inputManager ?? InputManager, keyboardDevice: keyboardDevice ?? KeyboardDevice, keyboardNavigation: keyboardNavigation ?? KeyboardNavigation, mouseDevice: mouseDevice ?? MouseDevice, platform: platform ?? Platform, renderInterface: renderInterface ?? RenderInterface, scheduler: scheduler ?? Scheduler, standardCursorFactory: standardCursorFactory ?? StandardCursorFactory, styler: styler ?? Styler, theme: theme ?? Theme, threadingInterface: threadingInterface ?? ThreadingInterface, windowingPlatform: windowingPlatform ?? WindowingPlatform, windowImpl: windowImpl ?? WindowImpl)); }
public TestServices( IAssetLoader assetLoader = null, IFocusManager focusManager = null, IInputManager inputManager = null, Func <IKeyboardDevice> keyboardDevice = null, ILayoutManager layoutManager = null, IRuntimePlatform platform = null, IPlatformRenderInterface renderInterface = null, IStandardCursorFactory standardCursorFactory = null, IStyler styler = null, Func <Styles> theme = null, IPlatformThreadingInterface threadingInterface = null, IWindowImpl windowImpl = null, IWindowingPlatform windowingPlatform = null) { AssetLoader = assetLoader; FocusManager = focusManager; InputManager = inputManager; KeyboardDevice = keyboardDevice; LayoutManager = layoutManager; Platform = platform; RenderInterface = renderInterface; StandardCursorFactory = standardCursorFactory; Styler = styler; Theme = theme; ThreadingInterface = threadingInterface; WindowImpl = windowImpl; WindowingPlatform = windowingPlatform; }
public TestServices( IAssetLoader assetLoader = null, IInputManager inputManager = null, ILayoutManager layoutManager = null, IPclPlatformWrapper platformWrapper = null, IPlatformRenderInterface renderInterface = null, IStandardCursorFactory standardCursorFactory = null, IStyler styler = null, Func <Styles> theme = null, IPlatformThreadingInterface threadingInterface = null, IWindowImpl windowImpl = null, IWindowingPlatform windowingPlatform = null) { AssetLoader = assetLoader; InputManager = inputManager; LayoutManager = layoutManager; PlatformWrapper = platformWrapper; RenderInterface = renderInterface; StandardCursorFactory = standardCursorFactory; Styler = styler; Theme = theme; ThreadingInterface = threadingInterface; WindowImpl = windowImpl; WindowingPlatform = windowingPlatform; }
public TestServices( IAssetLoader assetLoader = null, IFocusManager focusManager = null, IInputManager inputManager = null, Func<IKeyboardDevice> keyboardDevice = null, ILayoutManager layoutManager = null, IPclPlatformWrapper platformWrapper = null, IPlatformRenderInterface renderInterface = null, IStandardCursorFactory standardCursorFactory = null, IStyler styler = null, Func<Styles> theme = null, IPlatformThreadingInterface threadingInterface = null, IWindowImpl windowImpl = null, IWindowingPlatform windowingPlatform = null) { AssetLoader = assetLoader; FocusManager = focusManager; InputManager = inputManager; KeyboardDevice = keyboardDevice; LayoutManager = layoutManager; PlatformWrapper = platformWrapper; RenderInterface = renderInterface; StandardCursorFactory = standardCursorFactory; Styler = styler; Theme = theme; ThreadingInterface = threadingInterface; WindowImpl = windowImpl; WindowingPlatform = windowingPlatform; }
public TestServices( IAssetLoader assetLoader = null, IFocusManager focusManager = null, IInputManager inputManager = null, Func <IKeyboardDevice> keyboardDevice = null, IKeyboardNavigationHandler keyboardNavigation = null, ILayoutManager layoutManager = null, IRuntimePlatform platform = null, Func <IRenderRoot, IRenderLoop, IRenderer> renderer = null, IPlatformRenderInterface renderInterface = null, IRenderLoop renderLoop = null, IScheduler scheduler = null, IStandardCursorFactory standardCursorFactory = null, IStyler styler = null, Func <Styles> theme = null, IPlatformThreadingInterface threadingInterface = null, IWindowingPlatform windowingPlatform = null) { AssetLoader = assetLoader; FocusManager = focusManager; InputManager = inputManager; KeyboardDevice = keyboardDevice; KeyboardNavigation = keyboardNavigation; LayoutManager = layoutManager; Platform = platform; Renderer = renderer; RenderInterface = renderInterface; RenderLoop = renderLoop; Scheduler = scheduler; StandardCursorFactory = standardCursorFactory; Styler = styler; Theme = theme; ThreadingInterface = threadingInterface; WindowingPlatform = windowingPlatform; }
public void Start() { if (!this.IsEnabled) { IPlatformThreadingInterface threading = Locator.Current.GetService <IPlatformThreadingInterface>(); this.timer = threading.StartTimer(this.Interval, this.InternalTick); } }
/// <summary> /// Starts the timer. /// </summary> public void Start() { if (!IsEnabled) { IPlatformThreadingInterface threading = PerspexLocator.Current.GetService <IPlatformThreadingInterface>(); _timer = threading.StartTimer(Interval, InternalTick); } }
/// <summary> /// Provides the implementation of starting the timer. /// </summary> /// <param name="tick">The method to call on each tick.</param> /// <remarks> /// This can be overridden by platform implementations to use a specialized timer /// implementation. /// </remarks> protected virtual IDisposable StartCore(Action tick) { if (_threading == null) { _threading = AvaloniaLocator.Current.GetService <IPlatformThreadingInterface>(); } return(_threading.StartTimer(TimeSpan.FromSeconds(1.0 / FramesPerSecond), tick)); }
/// <summary> /// Provides the implementation of starting the timer. /// </summary> /// <param name="tick">The method to call on each tick.</param> /// <remarks> /// This can be overridden by platform implementations to use a specialized timer /// implementation. /// </remarks> protected virtual IDisposable StartCore(Action tick) { if (_threading == null) { _threading = AvaloniaLocator.Current.GetService<IPlatformThreadingInterface>(); } return _threading.StartTimer(TimeSpan.FromSeconds(1.0 / FramesPerSecond), tick); }
public void Stop() { if (this.IsEnabled) { IPlatformThreadingInterface threading = Locator.Current.GetService <IPlatformThreadingInterface>(); threading.KillTimer(this.timerHandle); this.timerHandle = null; } }
public Dispatcher(IPlatformThreadingInterface platform) { _platform = platform; if(_platform == null) //TODO: Unit test mode, fix that somehow return; _jobRunner = new JobRunner(platform); _platform.Signaled += _jobRunner.RunJobs; }
/// <summary> /// Stops the timer. /// </summary> public void Stop() { if (IsEnabled) { IPlatformThreadingInterface threading = PerspexLocator.Current.GetService <IPlatformThreadingInterface>(); _timer.Dispose(); _timer = null; } }
/// <summary> /// Starts the timer. /// </summary> public void Start() { if (!IsEnabled) { IPlatformThreadingInterface threading = AvaloniaLocator.Current.GetService <IPlatformThreadingInterface>(); if (threading == null) { throw new Exception("Could not start timer: IPlatformThreadingInterface is not registered."); } _timer = threading.StartTimer(Interval, InternalTick); } }
///// <summary> ///// Allows unit tests to change the platform threading interface. ///// </summary> internal void UpdateServices() { if (_platform != null) { _platform.Signaled -= _jobRunner.RunJobs; } _platform = AvaloniaGlobals.PlatformThreadingInterface; _jobRunner.UpdateServices(); if (_platform != null) { _platform.Signaled += _jobRunner.RunJobs; } }
public TestServices( IAssetLoader assetLoader = null, IFocusManager focusManager = null, IInputManager inputManager = null, Func <IKeyboardDevice> keyboardDevice = null, IKeyboardNavigationHandler keyboardNavigation = null, ILayoutManager layoutManager = null, Func <IMouseDevice> mouseDevice = null, IRuntimePlatform platform = null, IPlatformRenderInterface renderInterface = null, IRenderLoop renderLoop = null, IScheduler scheduler = null, ICursorFactory standardCursorFactory = null, IStyler styler = null, Func <Styles> theme = null, IPlatformThreadingInterface threadingInterface = null, IWindowImpl windowImpl = null, IWindowingPlatform windowingPlatform = null, PlatformHotkeyConfiguration platformHotkeyConfiguration = null, IFontManagerImpl fontManagerImpl = null, IFormattedTextImpl formattedTextImpl = null) { AssetLoader = assetLoader; FocusManager = focusManager; InputManager = inputManager; KeyboardDevice = keyboardDevice; KeyboardNavigation = keyboardNavigation; LayoutManager = layoutManager; MouseDevice = mouseDevice; Platform = platform; RenderInterface = renderInterface; Scheduler = scheduler; StandardCursorFactory = standardCursorFactory; Styler = styler; Theme = theme; ThreadingInterface = threadingInterface; WindowImpl = windowImpl; WindowingPlatform = windowingPlatform; PlatformHotkeyConfiguration = platformHotkeyConfiguration; FontManagerImpl = fontManagerImpl; FormattedTextImpl = formattedTextImpl; }
/// <summary> /// Initializes static members of the <see cref="MainLoop"/> class. /// </summary> static MainLoop() { s_platform = Locator.Current.GetService<IPlatformThreadingInterface>(); }
public JobRunner(IPlatformThreadingInterface platform) { _platform = platform; }
/// <summary> /// Initializes static members of the <see cref="MainLoop"/> class. /// </summary> static MainLoop() { s_platform = Locator.Current.GetService <IPlatformThreadingInterface>(); }
public TestServices With( IAssetLoader assetLoader = null, IFocusManager focusManager = null, IInputManager inputManager = null, Func<IKeyboardDevice> keyboardDevice = null, ILayoutManager layoutManager = null, IPclPlatformWrapper platformWrapper = null, IPlatformRenderInterface renderInterface = null, IStandardCursorFactory standardCursorFactory = null, IStyler styler = null, Func<Styles> theme = null, IPlatformThreadingInterface threadingInterface = null, IWindowImpl windowImpl = null, IWindowingPlatform windowingPlatform = null) { return new TestServices( assetLoader: assetLoader ?? AssetLoader, focusManager: focusManager ?? FocusManager, inputManager: inputManager ?? InputManager, keyboardDevice: keyboardDevice ?? KeyboardDevice, layoutManager: layoutManager ?? LayoutManager, platformWrapper: platformWrapper ?? PlatformWrapper, renderInterface: renderInterface ?? RenderInterface, standardCursorFactory: standardCursorFactory ?? StandardCursorFactory, styler: styler ?? Styler, theme: theme ?? Theme, threadingInterface: threadingInterface ?? ThreadingInterface, windowImpl: windowImpl ?? WindowImpl, windowingPlatform: windowingPlatform ?? WindowingPlatform); }
internal void UpdateServices() { _platform = AvaloniaGlobals.PlatformThreadingInterface; }
public JobRunner(IPlatformThreadingInterface platform) { _platform = platform; }
/// <summary> /// Allows unit tests to change the platform threading interface. /// </summary> internal void UpdateServices() { _platform = AvaloniaLocator.Current.GetService <IPlatformThreadingInterface>(); }