Ejemplo n.º 1
0
        public MainWindow(string dbpath)
        {
            db_ = new SQLiteConnection(dbpath);
            db_.CreateTable <Task>();
            db_.CreateTable <ProgSettings>();
            tasks_    = new ObservableCollection <Task>(db_.Table <Task>().OrderBy(t => t.Order));
            settings_ = db_.Find <ProgSettings>(1);

            minimise_ = new MinimizeToTray(this, settings_.BallonShown);

            settings_.Plugins = new ObservableCollection <Plugin>(new Plugin[] {
                new PluginCore(settings_),
                new PluginWords(db_),
                new PluginExercises(db_),
            });

            if (settings_ == null)
            {
                settings_ = new ProgSettings(db_);
            }
            else
            {
                settings_.DB = db_;
            }
            foreach (Task newItem in tasks_)
            {
                newItem.PropertyChanged += this.OnItemPropertyChanged;
            }

            InitializeComponent();
            List_Tasks.ItemsSource = tasks_;
            Text_Add_Item.Focus();

            workArc_.Right  = true;
            playArc_.Right  = false;
            workGrey_.Right = false;
            playGrey_.Right = true;

            customRenders_.Add(workArc_);
            customRenders_.Add(playArc_);
            customRenders_.Add(workGrey_);
            customRenders_.Add(playGrey_);

            this.ResetTimer(true, DateTime.Now);

            App.Tick += Tick;
            Closed   += MainWindow_Closed;

            mediaPlayer_.Open(new Uri(Environment.CurrentDirectory + "\\bell.mp3"));
            mediaPlayer_.Volume = 1.0;

            tasks_.CollectionChanged += this.OnCollectionChanged;
        }
Ejemplo n.º 2
0
 public MoreWindow(ProgSettings settings)
 {
     InitializeComponent();
     List_Plugins.ItemsSource = settings.Plugins;
 }
Ejemplo n.º 3
0
 public MoreWindow(ProgSettings settings)
 {
     InitializeComponent();
     List_Plugins.ItemsSource = settings.Plugins;
 }
Ejemplo n.º 4
0
        public MainWindow(string dbpath)
        {
            db_ = new SQLiteConnection(dbpath);
            db_.CreateTable<Task>();
            db_.CreateTable<ProgSettings>();
            tasks_ = new ObservableCollection<Task>(db_.Table<Task>().OrderBy(t => t.Order));
            settings_ = db_.Find<ProgSettings>(1);

            minimise_ = new MinimizeToTray(this, settings_.BallonShown);

            settings_.Plugins = new ObservableCollection<Plugin>(new Plugin[] { new PluginCore(settings_), new PluginWords(db_) });

            if (settings_ == null)
                settings_ = new ProgSettings(db_);
            else
                settings_.DB = db_;
            foreach (Task newItem in tasks_)
            {
                newItem.PropertyChanged += this.OnItemPropertyChanged;
            }

            InitializeComponent();
            List_Tasks.ItemsSource = tasks_;
            Text_Add_Item.Focus();

            workArc_.Right = true;
            playArc_.Right = false;
            workGrey_.Right = false;
            playGrey_.Right = true;

            customRenders_.Add(workArc_);
            customRenders_.Add(playArc_);
            customRenders_.Add(workGrey_);
            customRenders_.Add(playGrey_);

            this.ResetTimer(true, DateTime.Now);

            App.Tick += Tick;
            Closed += MainWindow_Closed;

            mediaPlayer_.Open(new Uri(Environment.CurrentDirectory + "\\bell.mp3"));
            mediaPlayer_.Volume = 1.0;

            tasks_.CollectionChanged += this.OnCollectionChanged;
        }