LunarMind/ConceptWidgets/_PaperInfo.cs

(开头部分) 11KB

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

using System.Collections.Generic;

namespace SHomeWorkshop.LunarConcept
{
    /// <summary>
    /// 纸张信息。由物理纸张尺寸转化为WPF纸张尺寸(96DPI下)。
    /// </summary>
    public class PaperInfo
    {
        /// <summary>
        /// [构造方法]
        /// </summary>
        /// <param name="name">纸张类型名称。例如:A4</param>
        /// <param name="shortSideWPFUnit">会自动取“shortSideWPFUnit”和“longSideWPFUnit”这两个参数中较小的值来初始化“ShortSideWPFUnit”属性。</param>
        /// <param name="longSideWPFUnit">会自动取“shortSideWPFUnit”和“longSideWPFUnit”这两个参数中较大的值来初始化“LongSideWPFUnit”属性。</param>
        /// <param name="shortSidePixcelCount">与前两个参数类似,后两个参数也会自动比较大小。</param>
        /// <param name="longSidePixcelCount">与前两个参数类似,后两个参数也会自动比较大小。</param>
        public PaperInfo(string name, double shortSideWPFUnit, double longSideWPFUnit,
            int shortSidePixcelCount, int longSidePixcelCount)
        {
            paperTypeName = name;

            if (shortSideWPFUnit < longSideWPFUnit)
            {
                this.shortSideWPFUnit = shortSideWPFUnit;
                this.longSideWPFUnit = longSideWPFUnit;
            }
            else
            {
                this.shortSideWPFUnit = longSideWPFUnit;
                this.longSideWPFUnit = shortSideWPFUnit;
            }

            if (shortSidePixcelCount < longSidePixcelCount)
            {
                this.shortSidePixcelCount = shortSidePixcelCount;
                this.longSidePixcelCount = longSidePixcelCount;
            }
            else
            {
                this.shortSidePixcelCount = longSidePixcelCount;
                this.longSidePixcelCount = shortSidePixcelCount;
            }
        }

        private static List<PaperInfo> paperInfos = new List<PaperInfo>();

        static PaperInfo()
        {
            //幻灯片尺寸(适合1024×768的显示器,这是考虑到当前使用的投影仪)
            //paperInfos.Add(new PaperInfo("Slide", 600, 940, 1950, 2938));
            //手头所有投影仪都是640*480,因此,修改之。另,着手做“扩展到投影屏幕功能”。2013年1月1日
            paperInfos.Add(new PaperInfo("Slide640_480", 480, 640, 1560, 2080));
            paperInfos.Add(new PaperInfo("Slide800_600", 600, 800, 1950, 2600));
            paperInfos.Add(new PaperInfo("Slide1024_768", 768, 1024, 2496, 3328));

            paperInfos.Add(new PaperInfo("Slide480_640", 480, 640, 1560, 2080));
            paperInfos.Add(new PaperInfo("Slide600_800", 600, 800, 1950, 2600));
            paperInfos.Add(new PaperInfo("Slide768_1024", 768, 1024, 2496, 3328));

后面还有 225 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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