03 2021 档案
摘要:1 xmlns:i="http://schemas.microsoft.com/xaml/behaviors" 2 3 4 <ListBox x:Name="peopleLbx" ItemsSource="{Binding PersonList}"> 5 <i:Interaction.Trigger
阅读全文
摘要:1 static void CallerDemo() 2 { 3 SystemRuntimeCompilerServicesCallerDemo("Test System.Runtime.CompilerServices.Caller"); 4 } 5 6 static void SystemRun
阅读全文
摘要:public MessageView() { InitializeComponent(); this.KeyDown += MessageView_KeyDown; } private void MessageView_KeyDown(object sender, KeyEventArgs e) {
阅读全文
摘要:1.Install-package Prism -v 4 2. 1 using Microsoft.Practices.Prism; 2 using Microsoft.Practices.Prism.Commands; 3 using Microsoft.Practices.Prism.Event
阅读全文
摘要:1 static void AnnoymousReflection() 2 { 3 var obj = new 4 { 5 First = 3456.345, 6 Second = 43545657, 7 Third = 'A', 8 Forth = "Test", 9 Fifth = true,
阅读全文
摘要:1 static void QuickSortDemo() 2 { 3 int[] arr = new int[] { 2, 5, -4, 11, 0, 18, 22, 67, 51, 6 }; 4 5 Console.WriteLine("Original array : "); 6 foreac
阅读全文
摘要:1.install-package system.text.json; 2. using System.Text.Json; using System.IO; 3. 1 static void SystemTextJsonDemo() 2 { 3 var obj = new[] 4 { 5 new
阅读全文
摘要:1 class Program 2 { 3 static void Main(string[] args) 4 { 5 EventDemo(); 6 Console.ReadLine(); 7 } 8 9 static void EventDemo() 10 { 11 MathClass mc =
阅读全文
摘要:static void TestCallerMemberName() { CallerDemo("CallFilePath,CallerMemberName,CallerLineNumber"); } static void CallerDemo(string msg,[CallerFilePath
阅读全文
摘要:static void PropertyPatternDemo() { string url = "https://devblogs.microsoft.com/dotnet/do-more-with-patterns-in-c-8-0/"; bool result = ShouldAllow(ne
阅读全文
摘要:1.install-package System.Text.Json 2. static void SystemTextJsonJsonSerializerDemo() { var obj = new { Id = 1, Name = "Fred", Age = 34 }; string jsonV
阅读全文
摘要:The new feature is only available in C# 8 or greater,so add below statement in csproj file <LangVersion>8</LangVersion> <PropertyGroup> <Configuration
阅读全文