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


C# IContainerAdapter.Dispose方法代码示例

本文整理汇总了C#中IContainerAdapter.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# IContainerAdapter.Dispose方法的具体用法?C# IContainerAdapter.Dispose怎么用?C# IContainerAdapter.Dispose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IContainerAdapter的用法示例。


在下文中一共展示了IContainerAdapter.Dispose方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MethodToBenchmark

 public override void MethodToBenchmark(IContainerAdapter container)
 {
     container.PrepareBasic();
     container.Resolve(typeof(IDummyOne));
     container.Resolve(typeof(ISingleton1));
     container.Dispose();
 }
开发者ID:CodeDux,项目名称:IocPerformance,代码行数:7,代码来源:12_PrepareAndRegisterAndSimpleResolve_Benchmark.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:wade,项目名称:IocPerformance,代码行数:28,代码来源:Program.cs

示例3: Warmup

 public override void Warmup(IContainerAdapter container)
 {
     container.PrepareBasic();
     this.ZeroCounters();
     container.Dispose();
 }
开发者ID:CodeDux,项目名称:IocPerformance,代码行数:6,代码来源:12_PrepareAndRegisterAndSimpleResolve_Benchmark.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: Verify

 public override void Verify(IContainerAdapter container)
 {
     container.Dispose();
 }
开发者ID:CodeDux,项目名称:IocPerformance,代码行数:4,代码来源:11_PrepareAndRegister_Benchmark.cs

示例6: MethodToBenchmark

 public override void MethodToBenchmark(IContainerAdapter container)
 {
     container.PrepareBasic();
     container.Dispose();
 }
开发者ID:CodeDux,项目名称:IocPerformance,代码行数:5,代码来源:11_PrepareAndRegister_Benchmark.cs

示例7: 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

示例8: 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


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