This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public partial class App : Application | |
{ | |
public App() | |
{ | |
InitializeComponent(); | |
MainPage = new AppShell(); | |
} | |
protected override Window CreateWindow(IActivationState activationState) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Threading.Tasks; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
var rng = new Random(); | |
Parallel.For(0, 16, _ => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM 把需要備份的檔案名稱全丟到 filelist.txt 裡面 | |
del filelist.txt | |
for %m in (.txt, .pdf, .xls, .xlsx, .xlsm, .doc, .docx, .docm) | |
do (forfiles /S /M *%m /D +2021/01/01 /C "cmd /c echo @path" >> filelist.txt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Runtime.CompilerServices; | |
...... | |
[InterpolatedStringHandler] | |
public ref struct MyLoggerInterpolatedStringHandler | |
{ | |
private DefaultInterpolatedStringHandler _handler; | |
public MyLoggerInterpolatedStringHandler( | |
int literalLength, int formattedCount, | |
MyLogger logger, out bool handlerIsValid) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public string Today() | |
{ | |
var d = DateTime.Now; | |
return $"今天是 {d.Year} 年 {d.Month} 月 {d.Day} 日"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Student : IEquatable<Student> | |
{ | |
public int Id { get; init; } | |
public string Name { get; init; } | |
public Student(int Id, string Name) | |
{ | |
this.Id = Id; | |
this.Name = Name; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IAsyncEnumerator<int> e = GetNumbers().GetAsyncEnumerator(); | |
while (await e.MoveNextAsync()) | |
{ | |
Console.WriteLine($"取得 {e.Current}"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
skip_non_tags: true | |
deploy: | |
- provider: NuGet | |
api_key: | |
secure: F+FEV17LBxIXlSSCC5LD2P9rhkpjGzzD34LaalIJRCSW+8mM9YeI08i9WU/0ZojP | |
on: | |
APPVEYOR_REPO_TAG: true | |
artifact: /.*(\.|\.s)nupkg/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DefaultTestScript : DefaultBuildScript | |
{ | |
protected override void ConfigureTargets(ITaskContext context) | |
{ | |
var doExample = context.CreateTarget("DoExample") | |
.Do(t => { throw new Exception("error on purpose."); }); | |
var doExample2 = context.CreateTarget("DoExample2") | |
.Do(t => { Console.WriteLine("from doExample2"); }); | |
var test = context.CreateTarget("test") | |
.Do(t => { Console.WriteLine("from test"); }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Note: this line is deleted: using Microsoft.AspNetCore.Hosting; | |
using Microsoft.AspNetCore.Mvc; | |
#if NETCOREAPP3_1 | |
using Microsoft.Extensions.Hosting; | |
#else | |
using IHostEnvironment = Microsoft.AspNetCore.Hosting.IHostingEnvironment; | |
#endif | |
namespace MyApp.WebApi.Controllers | |
{ |