DanielWillett.ReflectionTools 2.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package DanielWillett.ReflectionTools --version 2.0.3                
NuGet\Install-Package DanielWillett.ReflectionTools -Version 2.0.3                
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="DanielWillett.ReflectionTools" Version="2.0.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DanielWillett.ReflectionTools --version 2.0.3                
#r "nuget: DanielWillett.ReflectionTools, 2.0.3"                
#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 DanielWillett.ReflectionTools as a Cake Addin
#addin nuget:?package=DanielWillett.ReflectionTools&version=2.0.3

// Install DanielWillett.ReflectionTools as a Cake Tool
#tool nuget:?package=DanielWillett.ReflectionTools&version=2.0.3                

Shared library for generic reflection tools for CLR implementations. Tested on .NET Framework and Mono.

Requires HarmonyLib 2.2.2+.

NuGet Package: DanielWillett.ReflectionTools

Accessor

  • IReflectionToolsLogger + ReflectionToolsLoggerProxy for Microsoft's ILogger support.
  • IsMono property
  • Generating static or instance setters and getters for fields and properties.
  • Generating static or instance callers for private methods.
  • Extensions:
    • IsExtern
    • IsIgnored (using a new IgnoredAttribute)
    • GetPriority (using a new PriorityAttribute)
  • GetMethod method for easily converting a static method to a MethodInfo.
  • ForEachBaseType for iterating through each type in a type's hierarchy.
  • GetTypesSafe - Assembly.GetTypes but it won't throw an exception and will sort by PriorityAttribute.
  • GetImplementedMethod for getting the implementation of an interface method (even explicitly implemented).
  • GetDelegateSignature and similar to get parameters, return type, and Invoke method of a delegate type.
  • CouldBeAssignedTo for checking if it's possible for a variable of one type to have a value of another type.
  • Safe, generic methods for getting and checking attribtues.

EmitUtility

Various tools for Harmony patching.

  • Generic Throw method for Harmony transpilers with optional message.
  • Methods to use with for loop + List Harmony transpiling.
    • MatchPattern
    • FollowPattern
    • RemovePattern
    • ReturnIfFalse
    • ContinueUntil
    • ContinueWhile
    • LabelNext
    • LabelNextOrReturn
    • GetNextBranchTarget
    • FindLabelDestinationIndex
    • GetLabelId
    • EmitArgument
    • GetLocalIndex
    • LoadConstantI4
    • GetParameter
    • EmitParameter
    • GetLocal
  • Methods for CodeInstruction manipulation
    • CopyWithoutSpecial
    • TransferStartingInstructionNeeds
    • TransferEndingInstructionNeeds
    • MoveBlocksAndLabels
    • IsBeginBlockType
    • IsEndBlockType
  • Extensions for OpCode matching
    • IsOfType
    • IsStLoc
    • IsLdLoc
    • IsStArg
    • IsLdArg
    • IsBr
    • IsBrAny
    • IsLdc
    • IsConv
  • Extensions for emitting call vs callvirt codes.
    • GetCall
    • GetCallRuntime

Other

  • Extensions for Stopwatch
    • GetElapsedMilliseconds (returns a double instead of a long like usual)
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  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 is compatible.  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 is compatible.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 is compatible.  net472 was computed.  net48 was computed.  net481 is compatible. 
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 (8)

Showing the top 5 NuGet packages that depend on DanielWillett.ReflectionTools:

Package Downloads
DanielWillett.UnturnedUITools

Tools for working with vanilla (Glazier, Sleek, etc.) UIs in Unturned, including an extension system.

DevkitServer.Client

Module for Unturned that enables multi-user map editing.

DevkitServer.Server

Module for Unturned that enables multi-user map editing.

Uncreated.UI

Object-oriented wrapper for Unturned's effect-based server-side UI system.

Breakdown.Tools

Package containing several tools for plugin and module development.

GitHub repositories

This package is not used by any popular GitHub repositories.

Added check for default interface implementations in Accessor.GetImplementedMethod.