摘要: 在WPF中有时候不想将命令写在List中,但是却要在前端绑定的List中写入命令 暂时知道两种解决方法 1、 Command="{Binding DataContext.NavicateCommand, RelativeSource={RelativeSource AncestorType=List 阅读全文
posted @ 2024-02-26 17:30 孤沉 阅读(31) 评论(0) 推荐(0) 编辑
摘要: 在C#中父类可以直接转子类,叫做协变 子类转父类需要添加强制转换,叫做逆变 public class Person { } public class Student:Person { } var p = new Person(); p = new Student(); //协变是父类转子类,可以直接 阅读全文
posted @ 2024-02-23 09:49 孤沉 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 1、自定义配置 <?xml version="1.0" encoding="utf-8" ?> <configuration> <log4net> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAp 阅读全文
posted @ 2024-02-21 20:37 孤沉 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 1、a56爆大奖在线娱乐们在做工控项目的时候通常设置配方的上下限 这个时候要求OK数在上下限范围之内,否则NG 首先a56爆大奖在线娱乐们绑定一个简单的List用来展示数据,a56爆大奖在线娱乐这里用学生Age来展示 <ListView ItemsSource="{Binding DataList}" Margin="20"> <ListView.Vi 阅读全文
posted @ 2024-02-02 22:28 孤沉 阅读(63) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// PLC处理器 /// </summary> public interface IPlcHandler { void Request(IPlcContext context); } /// <summary> /// PLC的数据上下文 /// </summary> 阅读全文
posted @ 2024-01-23 20:32 孤沉 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 上位机使用Hsl框架连接PLC 顺便讲下策略模式 话不多说,直接上代码 public interface IPlcHost { bool ConnectionPlc(string path); } public class FastPlcHost : IPlcHost { private Sieme 阅读全文
posted @ 2024-01-20 13:28 孤沉 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 1、现在a56爆大奖在线娱乐介绍一个类库NewLife,非常流批 先介绍它读取json吧 WPF前台随便绑定一下 <TextBlock Text="{Binding ArticleText}" VerticalAlignment="Center" HorizontalAlignment="Center" FontSi 阅读全文
posted @ 2024-01-17 00:07 孤沉 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 1、最简单的使用 public class DatabaseService { private static readonly Lazy<SqlSugarClient> _db = new Lazy<SqlSugarClient>(() => { var db = new SqlSugarClien 阅读全文
posted @ 2024-01-15 02:49 孤沉 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 1、a56爆大奖在线娱乐这里使用的是HslCommunication 假如传递的是word类型,PLC以16进制封装数组,它有预留,a56爆大奖在线娱乐扩充 PLC博图上是 word[5] 上位机接收 ushort[] Data1=new ushort[5] Data1[0] = byteTransform.TransUInt16(r 阅读全文
posted @ 2023-12-22 22:45 孤沉 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 1、MySql服务器共享问题 对于在车间工作者,如果远程Mysql,a56爆大奖在线娱乐们这里假定网线连接 GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION; 允许对应的主机 阅读全文
posted @ 2023-12-17 09:21 孤沉 阅读(1) 评论(0) 推荐(0) 编辑