internal BitmapImage GetBitmapImage(bool up, bool proxyOnly = false)
{
if (!up)
{
if (string.IsNullOrWhiteSpace(sleeveUrl))
return Program.GameEngine.GetCardBack(this.Size.Name);
BitmapImage b = null;
Library.X.Instance.Try(() => b = ImageUtils.CreateFrozenBitmap(new Uri(sleeveUrl)));
if (b == null)
return Program.GameEngine.GetCardBack(this.Size.Name);
return b;
}
if (Type == null || Type.Model == null) return Program.GameEngine.GetCardFront(this.Size.Name);
BitmapImage bmpo = null;
Octgn.Library.X.Instance.Try(() =>
{
//Uri imgUrl = null;
//imgUrl = proxyOnly ? new Uri(Type.Model.GetProxyPicture()) : new Uri(Type.Model.GetPicture());
ImageUtils.GetCardImage(Type.Model, x => bmpo = x,proxyOnly);
});
return bmpo ?? Program.GameEngine.GetCardFront(this.Size.Name);
}