public static string _GetMediaUrl(CoCEnum.CoCFmtReq type, CoCEnum.CoCBadgeType size, string imgId) { CoCMediaSetInfo cms = null; if ((cms = CoCMediaSet.GetMediaSet(type)) == null) { return(null); } return(string.Format( Properties.Settings.Default.CoCLocalMediaURL, cms.mpath[0], cms.mpath[1], cms.mdir, cms.msize[(int)size].ToString(), ((string.IsNullOrWhiteSpace(imgId)) ? "" : imgId + ".png") )); }
private void _CheckMediaDir(CoCMediaSetInfo cms) { try { foreach (int i in cms.msize) { string path = Path.Combine( this._basepath, cms.mpath[0], cms.mpath[1], cms.mdir, i.ToString() ); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } } } catch (Exception e) { throw e; } }