예제 #1
0
        private static void LinkImage_Selected(object sender, MouseButtonEventArgs e)
        {
            try
            {
                Image item = (Image)sender;

                string verseKey = item.Tag.ParseToString();

                Type linkViewerType = Type.GetType("Bibles.Link.LinkViewer,Bibles.Link");

                UserControlBase linkViewer = Activator.CreateInstance(linkViewerType, new object[] { verseKey }) as UserControlBase;

                if (ControlDialog.ShowDialog("Link Viewer", linkViewer, "SaveComments", autoSize: false).IsFalse())
                {
                    return;
                }

                string[] deletedLinks = linkViewer.GetPropertyValue("GetDeletedLinks").To <string[]>();

                foreach (string key in deletedLinks)
                {
                    BibleLoader.LinkViewerClosed?.Invoke(linkViewer, key);
                }
            }
            catch (Exception err)
            {
                ErrorLog.ShowError(err);
            }
        }
예제 #2
0
        private void SubjectHeder_Browsed(object sender, string buttonKey)
        {
            try
            {
                switch (buttonKey)
                {
                case "StudyCategoryBrowse":

                    StudyCategories category = new StudyCategories();

                    if (ControlDialog.ShowDialog("Categories", category, string.Empty, autoSize: false).IsFalse())
                    {
                        return;
                    }

                    if (category.SelectedCategory == null)
                    {
                        throw new ApplicationException("Category not Selected.");
                    }

                    StudyCategoryModel categoryModel = category.SelectedCategory;

                    this.SubjectHeader.StudyCategoryId = categoryModel.StudyCategoryId;

                    this.SubjectHeader.StudyCategoryName = categoryModel.CategoryName;

                    break;
                }
            }
            catch (Exception err)
            {
                ErrorLog.ShowError(err);
            }
        }
예제 #3
0
        private void LinkVerse_Cliked(object sender, RoutedEventArgs e)
        {
            if (this.SelectedVerseKey.IsNullEmptyOrWhiteSpace() ||
                Formatters.GetVerseFromKey(this.SelectedVerseKey) <= 0 ||
                this.SelectedSide == ParalelleSideEnum.None)
            {
                MessageDisplay.Show("Please select a Verse.");

                return;
            }

            try
            {
                Type linkType = Type.GetType("Bibles.Link.LinkEditor,Bibles.Link");

                object[] args = new object[]
                {
                    this.selectedBibleId,
                    this.SelectedSide == ParalelleSideEnum.Left ?
                    this.versesDictionaryLeft[Formatters.GetVerseFromKey(this.SelectedVerseKey)]
                        :
                    this.versesDictionaryRight[Formatters.GetVerseFromKey(this.SelectedVerseKey)]
                };

                UserControlBase linkEditor = Activator.CreateInstance(linkType, args) as UserControlBase;

                string title = $"Link - {GlobalStaticData.Intance.GetKeyDescription(this.SelectedVerseKey)}";

                linkEditor.Height = this.Height;

                if (ControlDialog.ShowDialog(title, linkEditor, "AcceptLink", false).IsFalse())
                {
                    return;
                }

                int selectedVerse = Formatters.GetVerseFromKey(this.selectedKey);

                BibleLoader.RefreshVerseNumberPanel
                (
                    this.loadedVerseStackDictionaryLeft[selectedVerse],
                    this.BibleLeft.BibleId,
                    this.versesDictionaryLeft[selectedVerse]
                );

                BibleLoader.RefreshVerseNumberPanel
                (
                    this.loadedVerseStackDictionaryRight[selectedVerse],
                    this.BibleRight.BibleId,
                    this.versesDictionaryRight[selectedVerse]
                );
            }
            catch (Exception err)
            {
                ErrorLog.ShowError(err);
            }
        }
예제 #4
0
        private void OpenStudy_Cliked(object sender, RoutedEventArgs e)
        {
            try
            {
                StudiesByCategory study = new StudiesByCategory();

                ControlDialog.ShowDialog("Open Study", study, string.Empty, autoSize: false, showCancelButton: false);
            }
            catch (Exception err)
            {
                ErrorLog.ShowError(err);
            }
        }
        private void OpenStudy_Cliked(object sender, RoutedEventArgs e)
        {
            try
            {
                StudiesByCategory study = new StudiesByCategory();

                ControlDialog.ShowDialog("Open Study", study, "TryEditStudy", autoSize: false);
            }
            catch (Exception err)
            {
                ErrorLog.ShowError(err);
            }
        }
        private void Downloads_Cliked(object sender, RoutedEventArgs e)
        {
            try
            {
                DownloadsView down = new DownloadsView();

                if (ControlDialog.ShowDialog("Downloads", down, "DownLoad", autoSize: false).IsFalse())
                {
                    return;
                }
            }
            catch (Exception err)
            {
                ErrorLog.ShowError(err);
            }
        }
        public static bool?ShowDialog(string windowTitle, string text)
        {
            TextEditing.Text = text;

            textControl = new TextEditorControl(text);

            bool?result = ControlDialog.ShowDialog(windowTitle, textControl, string.Empty);

            if (result.IsTrue())
            {
                TextEditing.Text = textControl.Text;
            }

            textControl = null;

            return(result);
        }
        private void LinkVerse_Cliked(object sender, RoutedEventArgs e)
        {
            if (this.selectedKey.IsNullEmptyOrWhiteSpace())
            {
                MessageDisplay.Show("Please select a Verse.");

                return;
            }

            try
            {
                Type linkType = Type.GetType("Bibles.Link.LinkEditor,Bibles.Link");

                BibleVerseModel verseModel = this.uxSearchPager
                                             .ItemsSource
                                             .Items
                                             .FirstOrDefault(vk => ((BibleVerseModel)vk).BibleVerseKey == this.selectedKey)
                                             .To <BibleVerseModel>();

                object[] args = new object[]
                {
                    Formatters.GetBibleFromKey(this.selectedKey),
                    verseModel
                };

                UserControlBase linkEditor = Activator.CreateInstance(linkType, args) as UserControlBase;

                string title = $"Link - {GlobalStaticData.Intance.GetKeyDescription(this.selectedKey)}";

                linkEditor.Height = this.Height;

                if (ControlDialog.ShowDialog(title, linkEditor, "AcceptLink", false).IsFalse())
                {
                    return;
                }

                int selectedVerse = Formatters.GetVerseFromKey(this.selectedKey);
            }
            catch (Exception err)
            {
                ErrorLog.ShowError(err);
            }
        }
        private void ChangeCategory_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (this.SelectedHeaderAndFooter == null)
                {
                    MessageBox.Show("Please select a Report.");

                    return;
                }

                CategorySelector selector = new CategorySelector();

                if (ControlDialog.ShowDialog("Report Categories", selector, string.Empty).IsFalse())
                {
                    return;
                }

                if (this.SelectedHeaderAndFooter.CategoryId == selector.SelectedCategoryId)
                {
                    return;
                }

                this.SelectedHeaderAndFooter.CategoryId = selector.SelectedCategoryId;

                ReportTablesRepository repo = new ReportTablesRepository();

                repo.UpdateReportMaster(this.SelectedHeaderAndFooter);

                this.HeadersAndFooters = this.HeadersAndFooters.Remove(this.SelectedHeaderAndFooter);
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }
        }
예제 #10
0
        private void About_Cliked(object sender, RoutedEventArgs e)
        {
            About about = new About();

            ControlDialog.ShowDialog("About", about, string.Empty, showCancelButton: false);
        }