Ejemplo n.º 1
0
        public MainWindow(UserConfigManager user_config_mahager)
        {
            this.user_config_mahager = user_config_mahager;

            InitializeComponent();

            log4net.ILog log = log4net.LogManager.GetLogger(typeof(MainWindow));
            log.InfoFormat("MainWindow ctor");

            try
            {
                var vm = new Corpora_ViewModel(user_config_mahager);
                vm.SetIndexesFolder(System.Configuration.ConfigurationManager.AppSettings["indexes"]);
                vm.ConnectDB(NHibernateHelper.CreateSessionFactory());
                vm.LoadConfig();
                DataContext = vm;
            }
            catch (Exception ex)
            {
                log.Error(ex);
            }

            indexer_worker.RunWorkerCompleted += indexer_worker_RunWorkerCompleted;
            indexer_worker.DoWork             += indexer_worker_DoWork;
            indexer_worker.ProgressChanged    += indexer_worker_ProgressChanged;

            indexer_worker.WorkerSupportsCancellation = true;
            indexer_worker.WorkerReportsProgress      = true;
        }
Ejemplo n.º 2
0
        void App_Startup(object sender, StartupEventArgs e)
        {
            log4net.Config.XmlConfigurator.Configure();

            UserConfigManager user_cfg_manager = new UserConfigManager();

            user_cfg_manager.AllowSaving = false;
            MainWindow mainWindow = new MainWindow(user_cfg_manager);

            mainWindow.Show();
            user_cfg_manager.AllowSaving = true;
        }
Ejemplo n.º 3
0
 public Corpora_ViewModel(UserConfigManager user_config_manager)
 {
     Contract.Ensures(this.user_config_manager != null);
     this.user_config_manager = user_config_manager;
 }