public KBResource LoadConfiguration(int clientId, int portalId, string language, bool reload)
 {
     string fileName = null;
     string path = null;
     try
     {
         fileName = Utilities.GetResourceFileName(language);
         path = GetXmlConfigPath(clientId, portalId, fileName);
         if (!File.Exists(path))
         {
             throw new FileNotFoundException("Resource file does not exist", path);
         }
         var xdoc = XDocument.Load(path);
         ReadAndFillResource(xdoc);
     }
     catch (FileNotFoundException ex)
     {
         string userError = string.Format("{0}: {1}", GeneralResources.IOError, ex.Message);
         KBCustomException kbCustExp = KBCustomException.ProcessException(ex, KBOp.LoadConfigFile, KBErrorHandler.GetMethodName(), userError,
             new KBExceptionData("clientId", clientId), new KBExceptionData("portalId", portalId), new KBExceptionData("path", path), new KBExceptionData("fileName", fileName));
         throw kbCustExp;
     }
     KBResource res = new KBResource(portalId,clientId);
     res.Resources = Resources;
     return res;
 }
 public void AddPortalResourceSession(KBResource portalResource)
 {
     if (portalResource == null) throw new ArgumentNullException("portalResourcesession null");
     _portalResourceSessions.Add(portalResource.PortalId, portalResource);
 }