public static ProcessorContext CreateFrom(BaseProcessor processor) { ProcessorContext cxt = new ProcessorContext(); cxt.Enable = processor.Enable; cxt.TypeName = processor.GetType().FullName; cxt.AssemblyName = processor.GetType().Assembly.FullName; cxt.Params = PropertyParamContext.Find(processor); return(cxt); }
public static PropertyParamContext CreateFrom(Object obj, PropertyInfo pi) { PropertyParamContext cxt = new PropertyParamContext(); cxt.PropertyName = pi.Name; cxt.PropertyTypeName = pi.PropertyType.FullName; Object o = pi.GetValue(obj, null); if (o != null) { cxt.PropertyValueString = pi.GetValue(obj, null).ToString(); } return(cxt); }