public static ImageboardProvider <T> GetProvider <T>() where T : BooruPost { if (Providers.ContainsKey(typeof(T))) { if (Providers.TryGetValue(typeof(T), out ImageboardProvider <BooruPost> value)) { ImageboardProvider <T> output = new ImageboardProvider <T>(value.Config); return(output); } } return(null); }
public static void AddProvider <T>(ImageboardProvider provider) where T : BooruPost { Providers.Add(typeof(T), provider); }
public static void AddProvider <T>(ImageboardProvider <T> provider) where T : BooruPost { ImageboardProvider <BooruPost> newProvider = new ImageboardProvider <BooruPost>(provider.Config); Providers.Add(typeof(T), newProvider); }