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
@* Creates a Gravatar image using Bootstrap styling from email address *@ | |
<img class="rounded-circle" src="@url" /> | |
@code | |
{ | |
[Parameter] public string Email { get; set; } | |
[Parameter] public int Size { get; set; } = 24; | |
protected override void OnParametersSet() | |
{ | |
// create hash |
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
@* need to change project SDK *@ | |
<Project Sdk="Microsoft.NET.Sdk.Razor"> | |
@* add bUnit package *@ | |
<PackageReference Include="bunit" Verion="x.x.x" /> | |
@* Use a `@code` block in a `.razor` test file, e.g. *@ | |
@* if the test component inherits from `TestContext ` you don't need the `new TestContext();` bit | |
@code { |
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
@if(IsValid) | |
{ | |
<a href=@dataUrl download=@Filename >@ChildContent</a> | |
} | |
@code | |
{ | |
[Parameter] public DateTime? Start { get; set; } | |
[Parameter] public DateTime? End { get; set; } |
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 Ical.Net | |
@using Ical.Net.Serialization | |
@* requires Ical.Net library from NUGET *@ | |
@if(Calendar != null) | |
{ | |
<a href=@dataUrl download=@Filename >@ChildContent</a> | |
} | |
@code | |
{ | |
[Parameter] public Calendar Calendar { get; set; } |
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
@if (Value != null) | |
{ | |
@ChildContent | |
} | |
@code | |
{ | |
/* sample usage | |
* <NotNull Value="yourValue"> | |
* // use value | |
* </NotNull> |
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
@page "/counter" | |
@inject CounterService counterService | |
@implements IDisposable | |
<h1>Counter</h1> | |
<p>Current count: @counterService.Count</p> | |
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button> |
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 NuGet.Common; | |
using NuGet.Configuration; | |
using NuGet.Credentials; | |
using NuGet.PackageManagement; | |
using NuGet.Packaging; | |
using NuGet.Packaging.Core; | |
using NuGet.Packaging.Signing; | |
using NuGet.ProjectManagement; | |
using NuGet.Protocol; | |
using NuGet.Protocol.Core.Types; |
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
/* shows a loading gif/text if a value is null */ | |
@if (Value == null) | |
{ | |
<div><img src="/img/SmallLoader.gif" alt="loading" /> Loading</div> | |
} | |
else | |
{ | |
@ChildContent | |
} | |
@code { |
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 Microsoft.VisualStudio.TestTools.UnitTesting; | |
using System; | |
using System.Collections.Generic; | |
namespace Tests | |
{ | |
[TestClass] | |
public class Test | |
{ | |
[TestMethod] |
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
@* creates a container component that greys-out the content when the `IsGreyedOut` parameter is set to true *@ | |
<div style="@(IsGreyedOut ? greyout : null)"> | |
<div style="@cover"></div> | |
@ChildContent | |
</div> | |
@code { | |
const string greyout = "position: absolute; width: 100%; min-height: 100%;"; | |
const string cover = "background: rgba(150, 150, 150, 0.5); position: absolute; width: 100%; height: 100%; z-index: 1;"; | |
NewerOlder