Пример #1
0
        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);
        }
Пример #2
0
        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);
        }