LunarMind/LMETools/DemoResourceCard.cs

(开头部分) 5KB

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

using SHomeWorkshop.LunarMind.Dialogs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Imaging;

namespace SHomeWorkshop.LunarMind.LMETools
{
    public class DemoResourceCard : Window
    {
        public DemoResourceCard(GraphicDemonstrator demoWin, DemoResourceButton masterResourceButton)
        {
            this.Height = 400;
            this.Width = 500;
            this.WindowStyle = WindowStyle.ToolWindow;   // 注意:不能用普通窗口,否则最小化时易出问题。

            this.Owner = demoWin;
            this.masterResourceButton = masterResourceButton;

            try
            {
                var path = MasterResourceButton.ResourceInfo.AbsolutePath.ToLower();
                var htmlpath = "";
                if (path.EndsWith(".html"))
                {
                    htmlpath = path;
                }
                else if (path.EndsWith(".md"))
                {
                    htmlpath = path.Substring(0, path.Length - 3) + ".html";
                }

                if (htmlpath.EndsWith(".html"))
                {
                    if (System.IO.File.Exists(htmlpath))
                    {
                        this.frame = new Frame();
                        frame.Source = new Uri("file:///" + htmlpath);
                        this.Content = this.frame;
                    }
                    else
                    {
                        if (path.ToLower().EndsWith(".html"))
                        {
                            path = path.Substring(0, path.Length - 5) + ".md";
                        }

                        if (System.IO.File.Exists(path))
                        {
                            this.Content = new ICSharpCode.AvalonEdit.TextEditor()
                            {
                                Text = System.IO.File.ReadAllText(path, Encoding.UTF8),
                                Margin = new Thickness(10, 10, 10, 10),
                                FontSize = 36,
                                HorizontalAlignment = HorizontalAlignment.Stretch,
                                VerticalAlignment = VerticalAlignment.Stretch,
                                IsReadOnly = true,
后面还有 94 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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