123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- using PDF_Master.CustomControl;
- using PDF_Master.Helper;
- using PDF_Master.ViewModels.Dialog.ConverterDialogs;
- using System.Diagnostics;
- using System.Linq;
- using System.Windows;
- using System.Windows.Controls;
- namespace PDF_Master.Views.Dialog.ConverterDialogs
- {
- /// <summary>
- /// Interaction logic for ConverterHTMLDialog
- /// </summary>
- public partial class ConverterHTMLDialog : UserControl
- {
- public ConverterHTMLDialog()
- {
- InitializeComponent();
- }
- private void ConverterPreview_Loaded(object sender, System.Windows.RoutedEventArgs e)
- {
- ConverterPreview.document = ((ConverterHTMLDialogViewModel)this.DataContext).currentViewer.Document;
- char[] enumerationSeparator = new char[] { ',' };
- char[] rangeSeparator = new char[] { '-' };
- if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, "1-" + ConverterPreview.document.PageCount.ToString(), ConverterPreview.document.PageCount, enumerationSeparator, rangeSeparator))
- { //TODO
- Trace.WriteLine("输入不对");
- AlertsMessage alertsMessage = new AlertsMessage();
- alertsMessage.ShowDialog("", App.MainPageLoader.GetString("PageRangeWarning"), App.ServiceLoader.GetString("Text_ok"));
- return;
- }
- ConverterPreview.AwaitRenderBitmap(ConverterPreview.document);
- ConverterPreview.PageIndex.Text = ConverterPreview.document.PageCount.ToString();
- }
- private void PageRangeComboBox_Loaded(object sender, RoutedEventArgs e)
- {
- PageRangeComboBox.CurrentPage = true;
- if (PageRangeComboBox.CurrentPage)
- {
- ComboBoxItem comboBoxItem = new ComboBoxItem();
- comboBoxItem.Content = App.MainPageLoader.GetString("WritableComboBox_CurrentPage");
- PageRangeComboBox.writableComboBox.Items.Insert(1, comboBoxItem);
- }
- }
- }
- }
|