Пример #1
0
        public override RunResult Run(DataRow input, DataTable dataTable, DataObjectStore store, Type codeBehind, Workflow.UpdateTableDelegate updateTableDelegate)
        {
            RunResult runResult = new RunResult();

            foreach (string text in this.GetDataObjectKeys(store))
            {
                object             obj = null;
                IDataObjectCreator dataObjectCreator = store.GetDataObjectCreator(text);
                if (dataObjectCreator != null)
                {
                    obj = dataObjectCreator.Create(dataTable);
                }
                else
                {
                    Type dataObjectType = store.GetDataObjectType(text);
                    if (null != dataObjectType)
                    {
                        obj = dataObjectType.GetConstructor(new Type[0]).Invoke(new object[0]);
                    }
                }
                if (obj != null)
                {
                    store.UpdateDataObject(text, obj, true);
                    updateTableDelegate(text, false);
                }
            }
            runResult.DataObjectes.AddRange(store.GetKeys());
            return(runResult);
        }
Пример #2
0
        private IEnumerable <string> GetDataObjectKeys(DataObjectStore store)
        {
            if (string.IsNullOrEmpty(this.DataObjectNames))
            {
                return(store.GetKeys());
            }
            IList <string> list = new List <string>();

            foreach (string text in this.DataObjectNames.Split(new char[]
            {
                ','
            }))
            {
                list.Add(text.Trim());
            }
            return(list);
        }