Xamarin.Forms/Xamarin.Forms.Core.UnitTests/MockDispatcherProvider.cs

20 строки
431 B
C#
Исходник Обычный вид История

[UWP] Multi-window (#2432) * Changes to support multiple windows on UWP * Locker on Layout.cs to prevent concurrency * Changes on UnitTests to work with multi-window * implemented Xamarin.Forms.Core and UAP Element.Dispatcher * Implementation on each platform * Implementation on each platform * Improved Element casting for Dispatcher utilization * Correction of the items presented in the code review * Control Gallery for Multiple Window and Code Review * [UnitTests]Add missing file * Correction for Unit Tests * Correction for Unit Tests * Correction for Unit Tests - Removed ThreadStatic in Ticker * removed thread static * removed thread static into application class * Update Control Gallery * Code Review (Changes) * Comment * Adjust StackOverflow when close the app * Performace improvements * - fix merge and ui test performance * Name of method and adjust on NavigationProxy * Adjustments in the implementation of the DispatcherManager * Updated the ListProxy method and adjust the initialization of dispacther on page. * Remove GetDispacther method from IPlatformServices and some adjusments of code review. * Adjust after merge on NavigationProxy * Register IDispatcherProvider on Xamarin.Forms.Core.UnitTests * Adjustments for correct unit tests operation * Adjustments for correct unit tests operation * remove spaces * Adjust for UITests * Remove IsInvokeRequired and adjusted de instance of s_resolutionList * Remove lock() on ResolveLayoutChanges method * Make IDispatcher implementations internal * Removed Dispatcher association from Element and Page class. Removed Child Assignment in Element Class and ThreadStatic Removal from NavigationProxy Property * Remove DispatcherManager; contain thread static to UWP implementation * Make dispatcher lazy * MockDispatcherProvider on Xaml.UnitTests * Add mock Dispatcher and DispatcherProvider for XAML unit tests * Revert "Add mock Dispatcher and DispatcherProvider for XAML unit tests" This reverts commit 134320d348a3812e44507ae0b50459c8f43478e9. * Add MockDispactcherProvider on Pager.UnitTests * Revert covariance change * Centralize dispatcher checking logic * Add a fallback dispatcher for platforms without a registered DispatcherProvider * Remove Dispatcher/DispatcherProvider from project * Allow UI test pages which use ListProxy to get a dispatcher in UITest mode * Prevent crash instantiating UITest version of Issue2004 * Removed unnecessary old codes * Clean up whitespace changes * Remove unused method
2019-08-15 20:36:38 +03:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Core.UnitTests;
[assembly: Dependency(typeof(MockDispatcherProvider))]
namespace Xamarin.Forms.Core.UnitTests
{
public class MockDispatcherProvider : IDispatcherProvider
{
public IDispatcher GetDispatcher(object context)
{
return new MockDispatcher();
}
}
}