当前位置: 首页>>代码示例>>C#>>正文


C# Graph.PluginGraph类代码示例

本文整理汇总了C#中StructureMap.Graph.PluginGraph的典型用法代码示例。如果您正苦于以下问题:C# PluginGraph类的具体用法?C# PluginGraph怎么用?C# PluginGraph使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PluginGraph类属于StructureMap.Graph命名空间,在下文中一共展示了PluginGraph类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: validateInstance

 private void validateInstance(IDiagnosticInstance instance, PluginFamily family, PluginGraph graph)
 {
     if (!instance.CanBePartOfPluginFamily(family))
     {
         graph.Log.RegisterError(104, instance.CreateToken(), family.PluginType);
     }
 }
开发者ID:satish860,项目名称:StructureMap3,代码行数:7,代码来源:ValidatePluggabilityPolicy.cs

示例2: GraphBuilder

        public GraphBuilder(PluginGraph pluginGraph)
        {
            _pluginGraph = pluginGraph;
            _assemblyScanner = new AssemblyScanner();

            _instanceReader = new XmlInstanceReader(_pluginGraph.Log, new Registry());
        }
开发者ID:satish860,项目名称:StructureMap3,代码行数:7,代码来源:GraphBuilder.cs

示例3: PluginGraphBuilder

 public PluginGraphBuilder(ConfigurationParser[] parsers, Registry[] registries, GraphLog log)
 {
     _parsers = parsers;
     _registries = registries;
     _graph = new PluginGraph();
     _graph.Log = log;
 }
开发者ID:hp4711,项目名称:structuremap,代码行数:7,代码来源:PluginGraphBuilder.cs

示例4: transient_cache_of_nested_pipeline_graph_is_a_stateful_cache

        public void transient_cache_of_nested_pipeline_graph_is_a_stateful_cache()
        {
            var plugins = new PluginGraph();

            var pipeline = PipelineGraph.BuildRoot(plugins);
            pipeline.ToNestedGraph().Transients.ShouldBeOfType<LifecycleObjectCache>();
        }
开发者ID:goraw,项目名称:structuremap,代码行数:7,代码来源:RootInstanceGraphTester.cs

示例5: Read_in_a_class_with_primitive_arrays

        public void Read_in_a_class_with_primitive_arrays()
        {
            string xml = @"
<Instance>
    <numbers Values='1,2,3'/>
    <strings Values='1,2,3'/>
</Instance>
";

            XmlElement element = DataMother.BuildDocument(xml).DocumentElement;
            element.SetAttribute("PluggedType", typeof (ClassWithStringAndIntArray).AssemblyQualifiedName);

            var memento = new XmlAttributeInstanceMemento(element);
            var graph = new PluginGraph();
            Instance instance = memento.ReadInstance(typeof (ClassWithStringAndIntArray));

            Assert.Fail("NWO");

//            var theObject = (ClassWithStringAndIntArray) instance.Build(typeof (ClassWithStringAndIntArray),
//                                                                        BuildSession.ForPluginGraph(graph));
//
//            theObject.Numbers.ShouldEqual(new[] {1, 2, 3});
//            theObject.Strings.ShouldEqual(new[] {"1", "2", "3"});
//
//            Debug.WriteLine(theObject.GetType().AssemblyQualifiedName);
        }
开发者ID:slahn,项目名称:structuremap,代码行数:26,代码来源:DictionaryAndArrayArgumentTester.cs

示例6: Apply

        public void Apply(PluginGraph graph)
        {
            var registry = new Registry();

            _interfaces.Each(@interface =>
            {
                var expression = registry.For(@interface);
                ConfigureFamily(expression);

                var exactMatches = _concretions.Where(x => x.CanBeCastTo(@interface)).ToArray();
                if (exactMatches.Length == 1)
                {
                    expression.Use(exactMatches.Single());
                }
                else
                {
                    exactMatches.Each(type => expression.Add(type));
                }


                if ([email protected]())
                {
                    addConcretionsThatCouldBeClosed(@interface, expression);
                }
            });

            _concretions.Each(t => graph.ConnectedConcretions.Fill(t));
            registry.As<IPluginGraphConfiguration>().Configure(graph);
        }
