public void Check(bool isPartial) { m_checkingWS = Util.ServerWorkspace; m_errors.Clear(); m_log.Clear(); m_log.Add("Start Check"); IsCheckTaskData = isPartial; if (isPartial) { LoadCheckItems(); } else { CheckItems.Clear(); } foreach (var checker in Checkers) { m_log.Add("---------------------"); m_log.Add("Checher:" + checker.GetType().ToString()); BaseChecker bc = checker as BaseChecker; if (checker.CheckData()) { if (bc.CheckErrorList != null) { foreach (CheckError err in bc.CheckErrorList) { m_log.Add(err.Description); } m_errors.AddRange(bc.CheckErrorList.OfType <CheckError>()); } m_log.Add("Check Successfully"); } else { m_log.Add("Check Failed"); m_log.Add(bc.Message); } m_log.Add("---------------------"); } m_log.Add("End Check"); }
public void LoadConfig(string filename) { m_checkers.Clear(); XElement doc = XElement.Load(filename); var checkers = from pn in doc.Descendants("Checker") select pn; foreach (var c in checkers) { string typeName = c.Attribute("Type").Value + ",DataGateWayLibrary"; BaseChecker checker = Activator.CreateInstance(System.Type.GetType(typeName)) as BaseChecker; checker.Manager = this; var parameters = from pn in c.Descendants("p") select pn.Value; List <string> ps = new List <string>(); ps.AddRange(parameters); checker.Params = ps; IChecker ick = checker as IChecker; m_checkers.Add(ick); } }
public void Check(string taskName, bool isPartial) { IVersionedWorkspace vws = Util.ServerWorkspace as IVersionedWorkspace; m_checkingWS = vws.FindVersion(taskName) as IWorkspace; m_errors.Clear(); m_log.Clear(); m_log.Add("Start Check"); IsCheckTaskData = true; LoadCheckItems(taskName, isPartial); foreach (var checker in Checkers) { m_log.Add("---------------------"); m_log.Add("Checker:" + checker.GetType().ToString()); BaseChecker bc = checker as BaseChecker; if (checker.CheckData()) { if (bc.CheckErrorList != null) { foreach (CheckError err in bc.CheckErrorList) { m_log.Add(err.Description); } m_errors.AddRange(bc.CheckErrorList.OfType <CheckError>()); } m_log.Add("Check Successfully"); } else { m_log.Add("Check Failed"); m_log.Add(bc.Message); } m_log.Add("---------------------"); } m_log.Add("End Check"); }