rd-net/Test.Lifetimes/GeneralEx.cs (17 lines of code) (raw):

using System; using System.ComponentModel; using System.Diagnostics; using JetBrains.Annotations; namespace Test.Lifetimes { public static class GeneralEx { [DebuggerStepThrough] [EditorBrowsable(EditorBrowsableState.Never)] public static T With<T>(this T control, [InstantHandle, NotNull] Action<T> action) { action(control); return control; } } }