예제 #1
0
 protected ImageLoader(ImageConfig imageConfig) : this()
 {
     if (imageConfig == null)
     {
         throw new ArgumentException("Can not initialize ImageLoader with empty configuration");
     }
 }
예제 #2
0
 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);
 }
예제 #3
0
 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);
 }
예제 #4
0
 /// <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));
 }