RazorSharpFang
✅ Windows Joystick API
What's the recommended Windows API to use for Joystick/Gamepad input these days if one needs background (non-focused window, problem for Windows.Gaming.Input) input, and one is not willing to take a dependency on the GDK (Read: No GameInput) whilst also being able to read independently the two triggers of the Xbox-style gamepad controllers (Problem for DirectInput) and working with various types of controllers that are NOT XInput-compatible (Like the PS4 controllers, problem for XInput) ?
29 replies
❔ SQLite in-memory Database read from ReadOnlyMemory bytes
I'm receiving an SQLite database payload from an AMQP-0-9-1 message in the form of
ReadOnlyMemory<byte>
Rather than writing these bytes to disk and then opening that file with the regular SQLite toolset, I want to be able to work with the sqlite database in a read-only form without having to hit the disk.
Is this possible with the currently available SQLite toolset, or is this an impossible task?75 replies
Unmanaged struct backed INPC ViewModel, only raising PropertyChanged when backing field(s) changed
So, suppose we have a large unmanaged struct that we obtain from external source, suppose from a network resource.
This unmanaged struct decomposes into a set of primitives, with various values.
and then we have our ViewModel class that implements INotifyPropertyChanged. I have made an example below, not using the above struct as a field.
I had a thought to in the View Model class just have a single field of the unmanaged struct, and then fire off events of property changed.
But if I were to do that, how would one determine which properties were changed ?
Would it be better to have the unmanaged struct as the sole backing field, or should I not do that?
3 replies
How do you pass into a method a generic after you've reflected? [Answered]
Suppose I suspect that this IEnumerable (non-generic) is also an IReadOnlyList<T> where T : struct.
Unfortunately due to the rules of casting, an IReadOnlyList<T> where T : struct is not castable to an IReadOnlyList<object>
How unfortunate! But we have reflection!
Suppose I have an IEnumerable called source. I can probe its types as follows
Another class takes in as an argument to its constructor, IReadOnlyList<T> Defined below:
How do I after probing call this constructor now that I know it implements the interface as required?
42 replies