Пример #1
0
 /// <summary>
 /// Closes all application windows and quit the application.
 /// </summary>
 public static void Quit()
 {
     if (IsRunningInUnitTest)
     {
         EchoLogger.Close();
     }
     RequestQuit = true;
 }
Пример #2
0
        internal static void InitSysDependencies()
        {
            Time.Init();

            // load logger
            if (IsRunningInUnitTest)
            {
                try
                {
                    Logger = new EchoLogger();
                    EchoLogger.Show();
                    Log.Enabled = true;
                }
                catch (System.Net.Sockets.SocketException)
                {
                    Debug.WriteLine("Failed to connect to EchoLogger. The program will continue without logging.");
                    Log.Enabled = false;
                }
            }
            else
            {
                Logger      = new ConsoleLogger();
                Log.Enabled = true;
            }
            Log.Init(Logger);

            // load platform context:
            //     platform-dependent implementation
            if (CurrentOS.IsAndroid)
            {
                PlatformContext = OSImplentation.Android.AndroidContext.MapFactory();
            }
            else if (CurrentOS.IsWindows)
            {
                PlatformContext = OSImplentation.Windows.WindowsContext.MapFactory();
            }
            else if (CurrentOS.IsLinux)
            {
                PlatformContext = OSImplentation.Linux.LinuxContext.MapFactory();
            }
        }