private async void refreshContext()
        {
            try
            {
                Task refreshContextTask = null;
                refreshContextTask = Task.Run(() =>
                {
                    simulatedDelay();

                    SQLConnection.Close();
                    SQLConnection.Initialize(Statics.DatabaseFile);
                });
                await refreshContextTask;

                if (refreshContextTask != null)
                {
                    refreshContextTask.Dispose();
                }

                querySQL(1);
            }
            catch (Exception Ex)
            {
                LogWriter.Exception("Bummer. That search delay broke somehow.", Ex);
            }
        }
示例#2
0
        private void resetCommand(object parameter)
        {
            WindowMessageResult resetResult = MessageBoxEnhanced.Show(
                "Warning...",
                "You are about to reset the database!",
                "Any changes you have made to the current database will lost. Are you sue you wish to continue?",
                WindowMessageButtons.YesNo,
                WindowMessageIcon.Warning);

            if (resetResult == WindowMessageResult.Yes)
            {
                SQLConnection.Close();
                Statics.LoadResourceDatabase(true);
                CloseDialogWithResult(WindowMessageResult.Yes);
            }
        }