Beispiel #1
0
 public CustomizedInsertViewModel(FadeInWriter fadeInWriter, HistoryViewModel historyViewModel)
 {
     _fadeInWriter     = fadeInWriter;
     _historyViewModel = historyViewModel;
     CustomInserts     = new List <CustomListViewModel>();
     LoadInserts();
     CustomInsertViewSource.Source = CustomInserts;
 }
Beispiel #2
0
 public BibleViewModel(List <BibleBook> bible, FadeInWriter fadeInWriter, HistoryViewModel historyViewModel)
 {
     Bible                     = new ObservableCollection <BibleBook>(bible);
     _fadeInWriter             = fadeInWriter;
     _historyViewModel         = historyViewModel;
     _bibleValidationViewModel = new BibleValidationViewModel(bible);
     _bibleValidationViewModel.ErrorsChanged += ErrorViewModel_ErrorChanged;
 }
Beispiel #3
0
 public HymnalInputViewModel(List <Song> hymnalList, string bookname, FadeInWriter fadeInWriter, HistoryViewModel historyViewModel)
 {
     VerseList         = new ObservableCollection <SelectedVerse>();
     _historyViewModel = historyViewModel;
     _fadeInWriter     = fadeInWriter;
     _currentHymnal    = hymnalList;
     _bookname         = bookname;
 }
        public MinistryViewModel(FadeInWriter fadeInWriter, HistoryViewModel historyViewModel)
        {
            _historyViewModel = historyViewModel;
            _fadeInWriter     = fadeInWriter;
            Ministries        = new ObservableCollection <MinistryGridViewModel>();

            if (_readerWriter.LoadMinistryData() != null)
            {
                Ministries = _readerWriter.LoadMinistryData();
            }

            UpdateFunctionList();

            MinistryViewSource.Source     = Ministries;
            Ministries.CollectionChanged += CollectionChanged;
            MinistryViewSource.Filter    += MinistryViewSource_Filter;
        }
        public WindowViewModel(PositionData positionData, BiblewordPositionData biblewordPositionData)
        {
            var fadeInWriter = new FadeInWriter(positionData, biblewordPositionData);

            HistoryViewModel = new HistoryViewModel(fadeInWriter);

            _log.Info("Load Data");
            _gbData = new HymnalInputViewModel(HymnalJsonReader.LoadHymnalData($"{Directory.GetCurrentDirectory()}/DataSource/GB_Data.json"), "Gesangbuch", fadeInWriter, HistoryViewModel);
            _cbData = new HymnalInputViewModel(HymnalJsonReader.LoadHymnalData($"{Directory.GetCurrentDirectory()}/DataSource/CB_Data.json"), "Chorbuch", fadeInWriter, HistoryViewModel);

            HymnalInputVisible   = true;
            BibleInputVisible    = false;
            CustomInputVisible   = false;
            MinistryInputVisible = false;

            _log.Info("Load Ministry");
            MinistryViewModel   = new MinistryViewModel(fadeInWriter, HistoryViewModel);
            CustomizedViewModel = new CustomizedInsertViewModel(fadeInWriter, HistoryViewModel);

            _log.Info("Load PreviewMode");
            PreviewViewModel = new PreviewViewModel(fadeInWriter.CurrentFade);

            ConfigViewModel.OnLoadMinistries       += UpdateMinistries;
            ConfigViewModel.OnResetMinistries      += ResetMinistries;
            ConfigViewModel.OnUpdateFullscreenMode += UpdateFullscreenMode;
            ConfigViewModel.OnUpdatePreview        += UpdatePreviewMode;
            ConfigViewModel.OnSaveMinistries       += SaveMinistries;
            fadeInWriter.OnInsertUpdate            += UpdatePreview;

            CurrentHymnalViewModel = _gbData;

            _previewWindow = new PreviewWindowController(PreviewViewModel);

            _log.Info("ReadBible");
            BibleViewModel = new BibleViewModel(BibleJsonReader.LoadBibleData($"{Directory.GetCurrentDirectory()}/DataSource/Bible_Data.json"), fadeInWriter, HistoryViewModel);
            //BibleViewModel.OpenBibleBrowser += OnOpenBibleBrowser;

            _log.Info("Create Preview");
            SetPreview(Properties.Settings.Default.ShowPreviewPicture);

            if (Properties.Settings.Default.ShowInsertInFullscreen)
            {
                _previewWindow.Show();
            }
        }
        /// <summary>
        /// Returns the type of the item that can be dropped
        /// </summary>

        #region Public Constructors

        public HistoryViewModel(FadeInWriter fadeInWriter)
        {
            _fadeInWriter            = fadeInWriter;
            HistoryViewSource.Source = History;
        }
Beispiel #7
0
        protected override void OnStartup(StartupEventArgs e)
        {
            _log.Info("Startup App");

            string path                  = $"{Environment.GetEnvironmentVariable("userprofile")}/InsertCreator";
            string positionPath          = $"{Environment.GetEnvironmentVariable("userprofile")}/InsertCreator/Position.Json";
            string bibleTextPositionPath = $"{Environment.GetEnvironmentVariable("userprofile")}/InsertCreator/BibleTextPosition.Json";

            PositionJsonReaderWriter positionDatajsonReaderWriter = new PositionJsonReaderWriter();

            PositionData          positionData          = new PositionData();
            BiblewordPositionData biblewordPositionData = new BiblewordPositionData();

            _log.Info("Check InsertCreator Directory");
            if (!Directory.Exists(path))
            {
                _log.Info("Create InsertCreator Directory");
                Directory.CreateDirectory(path);
            }

            _log.Info("Check Position Data file");
            if (!File.Exists(positionPath))
            {
                _log.Info("Create Position Data file");
                var file = File.Create(positionPath, 1024);
                file.Close();
                positionDatajsonReaderWriter.WritePositionData(positionData, positionPath);
            }
            else
            {
                positionDatajsonReaderWriter.LoadPositionData(ref positionData, positionPath);
            }

            _log.Info("Check Bible Position Data file");
            if (!File.Exists(bibleTextPositionPath))
            {
                _log.Info("Create Bible Position Data file");
                var file = File.Create(bibleTextPositionPath, 1024);
                file.Close();
                positionDatajsonReaderWriter.WritePositionData(biblewordPositionData, bibleTextPositionPath);
            }
            else
            {
                positionDatajsonReaderWriter.LoadPositionData(ref biblewordPositionData, bibleTextPositionPath);
            }

            FadeInWriter fadeInWriter = new FadeInWriter(positionData, biblewordPositionData);

            _log.Info("Create Ministry.json");
            FileCreate("Ministry.json", path);
            FileCreate("Insert.json", path);

            _log.Info("Load Images");
            fadeInWriter.ResetFade();

            var vm = new WindowViewModel(positionData, biblewordPositionData);

            _log.Info("Open Window");
            var window = new MainWindow(vm);

            window.Show();
        }