Daddoon.Blazor.Extensions 0.1.0

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package Daddoon.Blazor.Extensions --version 0.1.0
NuGet\Install-Package Daddoon.Blazor.Extensions -Version 0.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Daddoon.Blazor.Extensions" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Daddoon.Blazor.Extensions --version 0.1.0
#r "nuget: Daddoon.Blazor.Extensions, 0.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Daddoon.Blazor.Extensions as a Cake Addin
#addin nuget:?package=Daddoon.Blazor.Extensions&version=0.1.0

// Install Daddoon.Blazor.Extensions as a Cake Tool
#tool nuget:?package=Daddoon.Blazor.Extensions&version=0.1.0

Daddoon.Blazor

Extensions for the Blazor project

Installation

Add this NuGet package to your Blazor project !

In your Program.cs file, when instanciating your BrowserRenderer class, you should add the DaddoonBlazorExtensionScripts component to your DOM.

public static void Main(string[] args)
{
    var serviceProvider = new BrowserServiceProvider(configure =>
    {
        /* Instanciate your services */
    });

    br = new BrowserRenderer(serviceProvider);
    br.AddComponent<DaddoonBlazorExtensionScripts>("daddoon");
    br.AddComponent<App>("app");
}

Assuming you have a "daddoon" tag in the body of your index.html file. You can replace by anything else.

HOW TO

Mainly adding some currently missing interop to the browser, some helpers and else !

Platform: Rendering Engine

Browser.Platform.RenderingEngine

Returning values like:

Unknown = 0,
WebKit = 1,
Blink = 2,
Gecko = 3,
MSIE = 4,
MSEdge = 5

Platform: Browser Family

Not very exhaustive at the moment, you can call it like:

Browser.Platform.BrowserFamily

Returning values like:

Other = 0,
InternetExplorer = 1,
InternetExplorer11 = 2,
Edge = 3

Platform: UserAgent, Name, Version

Browser.Platform.UserAgent;
Browser.Platform.Name;
Browser.Platform.Version;

SetTimeout

Browser.SetTimeout(delegate () { /* do something */ }, 1000);
Browser.SetTimeout(async delegate () { /* do something else */ }, 1000);

Some overloads are available but are mainly unecessary

Cookies

Based on js.cookie.js, with the corresponding overloads, you can stock string or object (as serialized data)

Set:

Browser.Cookies.Set("myCookie", "myValue");
Browser.Cookies.Set<T>("myCookie", myObject); //Showing the generic type here is just for readability

Get:

Browser.Cookies.Get("myCookie");

Remove:

Browser.Cookies.Remove("myCookie");

Local Storage

Set:

Browser.LocalStorage.Set("myStorage", "myValue");
Browser.LocalStorage.Set<T>("myStorage", myValue);

Get:

Browser.LocalStorage.Get("myStorage");
Browser.LocalStorage.Get<T>("myStorage");

Remove:

Browser.LocalStorage.Remove("myStorage");

Clear:

Browser.LocalStorage.Clear();

Session Storage

Likewise Local Storage:

Set:

Browser.SessionStorage.Set("myStorage", "myValue");
Browser.SessionStorage.Set<T>("myStorage", myValue);

Get:

Browser.SessionStorage.Get("myStorage");
Browser.SessionStorage.Get<T>("myStorage");

Remove:

Browser.SessionStorage.Remove("myStorage");

Clear:

Browser.SessionStorage.Clear();

Location

Clear:

Browser.Location.Reload();

NOTE

There is more in this package, with IHttpClient and IHttpClientSafe implementation, but i will write for this later.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated

First release