public static bool AllowConnection(this IHook hook, IHook other) { if (hook.IsConnectedTo(other)) { return(false); } if (hook.MaxConnections != 0 && hook.Connections.Count >= hook.MaxConnections) { return(false); } return(true); }