Exemple #1
0
        public MainSearchViewModel(RegionManager regionManager, IFetchFromXml ifetch_)
        {
            _regionManager        = regionManager;
            ifetch                = ifetch_;
            OtherLangBooks        = ifetch.FetchOtherLangBooknames(current_language);
            Books                 = ifetch.FetchBooknames(current_language);
            Bookselected          = 0;
            SearchforVerse        = new DelegateCommand(searchforverse);
            ShoworHideLiveScreen  = new DelegateCommand(showorhideLive);
            BrowseBackgroundImage = new DelegateCommand(BrowseImage);
            livewindow            = new Window();
            ls = new LiveScreen();
            pv = new PrevSearch();
            livewindow.Name          = "LiveWindow";
            livewindow.Title         = "Live";
            livewindow.Content       = ls;
            ls.verseContent.FontSize = Convert.ToDouble(SliderValueBinding);
            if (Properties.Settings.Default.FontColor != "" && Properties.Settings.Default.FontColor != "0")
            {
                Brush brush = new SolidColorBrush((Color)ColorConverter.ConvertFromString(Properties.Settings.Default.FontColor));
                ls.chapterlabel.Foreground = brush;
                ls.verseContent.Foreground = brush;
                FontColor = (Color)ColorConverter.ConvertFromString(Properties.Settings.Default.FontColor);;
            }
            ls.livebackgroundimage.Source = new BitmapImage(new Uri(Properties.Settings.Default.BackgroundImage, UriKind.Relative));
            LangSelection = new DelegateCommand <object>(languagechanged);
            WindowExt.MaximizeToSecondaryMonitor(livewindow);
            ls.UpdateLayout();
            livewindow.Content     = ls;
            livewindow.WindowStyle = WindowStyle.None;
            livewindow.Hide();

            //FontColor =  (Color)ColorConverter.ConvertFromString(Properties.Settings.Default.FontColor);
            ClearTempVerse();
        }
Exemple #2
0
        //private void showorhideLive(object obj)
        //{
        //    //throw new NotImplementedException();
        //}

        private void showorhideLive()
        {
            //throw new NotImplementedException();
            if (WindowExt.IsWindowOpen <Window>("LiveWindow"))
            {
                if (!livewindow.IsVisible)
                {
                    livewindow.Show();
                }
                else
                {
                    livewindow.Hide();
                }
            }
        }
Exemple #3
0
        private async Task InitSelenium()
        {
            await Task.Run(() =>
            {
                driverFactory = new DriverFactory();
                driver        = driverFactory.CreateDriver();
                reg           = new RegistrationPage(driver);

                //sizing
                var screen = WindowExt.GetSecondaryScreen().WorkingArea;
                driver.Manage().Window.Size = new Size(screen.Width / 2, screen.Height - 200);

                //move window to the left if 2 screens
                if (Screen.AllScreens.Length > 1)
                {
                    driver.Manage().Window.Position = new Point(-1500, 0);
                }
            });
        }
Exemple #4
0
        public Form1()
        {
            InitializeComponent();

            grpTimer.Paint += PaintBorderlessGroupBox;

            timePickerFrom.Format       = DateTimePickerFormat.Custom;
            timePickerFrom.CustomFormat = "HH:mm"; // Only use hours and minutes
            timePickerFrom.ShowUpDown   = true;

            backgroundWorker1.WorkerReportsProgress = true;
            backgroundWorker1.DoWork             += backgroundWorker1_DoWork;
            backgroundWorker1.ProgressChanged    += BackgroundWorker1_ProgressChanged;
            backgroundWorker1.RunWorkerCompleted += backgroundWorker1_RunWorkerCompleted;

            backgroundWorker2.DoWork             += backgroundWorker2_DoWork;
            backgroundWorker2.RunWorkerCompleted += backgroundWorker2_RunWorkerCompleted;

            progressBar1.Minimum = 0;
            progressBar1.Maximum = 5;
            progressBar1.Value   = 1;

            lastChecked = chbManchester;

            timer1.Enabled = false;
            seconds        = GetFrequencySeconds();
            txbFrequency_Leave(this, null);

            WindowExt.HalfSizeOnSecondaryMonitor(this);

            if (IsTimeRight)
            {
                KickOffSeleniumInBackground();
                //StartTimer();
            }
        }
Exemple #5
0
        private void searchforverse()
        {
            //if (!string.IsNullOrEmpty(value))
            //{
            myverselist          = ifetch.FetchVerseNos(current_language, _bookselected + 1, _chapterselected);
            Verses               = myverselist[0];
            Verselist            = myverselist[1];
            pv.vlist.ItemsSource = Verselist;
            index = Convert.ToInt32(Verseselected) - 1;
            int itemCount = pv.vlist.Items.Count;

            if (itemCount == 0)
            {
                return;
            }
            if (index >= itemCount)
            {
                index = itemCount - 1;
            }
            double listHeight = pv.vlist.Height;
            double yPos       = (listHeight / itemCount) * index;

            if (current_language != "English")
            {
                pv.prev_chaptername.Text = OtherLangBooks[_bookselected] + " " + _chapterselected;
            }
            else
            {
                pv.prev_chaptername.Text = Books[_bookselected] + " " + _chapterselected;
            }
            pv.vlist.SelectedIndex = index;
            pv.vlist.ScrollIntoView(pv.vlist.SelectedItem);
            pv.UpdateLayout();
            if (_regionManager.Regions["PreviewRegion"].Views.Count() != 0)
            {
                var Preview = _regionManager.Regions["PreviewRegion"].Views.ElementAt(0);
                _regionManager.Regions["PreviewRegion"].Remove(Preview);
            }
            _regionManager.Regions["PreviewRegion"].Add(pv);
            if (showlive)
            {
                if (!WindowExt.IsWindowOpen <Window>("LiveWindow") && ls != null)
                {
                    livewindow         = new Window();
                    ls                 = new LiveScreen();
                    livewindow.Name    = "LiveWindow";
                    livewindow.Title   = "Live";
                    livewindow.Content = ls;
                    WindowExt.MaximizeToSecondaryMonitor(livewindow);
                    livewindow.WindowStyle = WindowStyle.None;
                    livewindow.Show();
                }
                ls.verseContent.Text     = Verselist[index].ToString();
                ls.chapterlabel.Text     = _bookselected + " " + _chapterselected;
                ls.verseContent.FontSize = Convert.ToDouble(SliderValueBinding);
                if (Properties.Settings.Default.FontColor != "" && Properties.Settings.Default.FontColor != "0")
                {
                    Brush brush = new SolidColorBrush((Color)ColorConverter.ConvertFromString(Properties.Settings.Default.FontColor));
                    ls.verseContent.Foreground = brush;
                    ls.chapterlabel.Foreground = brush;
                }
                ls.livebackgroundimage.Source             = new BitmapImage(new Uri(Properties.Settings.Default.BackgroundImage, UriKind.Relative));
                Properties.Settings.Default.VerseFontSize = Convert.ToDouble(SliderValueBinding);
                Properties.Settings.Default.CurVerse      = Verselist[index].ToString();
                Properties.Settings.Default.Save();
                ls.UpdateLayout();
            }
            showlive = true;
            //}
        }