public string GetImagePath(Framework.Data.ImageSize imageSize, Framework.Data.GeocacheAttribute attr, Framework.Data.GeocacheAttribute.State state) { string result; string fn; string ext; if (attr.ID < 100) { ext = "gif"; } else { //above 100 = opencaching.de ext = "png"; } if (state == Framework.Data.GeocacheAttribute.State.Yes) { fn = string.Format("{0}.{1}", attr.ID, ext); } else if (state == Framework.Data.GeocacheAttribute.State.No) { fn = string.Format("_{0}.{1}", attr.ID, ext); } else { return(null); } result = Path.Combine(new string[] { _baseImagePath, imageSize.ToString(), "attributes", fn }); if (!File.Exists(result)) { if (imageSize != Framework.Data.ImageSize.Default) { result = Path.Combine(new string[] { _baseImagePath, imageSize.ToString(), "attributes", fn }); if (!File.Exists(result)) { result = null; } } else { result = null; } } return(result); }
public string GetImagePath(Framework.Interfaces.ICore core, Framework.Data.ImageSize imageSize, Framework.Data.GeocacheAttribute attr, Framework.Data.GeocacheAttribute.State state) { string result = null; foreach (Framework.Interfaces.IImageResource ir in _imageResourcePlugins) { result = ir.GetImagePath(imageSize, attr, state); if (!string.IsNullOrEmpty(result)) { break; } } if (result == null && imageSize != Framework.Data.ImageSize.Default) { result = GetImagePath(core, Framework.Data.ImageSize.Default, attr, state); } else if (string.IsNullOrEmpty(result)) { //select default result = GetDefaultImagePath(imageSize); } return(result); }
public string GetImagePath(Framework.Data.ImageSize imageSize, Framework.Data.GeocacheAttribute attr, Framework.Data.GeocacheAttribute.State state) { return(null); }