分类: c#

98 篇文章

thumbnail
wpf 右下角提示弹窗口
<Window x:Class="WpfDemoApp.PromptPopupBoxCtrls.PopupBoxWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://s…
贝塞尔曲线公式
计算公式 二次曲线 三次曲线 https://www.bilibili.com/video/BV16v4y1Q7PD https://juejin.cn/post/7082701281969569829
.net 断言库
GuardClauses Ardalis.GuardClauses https://www.nuget.org/packages/Ardalis.GuardClauses https://github.com/ardalis/guardclauses Guard.Against.Null   → 若输入为 null,则抛出异常 Guard.Agai…
WPF / Avalonia / CSS Matrix 矩阵
学习心得 名称 值 值 X坐标 1 0 Y坐标 0 1 偏移量 0 0 相当于 (0, 0), X (1, 0), Y (0, 1) 三个点决定了一个矩形 通过计算得到新的 X, Y , 然后再通过平移得到最终的坐标 平移 最简单, 修改平移值即可 名称 值 值 X坐标 1 0 Y坐标 0 1 偏移量 横向平移 纵向平移 缩放 在 x 轴与 y 轴…
.net 程序集扫描类 Scrutor
https://github.com/khellang/Scrutor 可扫描 实现了一个装饰器 扫描 var collection = new ServiceCollection(); collection.Scan(scan => scan // 从 ITransientService 接口所在的程序集开始扫描 .FromAssembly…
AutoFixture 简单介绍
- 在单元测试中自动生成随机的测试数据 Fixture fixture = new(); var items = fixture.Build<ListItem>() .With(it => it.Idx, Random.Shared.Next()) // 配置为所有实例都使用该值 .Without(it => it.Desc…
Redis 一些资料
【GeekHour】一小时Redis教程 https://www.bilibili.com/video/BV1Jj411D7oG 一些应用场景 https://juejin.cn/post/7325132133168971813 StackExchange.Redis 中文文档目录 https://www.cnblogs.com/liang24/t…
Swagger 配置
# 进行参数修改 builder.Services.AddSwaggerGen(opt => {}); 修改标题 opt.SwaggerDoc("v1", new OpenApiInfo { Title = "Test01", Version = "v1", }); 在 header…
设置 task 为 STA 模式
因为要运行窗口代码,必须使用 STA 模式,而有一些代码又需要 async/await 方式 一 推荐,因为可以传入一个异步函数,并可以扩展为带返回值 # 调用 await this.RunWithStaTaskAsync(this.AppRun); private async Task RunWithStaTaskAsync(Func<Ta…