This file contains hidden or 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
private void Button1_Clicked(object sender, EventArgs e) | |
{ | |
var win = new Window | |
{ | |
Page = new NewPage1(), | |
Width = 1024, | |
Height = 300 // 亦可在此設定初始座標 X 和 Y | |
}; | |
Application.Current.OpenWindow(win); |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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"); }); |