LunarPresentation/Expressions/Brace.cs
(开头部分) 7KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Xml;
using SHomeWorkshop.LunarPresentation.Widegets;
namespace SHomeWorkshop.LunarPresentation.Expressions
{
/// <summary>
/// 括弧。注意与括弧式不同——括弧中没有嵌入的子面板,因而也不会内嵌任何下级公式。
/// </summary>
public class Brace : Expression
{
public Brace(SubPanel rootPanel, SubPanel parentPanel, Editor editor)
: base(rootPanel, parentPanel, editor)
{
bPanel = new BracePanel(this);
if (parentPanel != null && parentPanel.Direction == Orientation.Horizontal)
{
bPanel.MinHeight = 40;
bPanel.MinWidth = 20;
bPanel.Width = 20;
bPanel.Height = double.NaN;
}
else
{
bPanel.MinHeight = 20;
bPanel.MinWidth = 40;
bPanel.Height = 20;
bPanel.Width = double.NaN;
}
bPanel.Foreground = ExForeground;
bPanel.MouseDown += new System.Windows.Input.MouseButtonEventHandler(aPanel_MouseDown);
bPanel.MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(aPanel_MouseLeftButtonUp);
bPanel.HorizontalAlignment = HorizontalAlignment.Stretch;
bPanel.VerticalAlignment = VerticalAlignment.Stretch;
this.mainBorder.Child = bPanel;
this.mainBorder.Background = Brushes.Transparent;
this.HorizontalAlignment = HorizontalAlignment.Stretch;
this.VerticalAlignment = VerticalAlignment.Stretch;
this.chineseName = "括弧";
}
void aPanel_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
// 接收拖动来的公式。
Globals.DropExpression(this);
}
void aPanel_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
if (Editor == null) return;
Editor.SelectedExpression = this;
//准备拖动公式。
Globals.dragSourceExpression = this;
后面还有 164 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。