/// <summary> /// /// </summary> public void Stop() { try { #region ApplicationLogEntries ApplicationEventMaster Event = unitOfWork.ApplicationEventMasterRepository .SelectByID(Constants.EventType.Validation_Engine_Stopped); ApplicationMaster Application = unitOfWork.ApplicationMasterRepository .SelectByID(Constants.ApplicationId); ApplicationLog obj = unitOfWork.CreateApplicationLogObject(Event, Application, "LoremIpsumMessage", "amjad.leghari"); unitOfWork.ApplicationLogRepository.Insert(obj); unitOfWork.Save(); #endregion this.unitOfWork.Dispose(); this.Rules = null; this.ConfigXmlDocument = null; this.config = null; } catch (Exception ex) { Logger.Instance.GetLogInstance().Error(JsonConvert.SerializeObject(ex)); } }
/// <summary> /// /// </summary> /// <param name="xDoc"></param> public ValidatorEngine(XDocument xDoc) { try { ApplicationMaster objApplicationMaster = unitOfWork.ApplicationMasterRepository .SelectByID(Constants.ApplicationId); //TODO validate the rule xml using the xsd Helper.XMLManagement <ValidationRuleEngine.Configuration.ConfigurationStore> .Instance .UnMarshalingFromXML(objApplicationMaster.ConfigFilePath, out configurationStore); /*--------------------*/ this.ConfigXmlDocument = XDocument.Load(objApplicationMaster.ConfigFilePath); this.config = configurationStore.Items[0]; this.CurrentXmlDocument = xDoc;//XDocument.Load(this.config.source_file_path); } catch (Exception ex) { Logger.Instance.GetLogInstance().Error(JsonConvert.SerializeObject(ex)); } }