10 2022 档案
摘要:使用面向对象语言时候,注意以接口以类的方式来处理问题。
阅读全文
摘要:class TaskDelayTest { Stopwatch sw = new Stopwatch(); public void DoRun() { Console.WriteLine($"Caller:Before call."); ShowDelayAsync(); //ShowDelay()
阅读全文
摘要:interface IMyifc<T> { T ReturnValue(T v); } class MyClass : IMyifc<int>, IMyifc<string> { public int ReturnValue(int v) { return v; } public string Re
阅读全文
摘要:class IA_TEST { interface ITest { void Test(); } abstract class IATest : ITest { public abstract void Test(); } class MyTest : IATest { public overrid
阅读全文
摘要:C# Async 方式 简单的流程测试: 去上班 吃早餐 上班中... 摸鱼 下班 using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Ne
阅读全文
摘要:曾经凌工说的: 参数读取和保存 硬件实例化 运控流程(包含图像处理数据) 难点: 工艺问题 运动轨迹规划?可编程路线?
阅读全文
摘要:CancellationTokenSource 和 CancellationToken。 包含命名空间:using System.Threading.Tasks;。 class CancellationPractice { static void Main() { CancellationToken
阅读全文
摘要:嵌套的命名空间,低级的可以直接访问高级层次的命名空间,而相反不行。 // 低级层次的也是高级层次的一部分。 平级的不能直接访问,但 using 时可以省略共同高级部分。 嵌套命名空间:没有就创建,有就合并。 高级层次的命名空间自然是不能和低层级或同级有相同的签名声明。如,下面在 A 命名空间中定义
阅读全文
摘要:这样:ref int b = ref a; int a = 100; ref int b = ref a; b = 111; Console.WriteLine($"a = {a}, b = {b}"); Console.WriteLine("a = {0}, b = {1}", a, b); 输出
阅读全文
摘要:可以用结构体包裹下,做下标识。 #include <iostream> #include <string> #include<cassert> using namespace std; struct VoidType { string Type; void* pVoid; VoidType(stri
阅读全文
摘要:C++ #include <iostream> #include <map> /***********************/ // 基类 鞋子 class Shoes { public: virtual void Show() = 0; virtual ~Shoes() {} }; // 耐克鞋
阅读全文
摘要:C++ #include <iostream> #include <map> /***********************/ // 基类 鞋子 class Shoes { public: virtual void Show() = 0; virtual ~Shoes() {} }; // 耐克鞋
阅读全文