コード例 #1
0
        public GraphBuilder(PluginGraph pluginGraph)
        {
            _pluginGraph = pluginGraph;
            _assemblyScanner = new AssemblyScanner();

            _instanceReader = new XmlInstanceReader(_pluginGraph.Log, new Registry());
        }
コード例 #2
0
        public override Instance ReadChildInstance(string name, XmlInstanceReader graph, Type childType)
        {
            ITypeReader reader = TypeReaderFactory.GetReader(childType);
            if (reader == null)
            {
                return base.ReadChildInstance(name, graph, childType);
            }

            XmlElement element = _element[name];
            return element == null ? null : reader.Read(element, childType);
        }
コード例 #3
0
 public InstanceMementoPropertyReader(ConstructorInstance instance, InstanceMemento memento, XmlInstanceReader reader)
 {
     _instance = instance;
     _memento = memento;
     _reader = reader;
 }
コード例 #4
0
        protected virtual Instance readInstance(XmlInstanceReader reader, Type pluginType)
        {
            if (IsDefault)
            {
                return new DefaultInstance();
            }

            if (IsReference)
            {
                return new ReferencedInstance(ReferenceKey);
            }

            throw new NotImplementedException("build out with XmlInstanceReader");

            //return new ConfiguredInstance(this, reader, pluginType);
        }
コード例 #5
0
        public Instance ReadInstance(XmlInstanceReader reader, Type pluginType)
        {
            try
            {
                Instance instance = readInstance(reader, pluginType);
                instance.Name = InstanceKey;

                return instance;
            }
            catch (StructureMapException)
            {
                throw;
            }
            catch (Exception e)
            {
                throw new StructureMapException(260, e, InstanceKey, pluginType.FullName);
            }
        }
コード例 #6
0
 public virtual Instance ReadChildInstance(string name, XmlInstanceReader graph, Type childType)
 {
     InstanceMemento child = GetChildMemento(name);
     return child == null ? null : child.ReadInstance(graph, childType);
 }