public static T GetOrAddDefinition <T>(this Polymorphic <T> polymorphic, Type type) where T : class, new()
        {
            T value = polymorphic.GetDefinition(type);

            if (value != null)
            {
                return(value);
            }

            value = new T();

            polymorphic.SetDefinition(type, value);

            return(value);
        }
        public static R Invoke <T, P0, P1, P2, P3, R>(this Polymorphic <Func <T, P0, P1, P2, P3, R> > polymorphic, T instance, P0 p0, P1 p1, P2 p2, P3 p3)
        {
            var func = polymorphic.GetValue(instance.GetType());

            return(func(instance, p0, p1, p2, p3));
        }
        public static R Invoke <T, P0, R>(this Polymorphic <Func <T, P0, R> > polymorphic, T instance, P0 p0)
        {
            var func = polymorphic.GetValue(instance.GetType());

            return(func(instance, p0));
        }
        public static void Invoke <T, P0, P1, P2, P3>(this Polymorphic <Action <T, P0, P1, P2, P3> > polymorphic, T instance, P0 p0, P1 p1, P2 p2, P3 p3)
        {
            var action = polymorphic.GetValue(instance.GetType());

            action(instance, p0, p1, p2, p3);
        }
        public static void Invoke <T, P0, P1>(this Polymorphic <Action <T, P0, P1> > polymorphic, T instance, P0 p0, P1 p1)
        {
            var action = polymorphic.GetValue(instance.GetType());

            action(instance, p0, p1);
        }
        public static void Invoke <T>(this Polymorphic <Action <T> > polymorphic, T instance)
        {
            var action = polymorphic.GetValue(instance.GetType());

            action(instance);
        }
 public static void Register <T, S, P0, P1, P2, P3, R>(this Polymorphic <Func <T, P0, P1, P2, P3, R> > polymorphic, Func <S, P0, P1, P2, P3, R> func) where S : T
 {
     polymorphic.SetDefinition(typeof(S), (t, p0, p1, p2, p3) => func((S)t, p0, p1, p2, p3));
 }
 public static void Register <T, S, R>(this Polymorphic <Func <T, R> > polymorphic, Func <S, R> func) where S : T
 {
     polymorphic.SetDefinition(typeof(S), t => func((S)t));
 }
 public static void Register <T, S, P0, P1, P2, P3>(this Polymorphic <Action <T, P0, P1, P2, P3> > polymorphic, Action <S, P0, P1, P2, P3> action) where S : T
 {
     polymorphic.SetDefinition(typeof(S), (t, p0, p1, p2, p3) => action((S)t, p0, p1, p2, p3));
 }
 public static void Register <T, S, P0>(this Polymorphic <Action <T, P0> > polymorphic, Action <S, P0> action) where S : T
 {
     polymorphic.SetDefinition(typeof(S), (t, p0) => action((S)t, p0));
 }
 public static void Register <T, S>(this Polymorphic <Action <T> > polymorphic, Action <S> action) where S : T
 {
     polymorphic.SetDefinition(typeof(S), t => action((S)t));
 }