/// <summary> /// Builds a fortress. /// </summary> /// <param name="fullPath"></param> /// <param name="fortressName"></param> /// <param name="password"></param> /// <returns></returns> public bool BuildFortress(string fullPath, string fortressName, string password) { try { _xmlDatacache = new XmlDataCache(fullPath); _xmlDatacache.BuildFortress(fullPath, fortressName, password); password = string.Empty; CurrentFortressData.FullPath = fullPath; CurrentFortressData.FortressName = fortressName; CurrentFortressData.IsLocked = false; CurrentFortressData.FortressId = _xmlDatacache.GetAllFromUnsecure <Fortress>().FirstOrDefault().Id; return(true); } catch (Exception ex) { _xmlDatacache = null; password = string.Empty; Logger.log.Error($"Couldn't build fortress: {ex}"); return(false); } }
/// <summary> /// Get all non sensible models of type T. Can return null. /// </summary> /// <typeparam name="T"></typeparam> /// <returns></returns> public IEnumerable <T> GetAll <T>() => _xmlDatacache.GetAllFromUnsecure <T>();