本文整理汇总了C#中IContainerAdapter.Prepare方法的典型用法代码示例。如果您正苦于以下问题:C# IContainerAdapter.Prepare方法的具体用法?C# IContainerAdapter.Prepare怎么用?C# IContainerAdapter.Prepare使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IContainerAdapter
的用法示例。
在下文中一共展示了IContainerAdapter.Prepare方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Result
public Result(IContainerAdapter containerAdapter, string name, string version)
{
Name = name;
Version = version;
_containerAdapter = containerAdapter;
containerAdapter.Prepare();
}
示例2: MeasurePerformance
private static void MeasurePerformance(string name, IContainerAdapter container)
{
CollectMemory();
container.Prepare();
WarmUp(container);
long singletonTime = MeasureSingleton(container);
long transientTime = MeasureTransient(container);
long combinedTime = MeasureCombined(container);
Console.WriteLine(string.Format(
"{0}\t{1}\t\t{2}\t\t{3}\t\t{4}\t\t\t{5}\t\t\t\t{6}",
name + " ".Substring(name.Length - 1),
singletonTime,
transientTime,
combinedTime,
Singleton.Instances,
Transient.Instances,
Combined.Instances));
Singleton.Instances = 0;
Transient.Instances = 0;
Combined.Instances = 0;
container.Dispose();
}
示例3: MeasurePerformance
private static Result MeasurePerformance(string name, IContainerAdapter container)
{
CollectMemory();
container.Prepare();
WarmUp(container);
var timings = MeasurePerformance(container);
var result = new Result();
result.Name = name;
result.Version = container.Version;
result.SingletonTime = timings.Item1;
result.TransientTime = timings.Item2;
result.CombinedTime = timings.Item3;
if (container.SupportsInterception)
{
result.InterceptionTime = MeasureProxy(container);
}
result.SingletonInstances = Singleton.Instances;
result.TransientInstances = Transient.Instances;
result.CombinedInstances = Combined.Instances;
result.InterceptionInstances = Calculator.Instances;
Singleton.Instances = 0;
Transient.Instances = 0;
Combined.Instances = 0;
Calculator.Instances = 0;
container.Dispose();
return result;
}
示例4: MeasurePerformance
private static Result MeasurePerformance(string name, IContainerAdapter container)
{
ClearInstanceProperties();
CollectMemory();
container.Prepare();
WarmUp(container);
var result = new Result();
result.Name = name;
result.Version = container.Version;
MeasureResolvePerformance(container, result);
if (container.SupportsInterception)
{
result.InterceptionTime = MeasureProxy(container);
}
CheckInstanceProperties(container);
container.Dispose();
return result;
}
示例5: MeasurePerformance
private static Result MeasurePerformance(IContainerAdapter container)
{
ClearInstanceProperties();
CollectMemory();
container.Prepare();
WarmUp(container);
var result = new Result();
result.Name = container.Name;
result.Url = container.Url;
result.Version = container.Version;
MeasureResolvePerformance(container, result);
CheckInstanceProperties(container);
container.Dispose();
return result;
}
示例6: MeasurePerformance
private static Result MeasurePerformance(string name, IContainerAdapter container)
{
CollectMemory();
container.Prepare();
WarmUp(container);
var result = new Result( container, name, container.Version);
Singleton.Instances = 0;
Transient.Instances = 0;
Combined.Instances = 0;
Calculator.Instances = 0;
//container.Dispose();
return result;
}