Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        private void IntegerPerform(ActionVariable var)
        {
            int val = (int)var.Data;

            for (int i = 0; i < val; i++)
            {
                base.Perform();
            }
        }
Exemplo n.º 3
0
        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);
            }
        }
Exemplo n.º 4
0
        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();
            }
        }
Exemplo n.º 5
0
        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();
            }
        }