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