public override void Perform() { List <string> list = GetMutiContent(); if (list.Count == 0) { return; } ActionVariable var1 = VariableModel.Find(ObjectName); if (ExtractType == Data.ExtractType.None) { if (var1 is ActionStringVariable) { var1.Data = list[0]; } else if (var1 is ActionArrayVariable) { ((ActionArrayVariable)var1).AddItemsToList(list); } } else if (ExtractType == Data.ExtractType.AddMutiContentToTableColumn) { ActionTableVariable var = VariableModel.Find <ActionTableVariable>(ObjectName); var.AddListToTableColumn(list); } else if (ExtractType == Data.ExtractType.AddMutiContentToTableRow) { ActionTableVariable var = VariableModel.Find <ActionTableVariable>(ObjectName); var.AddListToTableRow(list); } }
private void IntegerPerform(ActionVariable var) { int val = (int)var.Data; for (int i = 0; i < val; i++) { base.Perform(); } }
public override void Perform() { ActionVariable var = AppContext.ActionModel.VariableActionModel.Find(VarName); //遍历数组变量 if (var is ActionArrayVariable) { ArrayPerform(var); } else if (var is ActionTableVariable) { TablePerform(var); } else if (var is ActionIntegerVariable) { IntegerPerform(var); } }
private void ArrayPerform(ActionVariable var) { ActionArrayVariable arrVar = var as ActionArrayVariable; if (Reverse) { arrVar.Reverse(); } int count = arrVar.Count; if (TopN > 0 && TopN < count) { count = TopN; } for (int i = 0; i < count; i++) { MapAttribute = arrVar.GetMapAttribute(i); base.Perform(); } }
private void TablePerform(ActionVariable tableVar) { ActionTableVariable var = tableVar as ActionTableVariable; DataTable data = var.Data as DataTable; if (Reverse) { data = ReverseRowsInDataTable(data); } int count = data.Rows.Count; if (TopN > 0 && TopN < count) { count = TopN; } for (int i = 0; i < count; i++) { MapAttribute = var.GetMapAttribute(i); base.Perform(); } }