Skip to content

Instantly share code, notes, and snippets.

View CamelCaseName's full-sized avatar
🪨
rock

Leonhard Seidel CamelCaseName

🪨
rock
View GitHub Profile
@CamelCaseName
CamelCaseName / CallWrapper.cs
Created April 30, 2024 19:04
simple wrapper to get information on where a call was made from
using System;
namespace Freecam
{
public static class CallWrapper
{
public static void Wrap(Action a, [System.Runtime.CompilerServices.CallerMemberName] string caller = "", [System.Runtime.CompilerServices.CallerLineNumber] int line = 0)
{
Console.WriteLine($"{a.Method.Name} called from {caller}:{line}");
@CamelCaseName
CamelCaseName / AssemblyTest.cs
Created March 5, 2024 19:02
Example of self embedded assembly extraction
using System.Reflection;
using System.Runtime.Loader;
namespace AssemblyTest
{
internal class AssemblyTest
{
static AssemblyTest()
{
SetOurResolveHandlerAtFront();
@CamelCaseName
CamelCaseName / SearchTextBox.cs
Created July 24, 2023 18:29
c# TextBox for Search field, with search result counter embedded
using System;
using System.Drawing;
using System.Runtime.Versioning;
using System.Windows.Forms;
namespace CustomComponents
{
//see https://gist.github.com/CamelCaseName/84324c076342c050307af9779a224c3c for the base class
[SupportedOSPlatform("Windows")]
internal sealed class SearchTextBox : HighLightTextBox
@CamelCaseName
CamelCaseName / HighLightTextBox.cs
Last active July 24, 2023 18:27
c# TextBox with placeholdertext in different color and a highlight text
using System;
using System.Drawing;
using System.Runtime.Versioning;
using System.Windows.Forms;
namespace CustomComponents
{
public static partial class Winutils
{
public const int WM_LBUTTONDOWN = 0x201;
@CamelCaseName
CamelCaseName / ColoredCheckListBox.cs
Created July 24, 2023 18:20
c# WinForms CheckListBox with 3 different colors and no double click!
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace CustomComponents
{
[SupportedOSPlatform("Windows")]
public static class Winutils
@CamelCaseName
CamelCaseName / ColoredDropDown.cs
Created July 24, 2023 18:17
c# WinForms ComboBox where you can color some fields in a different color
using System;
using System.Drawing;
using System.Linq;
using System.Runtime.Versioning;
using System.Windows.Forms;
namespace CustomComponents
{
[SupportedOSPlatform("windows")]
internal sealed class ColoredDropDown : ComboBox
@CamelCaseName
CamelCaseName / ToggleButton.cs
Created July 24, 2023 18:14
C# Winforms Button that can be toggled
using System.Drawing;
using System.Windows.Forms;
namespace CustomComponents
{
public class ToggleButton : Button
{
public Color SecondBackColor = Color.FromKnownColor(KnownColor.Highlight);
private Color BackgroundColor = DefaultBackColor;
private bool isToggled = false;
@CamelCaseName
CamelCaseName / NoAnimationBar.cs
Created July 24, 2023 18:12
C# Winforms Progressbar without Animation and custom color
using System.Drawing;
using System.Windows.Forms;
namespace CustomComponents
{
/// <summary>
/// A extended WinForms ProgressBar which has a different colour and removes the animation.
/// </summary>
public class NoAnimationBar : ProgressBar
{
@CamelCaseName
CamelCaseName / OwnerDrawTabControl.cs
Last active July 24, 2023 18:29
Fully owner draw a TabControl tab title bar in WinForms c#
using System.Runtime.InteropServices;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Runtime.Versioning;
using System.Windows.Forms;
namespace CustomComponents
{
[StructLayout(LayoutKind.Sequential)]
@CamelCaseName
CamelCaseName / icnd2153.md
Last active November 27, 2023 15:40
Explaining how to interface with the ICND2153 16 channel constant current LED drivers

How to use the ICND2153, FM6124C or STP1612PW05 or similar 16 channel PWM LED drivers

Config registers (default is usually fine, i dont change them)

config register

^pulled from the STP1612PW05 datasheet, icnd2153 and FM6124C are identical.

It seems like the ICND2153 and FM6124C copied the STP1612PW05 datasheet, then they deleted all relevant info. Even the testing circuits, electrical properties and similar is identical.

Order of operations for default display use:

selecting a row