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


C# ModuleWeaver.AfterWeaving方法代码示例

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


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

示例1: TaskTests

    public TaskTests()
    {
        beforeAssemblyPath = Path.GetFullPath(@"..\..\..\AssemblyToProcess\bin\Debug\AssemblyToProcess.dll");
#if (!DEBUG)
        beforeAssemblyPath = beforeAssemblyPath.Replace("Debug", "Release");
#endif

        afterAssemblyPath = beforeAssemblyPath.Replace(".dll", "2.dll");
        File.Copy(beforeAssemblyPath, afterAssemblyPath, true);

        var moduleDefinition = ModuleDefinition.ReadModule(afterAssemblyPath);
        var currentDirectory = AssemblyLocation.CurrentDirectory();
        var weavingTask = new ModuleWeaver
                          {
                              ModuleDefinition = moduleDefinition,
                              AddinDirectoryPath = currentDirectory,
                              SolutionDirectoryPath = currentDirectory,
                              AssemblyFilePath = afterAssemblyPath,
                              SvnHelper = new MockSvnHelper(),
                          };

        weavingTask.Execute();
        moduleDefinition.Write(afterAssemblyPath);
        weavingTask.AfterWeaving();

        assembly = Assembly.LoadFile(afterAssemblyPath);
    }
开发者ID:krk,项目名称:Stamp,代码行数:27,代码来源:TaskTests.cs

示例2: ExistingTests

    public ExistingTests()
    {
        beforeAssemblyPath = Path.GetFullPath(Path.Combine(TestContext.CurrentContext.TestDirectory, @"..\..\..\AssemblyToProcessExistingAttribute\bin\Debug\AssemblyToProcessExistingAttribute.dll"));
#if (!DEBUG)
        beforeAssemblyPath = beforeAssemblyPath.Replace("Debug", "Release");
#endif

        afterAssemblyPath = beforeAssemblyPath.Replace(".dll", "2.dll");
        File.Copy(beforeAssemblyPath, afterAssemblyPath, true);

        var moduleDefinition = ModuleDefinition.ReadModule(afterAssemblyPath);
        var currentDirectory = AssemblyLocation.CurrentDirectory();
        var moduleWeaver = new ModuleWeaver
                           {
                               ModuleDefinition = moduleDefinition,
                               AddinDirectoryPath = currentDirectory,
                               SolutionDirectoryPath = currentDirectory,
                               AssemblyFilePath = afterAssemblyPath,
                           };

        moduleWeaver.Execute();
        moduleDefinition.Write(afterAssemblyPath);
        moduleWeaver.AfterWeaving();

        assembly = Assembly.LoadFile(afterAssemblyPath);
    }
开发者ID:Fody,项目名称:Stamp,代码行数:26,代码来源:ExistingTests.cs

示例3: ProcessAssemblyBaseTest

        protected ProcessAssemblyBaseTest( string relativePath )
        {
            BeforeAssemblyPath = Path.GetFullPath( relativePath );
            #if !DEBUG
            BeforeAssemblyPath = BeforeAssemblyPath.Replace("Debug", "Release");
            #endif

            AfterAssemblyPath = BeforeAssemblyPath.Replace( ".dll", "2.dll" );
            File.Copy( BeforeAssemblyPath, AfterAssemblyPath, true );

            var moduleDefinition = ModuleDefinition.ReadModule( AfterAssemblyPath );

            var currentDirectory = AssemblyLocation.CurrentDirectory();
            PersistentInfo = PersistentInfo.LoadFromPath( currentDirectory );
            StandardInfo = new StandardInfo( PersistentInfo, moduleDefinition );

            var moduleWeaver = new ModuleWeaver
            {
                ModuleDefinition = moduleDefinition,
                AddinDirectoryPath = currentDirectory,
                SolutionDirectoryPath = currentDirectory,
                AssemblyFilePath = AfterAssemblyPath,
            };

            moduleWeaver.Execute();
            moduleDefinition.Write( AfterAssemblyPath );
            moduleWeaver.AfterWeaving();

            AfterAssembly = Assembly.LoadFile( AfterAssemblyPath );
        }
开发者ID:ismailfatih,项目名称:CK-Stamp,代码行数:30,代码来源:ProcessAssemblyBaseTest.cs


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