當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。