Compare commits

...

10 Commits

Author SHA1 Message Date
zengwenjie
385e932401 优化「Dodo」脚本的调试用例 2025-10-17 10:07:37 +08:00
zengwenjie
55573f6040 完善「Val_Double」方法的运算逻辑 2025-10-16 14:52:19 +08:00
zengwenjie
2efc34846c 已经完成While、Continue、Break指令的调试 2025-10-16 14:44:30 +08:00
zengwenjie
fb3db24b90 已经完成条件指令的调试 2025-10-16 13:21:41 +08:00
zengwenjie
413985e08f 当设置变量值时如果找不到变量则优先在临时变量上下文中声明变量 2025-10-16 12:24:25 +08:00
zengwenjie
7d18b88172 已经完成「Dodo」脚本对自定义方法参数的支持 2025-10-16 12:12:11 +08:00
zengwenjie
fdcef37be3 完成「Dodo」脚本的定义与服务关键逻辑的测试 2025-10-16 10:47:09 +08:00
zengwenjie
d7ff6b3109 为窗口抽屉添加代码注释 2025-10-09 09:48:08 +08:00
zengwenjie
cce2224926 Merge branch 'main' of http://123.56.72.222:3000/IBridge/DeedyDesigner 2025-10-09 09:15:30 +08:00
zengwenjie
23fc6c17e6 清理无用方法 2025-10-09 09:15:11 +08:00
3 changed files with 1206 additions and 3 deletions

View File

@@ -1,6 +1,8 @@
using System.Configuration;
using System.Data;
using System.Diagnostics;
using System.Windows;
using Deedy.Testing;
namespace Deedy
{
@@ -9,6 +11,45 @@ namespace Deedy
/// </summary>
public partial class App : Application
{
public App()
{
string script =
@"
VarP var1 111
VarP var2 222
Func Add var1x var2x
LetP AddResult -1
math AddResult @var1x 777 + @var2 - @var2x -
retu AddResult
EndF
//调用自定义方法
Call Add @var1 99
PopV result
ifth true 4 3 <
letp result 248
else
letp result 80
endi
letp var1 1
letp var2 1
whil false @var1 10 <
math var1 @var1 ++
ifth false @var2 4 !=
math var2 @var2 ++
cont
var var3 xxx
else
brea
endi
endw
";
Todo todo = new();
todo.Init("varp var1 111");
Stopwatch sw = Stopwatch.StartNew();
for (int i = 0; i < 1000000; i++)
todo.Redo();
sw.Stop();
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -19,7 +19,9 @@ namespace Deedy
public class DrawerViewer : Adorner
{
private readonly VisualCollection _visualChildren;
/// <summary>
/// 抽屉外边框
/// </summary>
private readonly Border _border;
public Brush Background { get => (Brush)GetValue(BackgroundProperty); set => SetValue(BackgroundProperty, value); }
public static readonly DependencyProperty BackgroundProperty = Border.BackgroundProperty.AddOwner(typeof(DrawerViewer));
@@ -29,7 +31,9 @@ namespace Deedy
public static readonly DependencyProperty BorderThicknessProperty = Border.BorderThicknessProperty.AddOwner(typeof(DrawerViewer));
public CornerRadius CornerRadius { get => (CornerRadius)GetValue(CornerRadiusProperty); set => SetValue(CornerRadiusProperty, value); }
public static readonly DependencyProperty CornerRadiusProperty = Border.CornerRadiusProperty.AddOwner(typeof(DrawerViewer));
/// <summary>
/// 抽屉内容容器
/// </summary>
private readonly ContentPresenter _contentPresenter;
public object Content { get => GetValue(ContentProperty); set => SetValue(ContentProperty, value); }
public static readonly DependencyProperty ContentProperty = ContentPresenter.ContentProperty.AddOwner(typeof(DrawerViewer));
@@ -100,8 +104,14 @@ namespace Deedy
_border.Child = _contentPresenter;
}
/// <summary>
/// 要注册的事件
/// </summary>
[AllowNull]
private readonly RoutedEvent[] _routedEvents;
/// <summary>
/// 事件响应方法
/// </summary>
private readonly RoutedEventHandler? _routedEventHandler;
/// <summary>
/// 在特定「UIElement」上创建「WindowDrawer」蒙层同时绑定特定路由事件
@@ -149,6 +159,10 @@ namespace Deedy
_border.Arrange(new Rect(0, 0, finalSize.Width, finalSize.Height));
return finalSize;
}
/// <summary>
/// 显示抽屉并播放入场动画
/// </summary>
/// <param name="seconds">动画持续时间</param>
public void ShowWithAnimation(double seconds = 1)
{
var doubleAnimation = new DoubleAnimation
@@ -169,7 +183,10 @@ namespace Deedy
};
_border.BeginAnimation(MarginProperty, marginAnimation);
}
/// <summary>
/// 关闭抽屉并播放出场动画;同时清理事件注册
/// </summary>
/// <param name="seconds">动画持续时间</param>
public void HideWithAnimation(double seconds = 1)
{
var doubleAnimation = new DoubleAnimation