开发者ID:goraw,项目名称:structuremap,代码行数:29,代码来源:GenericConnectionScanner.cs

示例7: Process

            public void Process(Type type, PluginGraph graph)
            {
                if (!IsConcrete(type)) return;

                if (type.Name.EndsWith("Actor") && type.Implements<AsyncHttpActor>())
                    graph.AddType(typeof(AsyncHttpActor), type);
            }
开发者ID:phatboyg,项目名称:Tosca,代码行数:7,代码来源:ActorBootstrapper.cs

示例8: build_root_for_tracked_transients

        public void build_root_for_tracked_transients()
        {
            var pluginGraph = new PluginGraph { TransientTracking = TransientTracking.ExplicitReleaseMode };
            var graph = PipelineGraph.BuildRoot(pluginGraph);

            graph.Transients.ShouldBeOfType<TrackingTransientCache>();
        }
开发者ID:deatharthas,项目名称:structuremap,代码行数:7,代码来源:PipelineGraph_construction_specs.cs

示例9: NewChild

        public IPipelineGraph NewChild()
        {
            var childGraph = new PluginGraph();
            var instances = new ComplexInstanceGraph(_root, childGraph, ContainerRole.ProfileOrChild);

            return new PipelineGraph(childGraph, instances, _root, _root.Singletons, _root.Transients);
        }
开发者ID:e-tobi,项目名称:structuremap,代码行数:7,代码来源:Profiles.cs

示例10: Seal_does_not_throw_an_exception_if_there_are_no_errors

        public void Seal_does_not_throw_an_exception_if_there_are_no_errors()
        {
            var graph = new PluginGraph();
            Assert.AreEqual(0, graph.Log.ErrorCount);

            graph.Seal();
        }
开发者ID:satish860,项目名称:StructureMap3,代码行数:7,代码来源:PluginGraphTester.cs

示例11: ThrowIfMarkerInterfaceIsRegistered

 private static void ThrowIfMarkerInterfaceIsRegistered(PluginGraph graph)
 {
     if (graph.HasFamily<IMarkerInterface>())
     {
         throw new InvalidOperationException("Populate should only be called once per container.");
     }
 }
开发者ID:structuremap,项目名称:StructureMap.Microsoft.DependencyInjection,代码行数:7,代码来源:ContainerExtensions.cs

示例12: AssertErrors_throws_StructureMapConfigurationException_if_there_is_an_error

        public void AssertErrors_throws_StructureMapConfigurationException_if_there_is_an_error()
        {
            var graph = new PluginGraph();
            graph.Log.RegisterError(400, new ApplicationException("Bad!"));

            graph.Log.AssertFailures();
        }
开发者ID:hp4711,项目名称:structuremap,代码行数:7,代码来源:PluginGraphTester.cs

示例13: addCloseGenericPolicyTo

        private void addCloseGenericPolicyTo(PluginGraph graph)
        {
            var policy = new CloseGenericFamilyPolicy(graph);
            graph.AddFamilyPolicy(policy);

            graph.Profiles.Each(addCloseGenericPolicyTo);
        }
开发者ID:smerrell,项目名称:structuremap,代码行数:7,代码来源:PluginGraphBuilder.cs

示例14: PluginFamily

    public PluginFamily(Type pluginType, PluginGraph parent)
    {
        _parent = parent;
            _pluginType = pluginType;

            PluginFamilyAttribute.ConfigureFamily(this);
    }
开发者ID:joshuaflanagan,项目名称:structuremap,代码行数:7,代码来源:PluginFamily.cs

示例15: build_root_for_default_tracking_style

        public void build_root_for_default_tracking_style()
        {
            var pluginGraph = new PluginGraph {TransientTracking = TransientTracking.DefaultNotTrackedAtRoot};
            var graph = PipelineGraph.BuildRoot(pluginGraph);

            graph.Transients.ShouldBeOfType<NulloTransientCache>();
        }
开发者ID:deatharthas,项目名称:structuremap,代码行数:7,代码来源:PipelineGraph_construction_specs.cs


注:本文中的StructureMap.Graph.PluginGraph类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。