namespace Lux.UI.Components { public abstract class BaseComp : ComponentBase { #region Protected Properties [Inject] protected IVocabolarioService VService { get; set; } = null!; #endregion Protected Properties #region Protected Methods /// /// Gestione traduzione interfaccia con lingua corrente /// /// /// /// protected string Traduci(string lemma) { return VService.Traduci(lemma, lingua); } #endregion Protected Methods #region Private Fields /// /// Lingua corrente (da rivedere con Cascading Parameters /// private string lingua = "IT"; #endregion Private Fields #region Private Properties [Inject] private IConfiguration Config { get; set; } = null!; #endregion Private Properties #if false private static Logger Log = LogManager.GetCurrentClassLogger(); /// /// Base path x network share files /// private string basePath = "unsafe_uploads"; private void ConfInit() { basePath = Config.GetValue("ServerConf:FileSharePath") ?? "unsafe_uploads"; } /// /// Restituisce il contenuto del file salvato /// /// /// /// private string LoadFileContent(string folderPath, string secureName) { string answ = ""; if (!string.IsNullOrEmpty(folderPath)) { try { // calcolo path file... string filePath = Path.Combine(basePath, folderPath, secureName); if (File.Exists(filePath)) { answ = File.ReadAllText(filePath); } } catch (Exception exc) { Log.Error($"Exception on LoadFileContent{Environment.NewLine}{exc}"); } } return answ; } #endif } }