private void NodeAvailable(IChildModule childModule) { ModuleIsOk(childModule); StringLoad(); BoolListAdd(childModule); (childModule.AutoKey ? (Action <IChildModule>)AutoKeyWork : ManualKeyWork)(childModule); }
private void ManualKeyWork(IChildModule childModule) { var key = EditString(childModule.Key); var result = EditString(_temp); if (!_entity.KeyList.Contains(key)) { if (!childModule.Key.Equals(@" Manual Key") && !childModule.Key.Equals(@" Please enter a keyword") && !childModule.Key.Equals(@" Key already exists!")) { childModule.KeyColor = Color.MediumSeaGreen; _entity.KeyList.Add(key); _entity.PathList.Add(childModule.XPath); } else { _ready = false; childModule.Key = @" Please enter a keyword"; childModule.KeyColor = Color.Crimson; } childModule.Result = result; childModule.ResultColor = Color.MediumSeaGreen; } else { _ready = false; childModule.Key = @" Key already exists!"; childModule.KeyColor = Color.Crimson; } }
private void TryNodeLoading(IChildModule childModule) { _node = null; try { _node = _doc.DocumentNode.SelectSingleNode(childModule.XPath); } catch { // ignored } }
private void SeparatorAvailable(IChildModule childModule) { var spl = _temp.Split(new[] { _parentModule.Separator }, StringSplitOptions.None); var key = EditString(spl[0]); var length = key.Length + _parentModule.Separator.Length; var value = EditString(_temp.Substring(length)); if (!_entity.KeyList.Contains(key)) { _entity.KeyList.Add(key); _entity.PathList.Add(childModule.XPath); childModule.Key = key; childModule.KeyColor = Color.MediumSeaGreen; } else { _ready = false; childModule.KeyColor = Color.Crimson; childModule.Key = @" Key already exists!"; } childModule.Result = value; childModule.ResultColor = Color.MediumSeaGreen; }
private void SeparatorNull(IChildModule childModule) { _ready = false; childModule.Key = @" Key not found"; childModule.KeyColor = Color.Crimson; }
private void AutoKeyWork(IChildModule childModule) { (_temp.Contains(_parentModule.Separator) ? (Action <IChildModule>)SeparatorAvailable : SeparatorNull)( childModule); }
private void NodeNull(IChildModule childModule) { _ready = false; childModule.XPath = @" XPath is invalid"; childModule.XPathColor = Color.Crimson; }
private void BoolListAdd(IChildModule childModule) { _entity.BoolList.Add(childModule.AutoKey); }
private void ModuleIsOk(IChildModule childModule) { childModule.XPathColor = Color.MediumSeaGreen; }