예제 #1
0
        protected override object build(Type pluginType, BuildSession session)
        {
            // Find the first InstanceCase that matches the BuildSession/IContext
            InstanceCase instanceCase = _cases.Find(c => c.Predicate(session));

            // Use the Instance from the InstanceCase if it exists,
            // otherwise, use the "default"
            Instance instance = instanceCase == null ? _default : instanceCase.Instance;

            // delegate to the chosen Instance
            return(instance.Build(pluginType, session));
        }
예제 #2
0
 public object ConstructNew(Type pluginType, Instance instance, BuildSession session)
 {
     object returnValue = instance.Build(pluginType, session);
     return ApplyInterception(pluginType, returnValue, session, instance);
 }
예제 #3
0
        public object ConstructNew(Type pluginType, Instance instance, BuildSession session)
        {
            object returnValue = instance.Build(pluginType, session);

            return(ApplyInterception(pluginType, returnValue, session, instance));
        }