Ejemplo n.º 1
0
 public ConditionAttribute()
 {
     action = new ActionEntity();
     action.AssemblyName = "Application";
     action.ClassName    = "AuthUtil";
     action.MethodName   = "GetCurrentUserSite";
 }
Ejemplo n.º 2
0
        public ConditionFiller <TSource> FillConditionsValue()
        {
            List <ConditionPropery> conditionsProps = _builder.Get();

            foreach (var condProp in conditionsProps)
            {
                object       value  = new object();
                ActionEntity action = condProp.action;
                try
                {
                    var  executingPath = ConfigHelper.GetExecutingDirectory();
                    var  assemblyTypes = Assembly.Load(action.AssemblyName).GetTypes();
                    Type outerClass    = assemblyTypes
                                         .Single(t => !t.IsInterface && t.Name == action.ClassName);
                    object     instance = Activator.CreateInstance(outerClass, action.MethodParams.ConstructorParameters);
                    MethodInfo mi       = outerClass.GetMethod(action.MethodName);
                    value = mi.Invoke(instance, action.MethodParams.MethodParameters);
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                string name = condProp.Key.PropertyName;
                _builder.AddConditionValue(name, value);
            }

            return(this);
        }
Ejemplo n.º 3
0
 public ConditionPropery()
 {
     Key    = new PropertyKey();
     action = new ActionEntity();
 }