ApacheTech.Common.Extensions.Harmony 2.0.1

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

// Install ApacheTech.Common.Extensions.Harmony as a Cake Tool
#tool nuget:?package=ApacheTech.Common.Extensions.Harmony&version=2.0.1                

Harmony Reflection Extensions

This package of extension methods gives an elegant way to use reflection on all kinds of objects within C#. Below, is a list of methods that are added at an object level, allowing simple and easy access to internal and private members.

All that is required is that Lib.Harmony should be included within your project. This package does not supply Harmony. Once installed, add the following using statement to your class file.

using ApacheTech.Common.Extensions.Harmony;

Fields

Method Description
GetField<T> Gets a field within the calling instanced object. This can be an internal or private field within another assembly.
GetFields<T> Gets an array of fields within the calling instanced object, of a specified Type. These can be an internal or private fields within another assembly.
SetField Sets a field within the calling instanced object. This can be an internal or private field within another assembly.

Properties

Method Description
GetProperty<T> Gets a property within the calling instanced object. This can be an internal or private property within another assembly.
SetProperty Sets a property within the calling instanced object. This can be an internal or private property within another assembly.

Methods

Method Description
CallMethod (2 methods) Calls a method within an instance of an object, via reflection. This can be an internal or private method within another assembly.
CallMethod<T> Calls a method within an instance of an object, via reflection. This can be an internal or private method within another assembly.
GetMethod Gets the <see cref="MethodInfo"/> for a method within an instance of a class, via reflection. This can be an internal or private method within another assembly.

Types

Method Description
GetClassType Gets the type of the class within an assembly, via reflection.
CreateInstance Creates the instance of a specified Type, using Harmony AccessTools. Be aware that this will ignore all Service Providers, and attempt to directly instantiate a class.

Objects

Method Description
DeepClone<T> Makes a deep copy of any object.
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 (2)

Showing the top 2 NuGet packages that depend on ApacheTech.Common.Extensions.Harmony:

Package Downloads
ApacheTech.VintageMods.FluentChatCommands

Provides a framework for creating client-side, and server-side chat commands, using a Fluent Builder pattern.

VintageStory.Gantry

Gantry MDK is a Mod Developent Kit, used to create third-party plugins for the game Vintage Story, by Anego Studios.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.1 2,135 1/6/2023
2.0.0 357 11/15/2022
1.2.0 7,647 7/23/2022
1.1.0 334 12/14/2021

ApacheTech.Common.Extensions.Harmony v2.0.1

- Added: Debug configuration now uses project references, to aid debugging.