/// <summary> /// Initializes a new instance of the PropertyCriteria class. /// </summary> /// <param name="name">The property name.</param> /// <param name="op">The operator.</param> /// <param name="value">The value of property.</param> /// <remarks>You can use this to initialize an instance for the class.</remarks> public PropertyCriteria(string name, DbCompareOperator op, string value) { Name = name; Condition = new StringCondition { Operator = op, Value = value }; }
/// <summary> /// Filters a sequence of values based on a condition. /// </summary> /// <param name="source">A string collection to filter.</param> /// <param name="condition">The condition.</param> /// <returns>A string collection that contains elements from the input sequence that satisfy the condition.</returns> public static IEnumerable <string> Where(this IEnumerable <string> source, StringCondition condition) { if (condition == null) { return(source); } return(source.Where(ele => condition.IsMatched(ele))); }
private bool? EvaluateStringCondition(StringCondition condition) { DrawnString drawString = (DrawnString)GameGraphics.GetDrawShape(condition.DrawableName); switch (condition.Operator) { case Operator.Equal: return drawString.Value == condition.CompareValue; case Operator.NotEqual: return drawString.Value != condition.CompareValue; default: return null; } }
public StringSearch(string value, StringCondition condition = StringCondition.Equal, string value2 = null) : base(value) { Condition = condition; Value2 = value2; }
public static void Auto(int widthbrowser, int heightbrowser, bool visible) { Info.Setting.Width = widthbrowser; Info.Setting.Height = heightbrowser; //Info.Setting.Top = this.Top; //Info.Setting.Left = this.Left; Info.Setting.Visible = visible; string[] AutoScriptRow = Info.AutoScript.Script.Split(new[] { Environment.NewLine }, StringSplitOptions.None); while (true) { foreach (string row in AutoScriptRow) { string[] column = row.Split('|'); foreach (string command in column) { WaitPageLoad.Instance().Run(null); try { if (Regex.IsMatch(command, "^getdata")) { MatchCollection coll = Regex.Matches(command, "^getdata\\('([^']+)'\\)"); string data = coll[0].Groups[1].Value; InfomationStartup.Response = EvaluateJavascript.Instance().Run(data); } else if (Regex.IsMatch(command, "^checkcaptcha")) { MatchCollection coll = Regex.Matches(command, "^checkcaptcha\\('([^']+)','([^']+)'\\)"); string detectecaptcha = coll[0].Groups[1].Value; string clickcaptchatosolve = coll[0].Groups[2].Value; //MessageBox.Show(detectecaptcha + " " + clickcaptchatosolve + " " + detectecapchasolved); if (CheckVisible.Instance().Run("checkvisible('" + detectecaptcha + "')")) { //MessageBox.Show(detectecaptcha + " " + clickcaptchatosolve); InfomationStartup.Captcha = true; while (true) { try { Thread.Sleep(1000); if (InfomationStartup.ClickRecaptcha) { Click.Instance().Run("click('" + clickcaptchatosolve + "',20,20)"); InfomationStartup.ClickRecaptcha = false; } if (StringCondition.Instance().Run("string('document.querySelector(\"" + clickcaptchatosolve + "\").getAttribute(\"data-hcaptcha-response\")==\"\";'=='False')")) { break; } } catch (Exception e) { MessageBox.Show(e.Message); } } InfomationStartup.Captcha = false; } } else if (!Browser.HandleAutoCommand(command)) { break; } } catch (Exception e) { MessageBox.Show("command:" + command + " : " + e.Message); } } } } }