using SteamWare; using System; namespace MoonProTablet { public class utility { /// /// determina se si debba usare CDN x scaricare librerie asp.net ajax /// public static bool EnableCdnAjax { get { bool answ = false; try { answ = memLayer.ML.confReadBool("EnableCdnAjax"); } catch { } return answ; } } /// /// determina se si debba usare CDN x scaricare librerie jquery /// public static bool EnableCdnJQ { get { bool answ = false; try { answ = memLayer.ML.confReadBool("EnableCdnJQ"); } catch { } return answ; } } /// /// formatta la durata in minuti in un modo "human readable" gg/min/ore /// /// minuti /// public static string formatDurata(object min) { string answ = ""; DateTime tempo = new DateTime(); double minuti = 0; try { minuti = Convert.ToDouble(min); tempo = tempo.AddMinutes(minuti); } catch { } if (minuti < memLayer.ML.confReadInt("maxMinuti")) { answ = string.Format("{0}m {1}s", tempo.Minute, tempo.Second); } else if (minuti < memLayer.ML.confReadInt("maxOre")) { answ = string.Format("{0}h {1}m", tempo.Hour, tempo.Minute); } else { answ = string.Format("{0}gg {1}h {2}m", tempo.DayOfYear, tempo.Hour, tempo.Minute); } return answ; } } }