public CoreServer(IKernel kernel) { this.m_Kernel = kernel; this.m_Profiler = kernel.TryGet <IProfiler>(); if (this.m_Profiler == null) { kernel.Bind <IProfiler>().To <NullProfiler>(); this.m_Profiler = kernel.Get <IProfiler>(); } this.m_AnalyticsEngine = kernel.TryGet <IAnalyticsEngine>(); if (this.m_AnalyticsEngine == null) { kernel.Bind <IAnalyticsEngine>().To <NullAnalyticsEngine>(); this.m_AnalyticsEngine = kernel.Get <IAnalyticsEngine>(); } this.m_AnalyticsInitializer = kernel.TryGet <IAnalyticsInitializer>(); if (this.m_AnalyticsInitializer == null) { kernel.Bind <IAnalyticsInitializer>().To <NullAnalyticsInitializer>(); this.m_AnalyticsInitializer = kernel.Get <IAnalyticsInitializer>(); } this.m_AnalyticsInitializer.Initialize(this.m_AnalyticsEngine); this.m_TickRegulator = this.m_Kernel.Get <ITickRegulator>(); }
public MainViewModel( Application app, ILogger logger, IResourceProvider resProvider, IApplicationControlFileProvider appControlFileProvider, IFileSystemHelper fsHelper, IByteConverter byteConverter, ICrashReporter crashReporter, IAnalyticsEngine analyticsEngine, IGenerator playlistGenerator, IDriveVolumeInfoViewFactory driveVolumeInfoViewFactory, IApplicationControlFileFactory applicationControlFileFactory) : base(app) { Logger = logger; Logger.Debug(() => $"MainViewModel:ctor"); ApplicationContext = app; ResourceProvider = resProvider; ApplicationControlFileProvider = appControlFileProvider; FileSystemHelper = fsHelper; ByteConverter = byteConverter; CrashReporter = crashReporter; AnalyticsEngine = analyticsEngine; PlaylistGenerator = playlistGenerator; DriveVolumeInfoViewFactory = driveVolumeInfoViewFactory; ApplicationControlFileFactory = applicationControlFileFactory; }
public DownloadViewModel( Application app, ILogger logger, IResourceProvider resProvider, IApplicationControlFileProvider appControlFileProvider, IFileSystemHelper fileSystemHelper, IByteConverter byteConverter, IEpisodeFinder podcastEpisodeFinder, ISyncItemToEpisodeDownloaderTaskConverter converter, ITaskPool taskPool, ICrashReporter crashReporter, IAnalyticsEngine analyticsEngine, IStatusAndProgressMessageStore messageStore, INetworkHelper networkHelper, IUserSettings userSettings) : base(app) { ApplicationContext = app; Logger = logger; Logger.Debug(() => $"DownloadViewModel:ctor"); ResourceProvider = resProvider; ApplicationControlFileProvider = appControlFileProvider; FileSystemHelper = fileSystemHelper; ByteConverter = byteConverter; PodcastEpisodeFinder = podcastEpisodeFinder; Converter = converter; TaskPool = taskPool; CrashReporter = crashReporter; AnalyticsEngine = analyticsEngine; MessageStore = messageStore; NetworkHelper = networkHelper; UserSettings = userSettings; }
public void Setup() { ResetObservedResults(); MockApplication = A.Fake <Application>(); A.CallTo(() => MockApplication.PackageName).Returns("com.andrewandderek.podcastutilities"); MockLogger = A.Fake <ILogger>(); MockResourceProvider = A.Fake <IResourceProvider>(); MockFileUtilities = A.Fake <IFileUtilities>(); MockApplicationControlFileProvider = A.Fake <IApplicationControlFileProvider>(); MockCrashReporter = A.Fake <ICrashReporter>(); MockAnalyticsEngine = A.Fake <IAnalyticsEngine>(); MockEpisodePurger = A.Fake <IEpisodePurger>(); SetupResources(); ViewModel = new PurgeViewModel( MockApplication, MockLogger, MockResourceProvider, MockApplicationControlFileProvider, MockEpisodePurger, MockFileUtilities, MockCrashReporter, MockAnalyticsEngine ); ViewModel.Observables.Title += SetTitle; ViewModel.Observables.StartProgress += StartProgress; ViewModel.Observables.UpdateProgress += UpdateProgress; ViewModel.Observables.EndProgress += EndProgress; ViewModel.Observables.SetPurgeItems += SetPurgeItems; ViewModel.Observables.DisplayMessage += DisplayMessage; }
public void Setup() { ResetObservedResults(); MockApplication = A.Fake <Application>(); A.CallTo(() => MockApplication.PackageName).Returns("com.andrewandderek.podcastutilities"); MockLogger = A.Fake <ILogger>(); MockResourceProvider = A.Fake <IResourceProvider>(); MockFileSystemHelper = A.Fake <IFileSystemHelper>(); // there is 10MB free in the filesystem A.CallTo(() => MockFileSystemHelper.GetAvailableFileSystemSizeInBytes(A <string> .Ignored)).Returns(1024 * 1024 * FREE_DISK_SPACE_MB); MockApplicationControlFileProvider = A.Fake <IApplicationControlFileProvider>(); MockCrashReporter = A.Fake <ICrashReporter>(); MockAnalyticsEngine = A.Fake <IAnalyticsEngine>(); MockApplicationControlFileFactory = A.Fake <IApplicationControlFileFactory>(); MockPodcastEpisodeFinder = A.Fake <IEpisodeFinder>(); MockSyncItemToEpisodeDownloaderTaskConverter = A.Fake <ISyncItemToEpisodeDownloaderTaskConverter>(); MockTaskPool = A.Fake <ITaskPool>(); MockStatusAndProgressMessageStore = A.Fake <IStatusAndProgressMessageStore>(); MockNetworkHelper = A.Fake <INetworkHelper>(); A.CallTo(() => MockNetworkHelper.ActiveNetworkType).Returns(INetworkHelper.NetworkType.Wifi); MockUserSettings = A.Fake <IUserSettings>(); ByteConverter = new ByteConverter(); SetupResources(); ViewModel = new DownloadViewModel( MockApplication, MockLogger, MockResourceProvider, MockApplicationControlFileProvider, MockFileSystemHelper, ByteConverter, MockPodcastEpisodeFinder, MockSyncItemToEpisodeDownloaderTaskConverter, MockTaskPool, MockCrashReporter, MockAnalyticsEngine, MockStatusAndProgressMessageStore, MockNetworkHelper, MockUserSettings ); ViewModel.Observables.Title += SetTitle; ViewModel.Observables.SetEmptyText += SetEmptyText; ViewModel.Observables.StartProgress += StartProgress; ViewModel.Observables.UpdateProgress += UpdateProgress; ViewModel.Observables.EndProgress += EndProgress; ViewModel.Observables.SetSyncItems += SetSyncItems; ViewModel.Observables.DisplayMessage += DisplayMessage; ViewModel.Observables.CellularPrompt += CellularPrompt; ViewModel.Observables.StartDownloading += StartDownloading; ViewModel.Observables.EndDownloading += EndDownloading; ViewModel.Observables.UpdateItemProgress += UpdateItemProgress; ViewModel.Observables.UpdateItemStatus += UpdateItemStatus; ViewModel.Observables.ExitPrompt += ExitPrompt; ViewModel.Observables.Exit += Exit; }
public override void OnCreate() { Log.Debug(LOGCAT_TAG, $"AndroidApplication:OnCreate SDK == {Android.OS.Build.VERSION.SdkInt}, {(int)Android.OS.Build.VERSION.SdkInt}"); Log.Debug(LOGCAT_TAG, $"AndroidApplication:OnCreate PackageName == {this.PackageName}"); SetupExceptionHandler(); PackageInfo package = PackageManager.GetPackageInfo(PackageName, 0); long longVersionCode = PackageInfoCompat.GetLongVersionCode(package); #if DEBUG var config = "(Debug)"; #else var config = "(Release)"; #endif DisplayVersion = $"v{package.VersionName}, ({longVersionCode}), {config}"; DisplayPackage = $"{PackageName}"; Log.Debug(LOGCAT_TAG, $"AndroidApplication:OnCreate Version == {DisplayVersion}"); base.OnCreate(); var dirs = Context.GetExternalFilesDirs(null); if (dirs != null && dirs[0] != null) { // use our external folder - dependes on package name Log.Debug(LOGCAT_TAG, $"AndroidApplication:OnCreate Logs == {dirs[0].AbsolutePath}"); LoggerFactory = new NLoggerLoggerFactory(dirs[0].AbsolutePath); } else { // hard code and hope for the best LoggerFactory = new NLoggerLoggerFactory($"/sdcard/Android/data/{this.PackageName}/files/"); } Logger = LoggerFactory.Logger; Logger.Debug(() => $"AndroidApplication:Logging init"); // initialise the IoC container IocContainer = InitializeIocContainer(); AddExtrasToIocContainer(IocContainer); Logger.Debug(() => $"AndroidApplication:IoC Init, {DisplayVersion}, {Android.OS.Build.VERSION.SdkInt}, {(int)Android.OS.Build.VERSION.SdkInt}, {this.PackageName}"); // display the core components version List <string> envirnment = WindowsEnvironmentInformationProvider.GetEnvironmentRuntimeDisplayInformation(); foreach (string line in envirnment) { Logger.Debug(() => $"AndroidApplication:{line}"); } Analytics = IocContainer.Resolve <IAnalyticsEngine>(); Analytics?.LifecycleLaunchEvent(); }
public DefaultGameContext( IKernel kernel, IAnalyticsEngine analyticsEngine, ICoreGame game, IGameWindow window, IWorld world, IWorldManager worldManager) { _kernel = kernel; _analyticsEngine = analyticsEngine; _coroutine = kernel.Get <ICoroutine>(); Game = game; World = world; WorldManager = worldManager; Window = window; }
public DefaultGameContext( IKernel kernel, IAnalyticsEngine analyticsEngine, Game game, GraphicsDeviceManager graphics, IGameWindow window, IWorld world, IWorldManager worldManager) { _kernel = kernel; _analyticsEngine = analyticsEngine; Game = game; Graphics = graphics; World = world; WorldManager = worldManager; Window = window; }
/// <summary> /// Initializes a new instance of the <see cref="DefaultGameContext"/> class. /// </summary> /// <param name="kernel"> /// The kernel. /// </param> /// <param name="game"> /// The game. /// </param> /// <param name="graphics"> /// The graphics. /// </param> /// <param name="window"> /// The window. /// </param> /// <param name="world"> /// The world. /// </param> /// <param name="worldManager"> /// The world manager. /// </param> public DefaultGameContext( IKernel kernel, IAnalyticsEngine analyticsEngine, Game game, GraphicsDeviceManager graphics, IGameWindow window, IWorld world, IWorldManager worldManager) { this.m_Kernel = kernel; this.m_AnalyticsEngine = analyticsEngine; this.Game = game; this.Graphics = graphics; this.World = world; this.WorldManager = worldManager; this.Window = window; }
public PurgeViewModel( Application app, ILogger logger, IResourceProvider resourceProvider, IApplicationControlFileProvider applicationControlFileProvider, IEpisodePurger episodePurger, IFileUtilities fileUtilities, ICrashReporter crashReporter, IAnalyticsEngine analyticsEngine) : base(app) { Logger = logger; ResourceProvider = resourceProvider; ApplicationControlFileProvider = applicationControlFileProvider; EpisodePurger = episodePurger; FileUtilities = fileUtilities; CrashReporter = crashReporter; AnalyticsEngine = analyticsEngine; }
public void Setup() { ResetObservedResults(); MockApplication = A.Fake <Application>(); A.CallTo(() => MockApplication.PackageName).Returns("com.andrewandderek.podcastutilities"); MockLogger = A.Fake <ILogger>(); MockResourceProvider = A.Fake <IResourceProvider>(); MockFileSystemHelper = A.Fake <IFileSystemHelper>(); MockApplicationControlFileProvider = A.Fake <IApplicationControlFileProvider>(); MockCrashReporter = A.Fake <ICrashReporter>(); MockAnalyticsEngine = A.Fake <IAnalyticsEngine>(); MockPlaylistGenerator = A.Fake <IGenerator>(); MockDriveVolumeInfoViewFactory = A.Fake <IDriveVolumeInfoViewFactory>(); MockDriveVolumeInfoView = A.Fake <IDriveVolumeInfoView>(); A.CallTo(() => MockDriveVolumeInfoViewFactory.GetNewView(MockApplication)).Returns(MockDriveVolumeInfoView); MockApplicationControlFileFactory = A.Fake <IApplicationControlFileFactory>(); ByteConverter = new ByteConverter(); SetupResources(); ViewModel = new MainViewModel( MockApplication, MockLogger, MockResourceProvider, MockApplicationControlFileProvider, MockFileSystemHelper, ByteConverter, MockCrashReporter, MockAnalyticsEngine, MockPlaylistGenerator, MockDriveVolumeInfoViewFactory, MockApplicationControlFileFactory ); ViewModel.Observables.Title += SetTitle; ViewModel.Observables.SetCacheRoot += SetCacheRoot; ViewModel.Observables.SetFeedItems += SetFeedItems; ViewModel.Observables.ShowNoDriveMessage += ShowNoDriveMessage; ViewModel.Observables.AddInfoView += AddInfoView; ViewModel.Observables.ToastMessage += ToastMessage; }
public void Initialize(IAnalyticsEngine engine) { }
public CrashlyticsReporter(IAnalyticsEngine analyticsEngine) { AnalyticsEngine = analyticsEngine; }