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


C# Configuration.BuildAssemblers方法代码示例

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


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

示例1: CodeGen

 public void CodeGen()
 {
     Configuration cfg = new Configuration();
     cfg.AddAssemblyResources(Assembly.GetAssembly(typeof(DerivedXmlUserDTO)), "otis.xml");
     cfg.GenerationOptions.OutputType = OutputType.SourceCode;
     cfg.GenerationOptions.OutputFile = "nixonAssembler.cs";
     cfg.BuildAssemblers();
 }
开发者ID:varunkumarmnnit,项目名称:otis-lib,代码行数:8,代码来源:InheritanceMappingTests.cs

示例2: Recognize_External_Assemblies_For_Base_Class

        public void Recognize_External_Assemblies_For_Base_Class()
        {
            Configuration cfg = new Configuration();
            //cfg.AddAssemblyReference("nunit.core.dll");	not needed, but can be done
            //cfg.AddAssemblyReference("nunit.framework.dll");

            cfg.AddType<ExternalDependency>();
            cfg.BuildAssemblers();
        }
开发者ID:varunkumarmnnit,项目名称:otis-lib,代码行数:9,代码来源:ExternalAssemblyTest.cs

示例3: Recognize_External_Assemblies_For_Implemented_Interfaces

 public void Recognize_External_Assemblies_For_Implemented_Interfaces()
 {
     Configuration cfg = new Configuration();
     cfg.AddType<ExternalDependency2>();
     cfg.BuildAssemblers();
 }
开发者ID:varunkumarmnnit,项目名称:otis-lib,代码行数:6,代码来源:ExternalAssemblyTest.cs

示例4: Setup

        public void Setup()
        {
            Configuration cfg;
            cfg = new Configuration();
            cfg.AddType<UserDTO>();
            cfg.AddType<ProjectDTO>(); // todo: should this be automatically detected
            cfg.AddType<DocumentDTO>(); // todo: should this be automatically detected
            cfg.AddType<TaskDTO>(); // todo: should this be automatically detected

            cfg.BuildAssemblers();

            m_assembler = cfg.GetAssembler<UserDTO, User>();

            m_user = Helpers.CreateComplexUser();
        }
开发者ID:varunkumarmnnit,项目名称:otis-lib,代码行数:15,代码来源:EntityMappingTest.cs

示例5: Compilation_Fails_With_Invalid_Mapping_Expression

 public void Compilation_Fails_With_Invalid_Mapping_Expression()
 {
     Configuration cfg = new Configuration();
     cfg.AddType<InvalidDTO>();
     cfg.BuildAssemblers();
 }
开发者ID:varunkumarmnnit,项目名称:otis-lib,代码行数:6,代码来源:AssemblyGenerationTests.cs

示例6: GenerateOtisMapping

        //private static void Test001()
        //{
        //    CLIS2015U04GetProtocolItemArgs args = new CLIS2015U04GetProtocolItemArgs();
        //    CLIS2015U04GetProtocolItemResult result = CloudService.Instance.Submit<CLIS2015U04GetProtocolItemResult, CLIS2015U04GetProtocolItemArgs>(args);
        //}
        //private static void Test002()
        //{
        //    List<CloudConnector.Contracts.Models.Bass.BAS0212U00GrdItemInfo> inputList = new List<CloudConnector.Contracts.Models.Bass.BAS0212U00GrdItemInfo>();
        //    BAS0212U00TransactionalArgs args = new BAS0212U00TransactionalArgs(inputList, "1");
        //    UpdateResult result = CloudService.Instance.Submit<UpdateResult, BAS0212U00TransactionalArgs>(args);
        //}
        private static void GenerateOtisMapping()
        {
            Configuration _cfg = new Configuration();

            _cfg.GenerationOptions.Namespace = "IHIS.CloudConnector";
            _cfg.GenerationOptions.OutputFile = Application.StartupPath + "..\\..\\..\\Mappings\\Assembler.cs";
            _cfg.GenerationOptions.OutputType = OutputType.SourceCode;
            _cfg.GenerationOptions.MOneFilePerClass = true;
            _cfg.AddAssemblyResources(Assembly.GetExecutingAssembly(), "otis.xml");

            _cfg.BuildAssemblers();
        }
开发者ID:anhlai,项目名称:SQLite,代码行数:23,代码来源:Program.cs

示例7: ComparePerformance

        //[Test]
        public void ComparePerformance()
        {
            User user = Helpers.CreateComplexUser();

            // add more tasks
            user.Projects[0].Tasks.Add(new Task(5));
            user.Projects[0].Tasks.Add(new Task(4));
            user.Projects[0].Tasks.Add(new Task(2));
            user.Projects[0].Tasks.Add(new Task(6));
            user.Projects[0].Tasks.Add(new Task(4));
            user.Projects[0].Tasks.Add(new Task(2));

            user.Projects[1].Tasks.Add(new Task(3));
            user.Projects[1].Tasks.Add(new Task(4));
            user.Projects[1].Tasks.Add(new Task(5));
            user.Projects[1].Tasks.Add(new Task(1));
            user.Projects[1].Tasks.Add(new Task(4));

            user.Projects[0].Tasks.Add(new Task(5));
            user.Projects[0].Tasks.Add(new Task(4));
            user.Projects[0].Tasks.Add(new Task(2));
            user.Projects[0].Tasks.Add(new Task(6));
            user.Projects[0].Tasks.Add(new Task(4));
            user.Projects[0].Tasks.Add(new Task(2));

            user.Projects[1].Tasks.Add(new Task(3));
            user.Projects[1].Tasks.Add(new Task(4));
            user.Projects[1].Tasks.Add(new Task(5));
            user.Projects[1].Tasks.Add(new Task(1));
            user.Projects[1].Tasks.Add(new Task(4));

            UserDTO dto = new UserDTO();

            Configuration cfg;
            cfg = new Configuration();
            cfg.AddType(typeof(UserDTO));
            cfg.AddType(typeof(ProjectDTO)); // todo: should this be automatically detected
            cfg.AddType(typeof(DocumentDTO)); // todo: should this be automatically detected
            cfg.AddType(typeof(TaskDTO)); // todo: should this be automatically detected

            cfg.BuildAssemblers();
            IAssembler<UserDTO, User> assembler = cfg.GetAssembler<UserDTO, User>();

            assembler.Assemble(ref dto, ref user); // run it once

            long time = Environment.TickCount;
            for(int i = 0; i < ITER_COUNT; i++)
            {
                assembler.Assemble(ref dto, ref user);
            }
            long time1 = Environment.TickCount - time;
            Console.Out.WriteLine("Generated assembler timing = {0}", time1);

            Assemble(dto, user); // run it once
            time = Environment.TickCount;
            for (int i = 0; i < ITER_COUNT; i++)
            {
                Assemble(dto, user);
            }
            long time2 = Environment.TickCount - time;
            Console.Out.WriteLine("Manual assembler timing = {0}", time2);
            Console.Out.WriteLine("Ratio = {0}", time1/(double)time2);
        }
开发者ID:varunkumarmnnit,项目名称:otis-lib,代码行数:64,代码来源:PerformanceTest.cs


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