本文整理汇总了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);
}
示例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);
}
示例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 );
}