摘要: 后台: private void TreeViewItem_RequestBringIntoView(object sender, RequestBringIntoViewEventArgs e) { e.Handled = true; } 前台: <TreeView Width="100"> <T 阅读全文
posted @ 2021-09-11 17:01 灰主流 阅读(101) 评论(0) 推荐(0) 编辑
摘要: AutoFac属性注册:反射:builder.RegisterType<AutoFacManager>().PropertiesAutowired(); 预先定义:builder.RegisterType<AutoFacManager>().WithProperty("person", new Wo 阅读全文
posted @ 2021-09-11 16:54 灰主流 阅读(249) 评论(0) 推荐(0) 编辑
摘要: AutoMapper 基本:var config=new MapperConfiguration(cfg=>{ cfg.CreateMap<Foo,FooTo> });var mapper=config.CreateMapper();var result=mapper.Map<FooTo>(foo) 阅读全文
posted @ 2021-09-11 16:52 灰主流 阅读(96) 评论(0) 推荐(0) 编辑
摘要: roslynSyntaxTree 句法树 lexical词汇的 每一个tree包含-1.SyntaxNodes--每一个有parent和child属性,有DescendantNodes方法来获取子节点2.Syntax tokens -最小片段,无子节点,包含keywords, identifiers 阅读全文
posted @ 2021-09-11 14:30 灰主流 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 通常使用log4net,都是用xml配置,然后代码调用ilog来记录日志。但这就有一个限制,日志名必须在xml里设定好,如果想动态创建日志文件名是不行的。 原始方式如下: 配置xml: <?xml version="1.0" encoding="utf-8" ?> <log4net> <append 阅读全文
posted @ 2021-09-11 13:09 灰主流 阅读(1344) 评论(0) 推荐(0) 编辑
摘要: 定义一个按钮样式 <Window x:Class="WpfApp2可切换按钮.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft 阅读全文
posted @ 2021-09-11 12:01 灰主流 阅读(189) 评论(0) 推荐(0) 编辑