VaraniumSharp 6.2.0

dotnet add package VaraniumSharp --version 6.2.0                
NuGet\Install-Package VaraniumSharp -Version 6.2.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="VaraniumSharp" Version="6.2.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add VaraniumSharp --version 6.2.0                
#r "nuget: VaraniumSharp, 6.2.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 VaraniumSharp as a Cake Addin
#addin nuget:?package=VaraniumSharp&version=6.2.0

// Install VaraniumSharp as a Cake Tool
#tool nuget:?package=VaraniumSharp&version=6.2.0                

VaraniumSharp

Build status NuGet Coverage Status CodeFactor

VaraniumSharp is very simple helper library with the goal of having reusable, reliable components. It is written to not rely on any other libraries and as such can be easily dropped into any project to get access to the functionality it provides.

Functionality

  • Provides attributes to assist in easy, attribute based dependency injection. Injection is handled by additional packages to make it provider neutral
  • Provide different kinds of caches including a reference counting cache
  • Provides an interface for PackageManager to leverage
  • Provides a collection that prioritize it's contents based on some value
  • Provides Concurrency helpers including a disposable SemaphoreSlim for simple use
  • Provides a base class for creating reconfigurable setting classes allowing easy rollback of setting values if cancelled
  • Provides some extension methods to wrap basic functionality
  • Provides various wrappers for static Microsoft classes to allow them to be used in a dependency injection system
  • Provides a static logger based on Microsoft.Extensions.Logging. The logger exists primarily to abstract the user's logging framework from VaraniumSharp libraries so they can log to the user's preffered logger.

Requirements

To leverage the dependency injection attributes provided by VaraniumSharp a package that wraps the DI framework is required. Currently two such package are supported as part of the VaraniumSharp framework, one for DryIoC and one for the Microsoft ServiceCollection. It is also easy to create a custom wrapper for your preffered provider by simply implementing the VaraniumSharp.DependencyInjection.AutomaticContainerRegistration class either directly in your project or as an additional library. To see how to implement this interface please look at one of the existing packages.

Basic setup

Most of VaraniumSharp's functionality can be leveraged directly, however to make use of the DI attributes in your project there are a few steps.

Add an attribute to the class you want to add to the DI container. There are two main attributes with various properties, for more details see the documentation

// The attribute tells the DI system to create a registration fo the TabWindowContext for the interface ITabWindowContext
[AutomaticContainerRegistration(typeof(ITabWindowContext))]
public sealed class TabWindowContext : ITabWindowContext

Next, during application startup load the DLLs that contains injectable classes into the AppDomain, then create the container and request it to be set up. After that you can simply resolve the main part of the application and execute it from the container.

// It is required to pre-load the assemblies that are auto-injected by VaraniumSharp otherwise their injections won't be picked up
AppDomain.CurrentDomain.Load(new AssemblyName("VaraniumSharp.WinUI"));

// Set up your IoC container and request that all classes are registered
var containerSetup = new ContainerSetup();
containerSetup.RetrieveClassesRequiringRegistration(true);
containerSetup.RetrieveConcretionClassesRequiringRegistration(true);

Framework Libraries

Dependency Injection

Front End

Wrappers

Deprecated

Documentation

For a detailed overview of the library see our documentation

Note

With the release of VaraniumSharp 2.0.0 we are moving over to .NetStandard2.0 as this supports all .Net 4.6.1+ framework libraries and grants the ability to make use of DotNet Core2.0+ If an older version is required please file an issue and request support, we're willing to multi-target to older platforms where possible (Note that DotNet Core 1.x cannot be supported due to missing libraries)

Icon

Sprout by parkjisun from the Noun Project

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 is compatible. 
.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 (10)

Showing the top 5 NuGet packages that depend on VaraniumSharp:

Package Downloads
NeuroLinker

NeuroLinker is a scraping library for MyAnimeList.

VaraniumSharp.Initiator

Ring 2 library based on VaraniumSharp. This library makes use of and extends VaraniumSharp to be a base for other (Ring 3) projects.

VaraniumSharp.WinUI

A VarniumSharp library with WinUI helper classes and components.

VaraniumSharp.Discord

VaraniumSharp.Discord is a VaraniumSharp add-on that wraps around Discord.Net for easy bot setup

VaraniumSharp.Shenfield

WPF chassis build on VaraniumSharp.Initiator.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
6.2.0 107 11/17/2024
5.3.0 239 2/12/2024
5.2.0 373 12/12/2023
5.1.0 211 8/11/2023
5.0.2 405 11/29/2022
5.0.1 993 8/16/2022
4.2.1 1,923 12/17/2021
4.2.0 725 11/1/2021
4.1.0 372 9/29/2021
4.0.1 414 9/27/2021
4.0.0 428 9/27/2021
3.13.2 438 9/21/2021
3.12.0 490 9/10/2021
3.10.0 768 8/21/2021
3.9.3 678 8/21/2021
3.8.0 420 7/25/2021
3.7.0 1,280 6/23/2020
3.6.1 1,217 2/26/2020
3.6.0 541 2/26/2020
3.5.0 2,731 11/22/2019
3.4.6 637 10/10/2019
3.4.5 628 10/10/2019
3.4.4 609 9/21/2019
3.4.0 596 9/21/2019
3.3.0 845 12/3/2018
3.1.7 1,811 9/21/2018
3.1.5 2,820 7/31/2018
3.1.4 910 7/20/2018
3.1.2 3,132 7/14/2018
3.1.1 1,040 6/4/2018
3.1.0 1,019 6/4/2018
3.0.1 1,484 2/16/2018
1.20.0 1,690 9/27/2017
1.18.0 973 9/21/2017
1.17.1 937 9/19/2017
1.17.0 955 9/19/2017
1.16.0 997 9/2/2017
1.15.1 1,023 7/17/2017
1.15.0 976 7/13/2017
1.14.0 5,501 3/21/2017
1.13.0 2,536 3/11/2017
1.9.0 1,041 1/26/2017
1.8.1 1,101 12/18/2016
1.8.0 1,092 12/8/2016
1.7.0 3,171 11/19/2016
1.6.2 1,249 11/16/2016
1.2.1 1,170 11/5/2016
1.2.0 1,795 10/3/2016
1.1.0 1,005 9/29/2016
1.0.0 1,003 9/29/2016