public FormPixelColorHelper(ConditionPixelColor pixelColor) { InitializeComponent(); ConditionPixelColor = pixelColor; nudPixelX.Value = pixelColor.m_nudPixelX.Value; nudPixelY.Value = pixelColor.m_nudPixelY.Value; nudMaxDIfference.Value = pixelColor.m_nudMaxDifference.Value; pbPreview.Image = Makru.Properties.Resources.icon_command; }
private Condition ReadJSONCondition(dynamic json) { if (json.Count == 0) { return(null); } Condition retCondition = null; switch ((string)json.type) { case "conditionAnd": retCondition = new ConditionAnd(ReadJSONCondition(json.condition1), ReadJSONCondition(json.condition2), this); break; case "conditionOr": retCondition = new ConditionOr(ReadJSONCondition(json.condition1), ReadJSONCondition(json.condition2), this); break; case "conditionWaitFor": retCondition = new ConditionWaitFor(ReadJSONCondition(json.condition), (int)json.checkInterval, this); break; case "conditionPixelColor": retCondition = new ConditionPixelColor((int)json.x, (int)json.y, Color.FromArgb((int)json.color), (int)json.maxColorifference); break; case "conditionComapeText": retCondition = new ConditionCompareOutputs(ReadJSONOutput(json.output1), (string)json.conditionOperator, ReadJSONOutput(json.output2), this); break; case "conditionProcessName": retCondition = new ConditionProcessName((string)json.processName, (bool)json.processesContain); break; } return(retCondition); }