private void OnExportToXmlForInDesign(object sender, EventArgs e)
        {
            using (var d = new InDesignXmlInformationDialog())
            {
                d.ShowDialog();
            }
            using (var dlg = new SaveFileDialog())
            {
                dlg.FileName         = Path.GetFileNameWithoutExtension(SelectedBook.GetPathHtmlFile()) + ".xml";
                dlg.InitialDirectory = SelectedBook.FolderPath;
                if (DialogResult.OK == dlg.ShowDialog())
                {
                    try
                    {
                        _model.ExportInDesignXml(dlg.FileName);
#if !MONO
                        Process.Start("explorer.exe", "/select, \"" + dlg.FileName + "\"");
#endif
                        Analytics.Track("Exported XML For InDesign");
                    }
                    catch (Exception error)
                    {
                        Palaso.Reporting.ErrorReport.NotifyUserOfProblem(error, "Could not export the book to XML");
                        Analytics.ReportException(error);
                    }
                }
            }
        }
Example #2
0
 public SelectBooksWindow()
 {
     sBook = new SelectedBook();
     dr    = new DataRelation();
     InitializeComponent();
     FillDG();
 }
Example #3
0
        /// <summary>
        /// Loads the details of the book from the service into thier properties
        /// </summary>
        /// <returns>Runnable task</returns>
        private async Task LoadDetails()
        {
            IsLoading = true;
            await SelectedBook.LoadDetails();

            IsHyperLink = IsHyperLink;
            IsLoading   = false;
        }
Example #4
0
    void OnMouseUp()
    {
#else
    void OnHoverMouseUp()
    {
#endif

        if (!librarian.CanSelect())
        {
            return;
        }

        Wall.ShelfSelected(this);
        Select();
    }

#if MOBILE
    void OnMouseOver()
    {
#else
    void OnHover()
    {
#endif

        highlight.SetActive(true);
        librarian.HoveringOver(this);
    }

#if MOBILE
    void OnMouseExit()
    {
#else
    void OnHoverExit()
    {
#endif

        highlight.SetActive(false);
        librarian.HoveringOverEnded(this);
    }

    public void Select()
    {
        IsSelected          = true;
        boxCollider.enabled = false;
    }

    public void Deselect()
    {
        IsSelected = false;
        if (SelectedBook != null)
        {
            SelectedBook.Deselect();
        }
        SelectedBook = null;

        boxCollider.enabled = true;
    }
Example #5
0
 /// <summary>
 /// 選択中の書籍を削除する
 /// </summary>
 /// <param name="o">コマンド引数</param>
 private void RemoveBook(object o)
 {
     if (SelectedBook != null && UserConfirm("確認", "選択した書籍を削除しますか?", MessageBoxButton.YesNo, MessageBoxImage.Warning))
     {
         SelectedBook.Delete();
         Books.Remove(SelectedBook);
         SelectedBook = null;
     }
 }
 private void ReserveBook(object parameter)
 {
     if (SelectedBook != null)
     {
         int        bookID = SelectedBook.BookID;
         NormalUser user   = new NormalUser();
         if (user.ReserveBook(bookID))
         {
             SelectedBook.ReservedBy = User.Username;
             SelectedBook.updateDatabase();
             LoadBooks();
         }
     }
 }
Example #7
0
        public async Task <object> SelectCourse(SelectedBook book)
        {
            try
            {
                await context.SelectedBooks.AddAsync(book);

                await context.SaveChangesAsync();

                return(book);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
 public void Delete(SelectedBook selectedBook)
 {
     _context.SelectedBooks.Attach(selectedBook);
     _context.SelectedBooks.Remove(selectedBook);
     _context.SaveChanges();
 }
        // TODO: Странное название метода

        /**
         * Answer:
         * Поменял название
         */
        public void AddSelectedBook(SelectedBook selectedBook)
        {
            _context.SelectedBooks.Add(selectedBook);
            _context.SaveChanges();
        }