Пример #1
0
        public Guid Execute(ProcessorData procdata)
        {
            Guid guid = Guid.Empty;

            if (this.Proxy != null)
            {
                // need to set property table for all properties having KRSrcWorkflow attribute
                foreach (PropertyInfo pi in procdata.GetType().GetProperties().Where(x => x.GetCustomAttributes(false).Count(y => y.GetType().Name == typeof(KRSrcWorkflowAttribute).Name) > 0))
                {
                    MethodInfo method  = procdata.GetType().GetMethod("SetProperty");
                    MethodInfo generic = method.MakeGenericMethod(pi.PropertyType);
                    generic.Invoke(procdata, new object[] { pi.Name, pi.GetValue(procdata, null) });

                    Console.WriteLine(pi.Name);
                }

                guid = this.Proxy.Execute((ProcessorData)procdata.Clone());
            }

            return(guid);
        }
Пример #2
0
        public object GetValue(ProcessorData processor)
        {
            object value = null;
            if (this.TargetType == WFMappingTarget.TargetTypes.Property)
            {
                try
                {
                    value = this.Property.Invoke(processor, new object[0]);
                }
                catch (Exception ex)
                {
                    WFLogger.NLogger.ErrorException(String.Format("Invoke failed for property: {0} on type: {1}", this.Property.Name, processor.GetType().FullName), ex);
                }
            }
            else if (this.TargetType == WFMappingTarget.TargetTypes.Value)
                value = this.Value;

            return value;
        }
Пример #3
0
        public object GetValue(ProcessorData processor)
        {
            object value = null;

            if (this.TargetType == WFMappingTarget.TargetTypes.Property)
            {
                try
                {
                    value = this.Property.Invoke(processor, new object[0]);
                }
                catch (Exception ex)
                {
                    WFLogger.NLogger.ErrorException(String.Format("Invoke failed for property: {0} on type: {1}", this.Property.Name, processor.GetType().FullName), ex);
                }
            }
            else if (this.TargetType == WFMappingTarget.TargetTypes.Value)
            {
                value = this.Value;
            }

            return(value);
        }