from TheLaughingMan on gitter June 17, 2021 10:24 AM
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 static class CssHelper | |
{ | |
public static string GenerateScope(string targetName, string relativePath) | |
{ | |
using var hash = SHA256.Create(); | |
var bytes = Encoding.UTF8.GetBytes(relativePath.ToLowerInvariant().Replace("\\", "//") + targetName); | |
var hashBytes = hash.ComputeHash(bytes); | |
var builder = new StringBuilder(); | |
builder.Append("b-"); |
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
Add-Type -AssemblyName PresentationFramework, System.Drawing, System.Windows.Forms | |
$icon = New-Object System.Windows.Forms.NotifyIcon | |
$icon.icon = New-Object System.Drawing.Icon("someicon.ico") | |
$icon.Visible = $true |
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
@foreach (var item in new string[] { "AspNetCore","AspNet","SomeJsThingWhatever"}) | |
{ | |
<div> | |
<input type="radio" name="technology" id="@item" value="@item" @onchange="RadioSelection" checked=@(RadioValue.Equals(item,StringComparison.OrdinalIgnoreCase)) /> | |
<label for="@item">@item</label> | |
</div> | |
} | |
<div> | |
<label>Selected Value is @RadioValue</label> | |
</div> |
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
@* Code below handles deep links to anchors through the entire application *@ | |
@inject NavigationManager NavMan | |
@inject IJSRuntime JS | |
@code | |
{ | |
protected override async Task OnAfterRenderAsync(bool firstRender) | |
{ | |
if (firstRender && NavMan.Uri.Contains('#')) | |
{ |
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
.NET SDK: | |
Version: 7.0.101 | |
Commit: bb24aafa11 | |
Runtime Environment: | |
OS Name: Windows | |
OS Version: 10.0.25267 | |
OS Platform: Windows | |
RID: win10-x64 | |
Base Path: C:\Program Files\dotnet\sdk\7.0.101\ |
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
<script autostart="false" src="_framework/blazor.server.js"></script> | |
<script> | |
async function connectionDown(options) { | |
console.log("Connection Down - you could do some UI here..."); | |
for (let i = 0; i < options.maxRetries; i++) { | |
console.log("Waiting for reconnect attempt #"+(i+1)+" ..."); | |
await this.delay(options.retryIntervalMilliseconds); | |
if (this.isDisposed) { | |
break; | |
} |
This goes into your msbuild config (normally csproj
) and runs before the Publish
Task, before files are copied to the final destination.
<!-- 2022 @SQL-MisterMagoo containing some code from (c) .NET Foundation. All rights reserved. -->
<PropertyGroup Condition="'$(_BlazorWebAssemblySdkToolAssembly)'==''">
<_SDKRoot>$(NetCoreRoot)sdk\$(NETCoreSDKVersion)\Sdks</_SDKRoot>
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
{ | |
"runtimeOptions": { | |
"tfm": "net7.0", | |
"framework": { | |
"name": "Microsoft.NETCore.App", | |
"version": "7.0.8" | |
} | |
} | |
} |
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.Text.Json; | |
using System.Text.Json.Serialization; | |
/* Setup */ | |
Thing[] someThings = { new("1"), new("2") }; | |
var myThings = new Things(someThings); | |
/* Staying in dotnet - this all works as expected */ | |
var asInterfaces = myThings as IThings; |
OlderNewer