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 Newtonsoft.Json; | |
public static async Task<Version> GetLatestVersion() | |
{ | |
const string latestReleaseRequestUrl = | |
@"https://api.github.com/repos/{user}/{repo}/releases/latest"; | |
try | |
{ | |
string versionStr; |
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
[CmdletBinding(SupportsShouldProcess=$True)] | |
Param( | |
[int]$CutoffDays = 150 | |
) | |
$cutoffDate = (Get-Date).AddDays(-$CutoffDays) | |
# get path to cached NuGet packages | |
$nugetCachePath = .\Get-Nuget-Cache-Path.ps1 |
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 async Task DoSomethingAsync() | |
{ | |
await SomethingElseAsync(); | |
} | |
public async Task<Foo> DoAnotherAsync() | |
{ | |
return await ReturnAFooAsync(); | |
} |
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
3D1W9MPQGSM8P,29C9ZTBRYZTRN,BT1GTNLE3DJW,1EAB07GESHF2W,2PF1IAYUTBODP,204W6ITX1MQF4 |
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
var result = List.Select((x, i) => new { Key = i, Value = x }).ToDictionary(x => x.Key, x => x.Value); |
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
<controls:MasterDetailsView> | |
<controls:MasterDetailsView.ItemContainerStyle> | |
<Style TargetType="ListViewItem"> | |
<Setter Property="HorizontalContentAlignment" Value="Stretch" /> | |
</Style> | |
</controls:MasterDetailsView.ItemContainerStyle> | |
</controls:MasterDetailsView> |
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
<TextBox AcceptsReturn="True" TextWrapping="Wrap" | |
ScrollViewer.VerticalScrollBarVisibility="Auto"/> |
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
private static bool HasAdministratorPrivileges() | |
{ | |
WindowsIdentity id = WindowsIdentity.GetCurrent(); | |
WindowsPrincipal principal = new WindowsPrincipal(id); | |
return principal.IsInRole(WindowsBuiltInRole.Administrator); | |
} |
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
<ComboBox DisplayMemberPath="Content" | |
SelectedIndex="{x:Bind Status, Mode=TwoWay}"> | |
<ComboBoxItem x:Uid="ProjectStatus_Completed" /> | |
<ComboBoxItem x:Uid="ProjectStatus_Active" /> | |
<ComboBoxItem x:Uid="ProjectStatus_Archived" /> | |
</ComboBox> |