本文整理汇总了C#中StructureMap.Graph.PluginGraph.Profile方法的典型用法代码示例。如果您正苦于以下问题:C# PluginGraph.Profile方法的具体用法?C# PluginGraph.Profile怎么用?C# PluginGraph.Profile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StructureMap.Graph.PluginGraph
的用法示例。
在下文中一共展示了PluginGraph.Profile方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RootPipelineGraph
public RootPipelineGraph(PluginGraph pluginGraph)
{
_pluginGraph = pluginGraph;
_transientCache = new NulloTransientCache();
_profiles =
new Cache<string, IPipelineGraph>(
name => new ComplexPipelineGraph(this, _pluginGraph.Profile(name), new NulloTransientCache()));
}
示例2: Profiles
public Profiles(PluginGraph pluginGraph, IPipelineGraph root)
{
_profiles = new Cache<string, IPipelineGraph>(name => {
var profileGraph = pluginGraph.Profile(name);
var instances = new ComplexInstanceGraph(root, profileGraph, ContainerRole.ProfileOrChild);
return new PipelineGraph(profileGraph, instances, root, root.Singletons, root.Transients);
});
}
示例3: lifecycle_for_pluginType_explicitly_set
public void lifecycle_for_pluginType_explicitly_set()
{
var graph = new PluginGraph();
var profile = graph.Profile("Red");
profile.Families[typeof(IGateway)].SetLifecycleTo<SingletonLifecycle>();
var pipeline = PipelineGraph.BuildRoot(graph).Profiles.For("Red");
pipeline.Instances.DefaultLifecycleFor(typeof (IGateway))
.ShouldBeOfType<SingletonLifecycle>();
}
示例4: get_the_owner_when_part_of_a_profile
public void get_the_owner_when_part_of_a_profile()
{
var graph = new PluginGraph();
var profile = graph.Profile("something");
var family = profile.Families[GetType()];
var instance = new SimpleInstance();
family.AddInstance(instance);
instance.Owner().ShouldBeTheSameAs(graph);
}