01 2025 档案

摘要:TODO 阅读全文
posted @ 2025-01-19 09:07 凌枫玖 阅读(5) 评论(0) 推荐(0)
摘要:在做条件判断时,经常会有判断一个对象是否为空,再去拿里面属性的结构。 xx != null && xx.Prop.Something 如果你的判断条件,或者接下来要做的操作足够简单。记得不要忘记 ?? 运算符的存在。 我们可以直接合并上述情况的判断条件 xx?.Prop.Something ?? d 阅读全文
posted @ 2025-01-16 11:13 凌枫玖 阅读(7) 评论(0) 推荐(0)
摘要:_ = Task.Run(async() => { try { throw new NotImplementException(); await Task.Delay(1); } catch(Exception ex) { Debug.WriteLine(ex); } } fire and forg 阅读全文
posted @ 2025-01-14 18:28 凌枫玖 阅读(71) 评论(0) 推荐(0)
摘要:.ObserveOn(SynchronizationContext.Current) SynchronizationContext.Current 是当前上下文的意思。比如我处于 ui 线程,此时我订阅了一个 Process 的 Exited 事件。 // On ui thread proc.Eve 阅读全文
posted @ 2025-01-11 04:32 凌枫玖 阅读(9) 评论(0) 推荐(0)
摘要:如果你在开发一个 GUI 程序。 停止在项目中使用 ConfigureAwait(false) 来尝试提高效率。 也不需要 ConfigureAwait.Fody。 .ConfigureAwait(false) 或者默认值为 false,会让你的 viewmodel 和业务逻辑越来越混乱 阅读全文
posted @ 2025-01-10 10:50 凌枫玖 阅读(12) 评论(0) 推荐(0)
摘要:class DummyModel { public string DummyString { get; } = string.Empty; public string[] DummyArray { get; } = []; public Process? DumbProcess { get; } } 阅读全文
posted @ 2025-01-09 20:39 凌枫玖 阅读(6) 评论(0) 推荐(0)
摘要:1 public void DummyFunction() 2 { 3 if (itsTrue) 4 { 5 DoSomething(); 6 return; 7 } 8 9 DoAnotherThing(); 10 } 阅读全文
posted @ 2025-01-09 20:28 凌枫玖 阅读(6) 评论(0) 推荐(0)