コード例 #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));
 }