Beispiel #1
0
        public async Task NewsTest()
        {
            using IDbConnection connection = new SqlConnection(DBConnection.connString);
            connection.Open();
            IDbTransaction transaction = connection.BeginTransaction();

            newsStorage       = new NewsStorage(connection, transaction);
            userStorage       = new UserStorage(connection, transaction);
            groupStorage      = new GroupStorage(connection, transaction);
            dictionaryStorage = new DictionaryStorage(connection, transaction);
            courseStorage     = new CourseStorage(connection, transaction);

            try
            {
                await Setup();
                await TestSelects();
                await TestUpdate();

                foreach (News newsToDelete in listNews)
                {
                    await TestDeleteNews(newsToDelete);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally {
                transaction.Rollback();
            }
        }
Beispiel #2
0
        public NewsController(IConfiguration Configuration)
        {
            string dbCon = Configuration.GetConnectionString("DefaultConnection");

            newsStorage  = new NewsStorage(dbCon);
            userStorage  = new UserStorage(dbCon);
            groupStorage = new GroupStorage(dbCon);
        }
Beispiel #3
0
        static void Main()
        {
            DownloadManager.CheckForInternetConnection();
            PathData.InitDirectories();
            CheckForUpdates();
            NewsStorage.InitDirectories();
            SettingsManager.Load();
            MinecraftUserData.loadUsers();
            ScheduleMinecraftVersionJsonDownload();
            MinecraftAssetManager.LoadAssets();
            PluginManager.LoadPlugins();
            PluginManager.EnablePlugins();

            SettingsManager.AddDefault("javapath", "java", "java.exe", Setting._Type._string);
            SettingsManager.AddDefault("MinecraftRAM", "java", "2G", Setting._Type._string);
            SettingsManager.AddDefault("Sync options", "sync", true, Setting._Type._bool);
            SettingsManager.AddDefault("Sync serverlists", "sync", true, Setting._Type._bool);

            App app = new App();

            App.sysTray = new SystemTray();

            App.logFile = (PathData.LogPath + "\\" + DateTime.Now.ToString("s").Replace(':', '-') + ".log");

            mainWindow = new MainWindow();

            SettingsManager.LoadList();

            app.Run(mainWindow);

            App.sysTray.destroy();
            PluginManager.DisablePlugins();
            InstanceManager.SaveInstances();
            MinecraftUserData.saveUsers();
            SettingsManager.Save();
            AppendLogFile();
        }