protected ImageLoader(ImageConfig imageConfig) : this() { if (imageConfig == null) { throw new ArgumentException("Can not initialize ImageLoader with empty configuration"); } }
public static ImageLoader Initialize(ImageConfig imageConfig) { if (imageConfig == null) { throw new ArgumentException("Can not initialize ImageLoader with empty configuration"); } if (ImageConfig.Default != null) { return(ImageLoader.Instance); } ImageConfig.Default = imageConfig; return(ImageLoader.Instance); }
public static ImageLoader Initialize(ImageConfig imageConfig, bool isLogEnabled = false) { if (imageConfig == null) { throw new ArgumentException("Can not initialize ImageLoader with empty configuration"); } if (ImageLoader.Instance._ImageConfig != null) { return(ImageLoader.Instance); } IsLogEnabled = isLogEnabled; ImageLoader.Instance._ImageConfig = imageConfig; return(ImageLoader.Instance); }
/// <summary> /// 注册其他的Image Loader,便于不同策略使用 /// </summary> /// <param name="key"></param> /// <param name="imageLoader"></param> public static void Register(string key, ImageConfig imageConfig) { Collection.Add(key, new ImageLoader(imageConfig)); }