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


C# IContainerAdapter.Prepare方法代码示例

本文整理汇总了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();
 }
开发者ID:stevehebert,项目名称:IocPerformance,代码行数:7,代码来源:Result.cs

示例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();
        }
开发者ID:mdeangelo272,项目名称:IocPerformance,代码行数:28,代码来源:Program.cs

示例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;
        }
开发者ID:junxy,项目名称:IocPerformance,代码行数:36,代码来源:Program.cs

示例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;
        }
开发者ID:vvs0205,项目名称:IocPerformance,代码行数:27,代码来源:Program.cs

示例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;
        }
开发者ID:Bartizan,项目名称:IocPerformance,代码行数:23,代码来源:Program.cs

示例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;
        }
开发者ID:stevehebert,项目名称:IocPerformance,代码行数:19,代码来源:Program.cs


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