Esempio n. 1
0
        public search()
        {
            InitializeComponent();

            Szotar.LocalizationProvider.Default = new Szotar.WindowsForms.LocalizationProvider();

            try
            {
                DataStore.InitializeDatabase();
            }
            catch (Szotar.Sqlite.DatabaseVersionException e)
            {
                Errors.NewerDatabaseVersion(e);
                return;
            }
            catch (System.IO.FileNotFoundException e)
            {
                if (e.FileName.StartsWith("System.Data.SQLite"))
                    Errors.DllNotFound("System.Data.SQLite.dll", e);
                else
                    Errors.FileNotFound(e);
                return;
            }
            catch (System.IO.IOException e)
            {
                Errors.CannotOpenDatabase(e);
                return;
            }
            catch (System.Data.Common.DbException e)
            {
                Errors.CannotOpenDatabase(e);
                return;
            }

            importer = new QuizletImporter();

            //if (components == null)
            //    components = new System.ComponentModel.Container();

            cts = new CancellationTokenSource();
            //components.Add(disposableComponent = new DisposableComponent(cts));

            searching = false;
            //importButton.Enabled = false;
            //searchResults.SelectedIndexChanged += SearchResultsSelectedIndexChanged;
        }
Esempio n. 2
0
        public QuizletSetSelector()
        {
            InitializeComponent();

            importer = new QuizletImporter();

            if (components == null)
            {
                components = new System.ComponentModel.Container();
            }

            cts = new CancellationTokenSource();
            components.Add(disposableComponent = new DisposableComponent(cts));

            searching            = false;
            importButton.Enabled = false;
            searchResults.SelectedIndexChanged += SearchResultsSelectedIndexChanged;
        }
Esempio n. 3
0
        public searchViewModel()
        {
            SearchResults = new FastObservableCollection<SetModel>();
            SearchResultsView = CollectionViewSource.GetDefaultView(SearchResults);

            //Errors = new FastObservableCollection<string>();


            Szotar.LocalizationProvider.Default = new Szotar.WindowsForms.LocalizationProvider();

            try
            {
                DataStore.InitializeDatabase();
            }
            catch (Szotar.Sqlite.DatabaseVersionException e)
            {
                Errors.NewerDatabaseVersion(e);
                return;
            }
            catch (System.IO.FileNotFoundException e)
            {
                if (e.FileName.StartsWith("System.Data.SQLite"))
                    Errors.DllNotFound("System.Data.SQLite.dll", e);
                else
                    Errors.FileNotFound(e);
                return;
            }
            catch (System.IO.IOException e)
            {
                Errors.CannotOpenDatabase(e);
                return;
            }
            catch (System.Data.Common.DbException e)
            {
                Errors.CannotOpenDatabase(e);
                return;
            }



            importer = new QuizletImporter();

            //if (components == null)
            //    components = new System.ComponentModel.Container();

            cts = new CancellationTokenSource();
            //components.Add(disposableComponent = new DisposableComponent(cts));

            searching = false;
        }
Esempio n. 4
0
        private void szotar_quizlet_initialization()
        {
            Szotar.LocalizationProvider.Default = new Szotar.WindowsForms.LocalizationProvider();

            try
            {
                DataStore.InitializeDatabase();
            }
            catch (Szotar.Sqlite.DatabaseVersionException e)
            {
                Errors.NewerDatabaseVersion(e);
                return;
            }
            catch (System.IO.FileNotFoundException e)
            {
                if (e.FileName.StartsWith("System.Data.SQLite"))
                    Errors.DllNotFound("System.Data.SQLite.dll", e);
                else
                    Errors.FileNotFound(e);
                return;
            }
            catch (System.IO.IOException e)
            {
                Errors.CannotOpenDatabase(e);
                return;
            }
            catch (System.Data.Common.DbException e)
            {
                Errors.CannotOpenDatabase(e);
                return;
            }

            QuizletImporter quizletImporter = new QuizletImporter();
            quizletImporter.Completed += quizletImporter_Completed;
            quizletImporter.Set = 1883437; // some hungarian word list as sample
            quizletImporter.BeginImport();
        }