随笔分类 - 编程 / C#
摘要:1.绑定新建类文件(使用BindableBase方式) public class sample:BindableBase { private double blendPreVolume; /// <summary> /// 混匀前吸体积 /// </summary> public double Bl
阅读全文
System.Windows.Markup.XamlParseException:““设置属性“Prism.Mvvm.ViewModelLocator.AutoWireViewModel”时引发了异常
摘要:System.Windows.Markup.XamlParseException:““设置属性“Prism.Mvvm.ViewModelLocator.AutoWireViewModel”时引发了异常。”,行号为“8”,行位置为“14”。” MissingMethodException: 没有为该对
阅读全文
摘要:1.ConcurrentDictionary ConcurrentDictionary 并发字典,保证多线程情况下的安全性 Dictionary 非线程安全集合 using System.Collections.Concurrent; class Program { static void Main
阅读全文
摘要:1.引用 using System; using System.Collections.Generic; using System.Linq; 2.打印一副扑克牌 static void Main(string[] args) { var pokers = from s in Suits() fro
阅读全文
摘要:IEnumerator接口:支持对非泛型集合的简单迭代,使得foreach可以遍寻集合 using System; using System.Collections; public class Family { private string husban = null; public string
阅读全文
摘要:Queue类将队列实现为循环数组。 queue对象实现了在一端插入并从另一端删除(即先进先出功能)
如存在多个CCD检测情况下,每个ccd检测结果信息存储到Queue中,最后一个ccd检测完成,然后发送数据到robot(plc)等,通过Queue的Dequeue()方法来达到先进先出功能
阅读全文
摘要:1.列表创建 var names = new List<string> { "博客园", "cc", "efun" ,"zp"}; foreach (var name in names) { Console.WriteLine($"Hello {name.ToUpper()}!"); } Hello
阅读全文
摘要:1.浮点数 用于表示数量级可能非常大或者非常小的非整数; float:单精度浮点数表示用于存储值的二进制位数为32位 double:双精度浮点数相对于单精度浮点数而言,是其两倍;即表示用于存储值的二进制位数为64位 2.常见算数运算 int c=7/4; //若值不为整数,商取整 Console.W
阅读全文
摘要:string str = " Hello dear "; Console.WriteLine($"{str} zp"); //等同于Console.WriteLine(str+" zp"); Console.WriteLine(str+" zp"); Console.WriteLine(str.Tr
阅读全文