LunarPresentation/Dialogs/PageSettingDialog.xaml.cs

(开头部分) 20KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using SHomeWorkshop.LunarPresentation.Adorners;
using System;
using System.Collections.Generic;
using Microsoft.Win32;
using System.IO;
using System.Reflection;
using System.Text;

namespace SHomeWorkshop.LunarPresentation.Dialogs
{
    /// <summary>
    /// PrintPriviewSettingDialog.xaml 的交互逻辑
    /// </summary>
    public partial class PageSettingDialog : Window
    {
        public PageSettingDialog(Editor masterEditor)
        {
            InitializeComponent();

            if (masterEditor == null)
            {
                throw new Exception("masterEditor参数不能为null。");
            }

            this.masterEditor = masterEditor;
        }

        private Editor masterEditor;

        public Editor MasterEditor
        {
            get { return masterEditor; }
        }

        private void btnPreviewAndPrint_Click(object sender, RoutedEventArgs e)
        {
            if (masterEditor == null) return;

            if ((masterEditor.DefaultBackground != Brushes.White &&
                masterEditor.DefaultBackground != Brushes.Transparent) ||
                masterEditor.ExFontSize > 14)
            {
                MessageBoxResult r = Dialogs.LunarMsgBox.MsgBoxShow(
                    Globals.appName,
                    "打印当前文档会较浪费打印机耗材,真的要继续打印吗?",
                    "当前文档背景色不是白色或透明色,或者字号大于14,这样打印会严重浪费打印耗材。",
                    "您可以考虑先将编辑器配色方案改为白底黑字(命令:bdhz)或缩小字号再打印。\r\n" +
                    "——要缩小字号,请将主界面右下角的“字号缩放滑块条”拖动到最左侧。",
                    MessageBoxButton.YesNo,
                    MessageBoxImage.Warning);
                if (r != MessageBoxResult.Yes) return;
            }

            if (UpdatePageSettingIntoToDocument())
            {
后面还有 447 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。