private void CreateModalityMap() { //no need if (ModalityMatchingRegex == null) { return; } _modalityMap = new Dictionary <DataTable, string>(); foreach (DataTable dt in _columnNameToTargetTablesDictionary.Values.SelectMany(v => v).Distinct()) { var m = ModalityMatchingRegex.Match(dt.TableName); if (!m.Success) { throw new Exception("ModalityMatchingRegex failed to match against DataTable " + dt.TableName); } var modality = m.Groups[1].Value; if (!_modalityMap.ContainsKey(dt)) { _modalityMap.Add(dt, modality); } } }
public override void Check(ICheckNotifier notifier) { if (LoadPipeline != null) { new PipelineChecker(LoadPipeline).Check(notifier); //don't check this since we are our own Fixed source for the engine so we just end up in a loop! but do instantiate it incase there are construction/context errors PipelineChecker c = new PipelineChecker(LoadPipeline); c.Check(notifier); } if (ModalityMatchingRegex != null && !ModalityMatchingRegex.ToString().Contains('(')) { notifier.OnCheckPerformed( new CheckEventArgs( "Expected ModalityMatchingRegex '" + ModalityMatchingRegex + "' to contain a group matching for extracting modality e.g. '^(.*)_.*$'", CheckResult.Fail)); } }