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


C# Project.AddNewUsingTaskFromAssemblyFile方法代码示例

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


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

示例1: Count_IncrementOnAddFile

 public void Count_IncrementOnAddFile()
 {
     Project p = new Project(new Engine());
     Assertion.AssertEquals(0, p.UsingTasks.Count);
     p.AddNewUsingTaskFromAssemblyFile("TaskName", "AssemblyFile.dll");
     Assertion.AssertEquals(0, p.UsingTasks.Count);
     object o = p.EvaluatedProperties;
     Assertion.AssertEquals(1, p.UsingTasks.Count);
 }
开发者ID:nikson,项目名称:msbuild,代码行数:9,代码来源:UsingTaskCollection_Tests.cs

示例2: SetandGetAssemblyFileName

 /// <summary>
 /// Set an assembly file name, then retrieve it. 
 /// </summary>
 private string SetandGetAssemblyFileName(string assemblyFileName)
 {
     Project p = new Project();
     p.AddNewUsingTaskFromAssemblyFile("TaskName", assemblyFileName);
     object o = p.EvaluatedItems;
     UsingTask usingTask = CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p.UsingTasks);
     return usingTask.AssemblyFile;
 }   
开发者ID:nikson,项目名称:msbuild,代码行数:11,代码来源:UsingTask_Tests.cs

示例3: GetAssemblyFileNameScalarEvaluation

 public void GetAssemblyFileNameScalarEvaluation()
 {
         string assemblyFileName = "$(fileName)";
         Project p = new Project(new Engine());
         p.SetProperty("fileName", "aFileName");
         object o = p.EvaluatedItems;
         p.AddNewUsingTaskFromAssemblyFile("TaskName", assemblyFileName);
         o = p.EvaluatedItems;
         Assertion.AssertEquals(assemblyFileName, CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p.UsingTasks).AssemblyFile);
 }
开发者ID:nikson,项目名称:msbuild,代码行数:10,代码来源:UsingTask_Tests.cs

示例4: CopyTo_OffsetIndexArrayTooSmall

 public void CopyTo_OffsetIndexArrayTooSmall()
 {
     int offSet = 3;
     Project p = new Project(new Engine());
     p.AddNewUsingTaskFromAssemblyFile("TaskName1", "AssemblyFile1.dll");
     p.AddNewUsingTaskFromAssemblyFile("TaskName2", "AssemblyFile2.dll");
     UsingTask[] usingTasks = new UsingTask[p.UsingTasks.Count];
     p.UsingTasks.CopyTo(usingTasks, offSet);
 }
开发者ID:nikson,项目名称:msbuild,代码行数:9,代码来源:UsingTaskCollection_Tests.cs

示例5: CopyTo_WeakAndGetEnumerator

 public void CopyTo_WeakAndGetEnumerator()
 {
     Project p = new Project(new Engine());
     p.AddNewUsingTaskFromAssemblyFile("TaskName1", "AssemblyFile1.dll");
     p.AddNewUsingTaskFromAssemblyFile("TaskName2", "AssemblyFile2.dll");
     Array taskArray = Array.CreateInstance(typeof(UsingTask), p.UsingTasks.Count);
     p.UsingTasks.CopyTo(taskArray, 0);
     Assertion.AssertEquals(p.UsingTasks.Count, taskArray.Length);
     int i = 0;
     foreach (UsingTask usingTask in p.UsingTasks)
     {
         Assertion.AssertEquals(((UsingTask)taskArray.GetValue(i)), usingTask.AssemblyFile);
         i++;
     }
 }
开发者ID:nikson,项目名称:msbuild,代码行数:15,代码来源:UsingTaskCollection_Tests.cs

示例6: CopyTo_ZeroIndex

 public void CopyTo_ZeroIndex()
 {
     Project p = new Project(new Engine());
     p.AddNewUsingTaskFromAssemblyFile("TaskName1", "AssemblyFile1.dll");
     p.AddNewUsingTaskFromAssemblyFile("TaskName2", "AssemblyFile2.dll");
     UsingTask[] usingTasks = new UsingTask[p.UsingTasks.Count];
     p.UsingTasks.CopyTo(usingTasks, 0);
     int i = 0;
     foreach (UsingTask usingTask in p.UsingTasks)
     {
         Assertion.AssertEquals(usingTasks[i].AssemblyFile, usingTask.AssemblyFile);
         i++;
     }
 }
开发者ID:nikson,项目名称:msbuild,代码行数:14,代码来源:UsingTaskCollection_Tests.cs

示例7: CopyTo_OffsetIndex

 public void CopyTo_OffsetIndex()
 {
     int offSet = 3;
     Project p = new Project(new Engine());
     p.AddNewUsingTaskFromAssemblyFile("TaskName1", "AssemblyFile1.dll");
     p.AddNewUsingTaskFromAssemblyFile("TaskName2", "AssemblyFile2.dll");
     UsingTask[] taskArray = new UsingTask[p.UsingTasks.Count + offSet];
     p.UsingTasks.CopyTo(taskArray, offSet);
     int i = offSet - 1;
     Assertion.AssertNull(taskArray[offSet - 1]);
     foreach (UsingTask usingTask in p.UsingTasks)
     {
         Assertion.AssertEquals(taskArray[i].AssemblyFile, usingTask.AssemblyFile);
         i++;
     }
 }
开发者ID:nikson,项目名称:msbuild,代码行数:16,代码来源:UsingTaskCollection_Tests.cs

示例8: IsSynchronized

 public void IsSynchronized() 
 {
     Project p = new Project(new Engine());
     p.AddNewUsingTaskFromAssemblyFile("TaskName", "AssemblyFile.dll");
     Assertion.AssertEquals(false, p.UsingTasks.IsSynchronized);
 }
开发者ID:nikson,项目名称:msbuild,代码行数:6,代码来源:UsingTaskCollection_Tests.cs

示例9: Count_DecrementOnRemove

 public void Count_DecrementOnRemove()
 {
     Project p = new Project(new Engine());
     p.AddNewUsingTaskFromAssemblyFile("TaskName", "AssemblyFile.dll");
     object o = p.EvaluatedProperties;
     Assertion.AssertEquals(1, p.UsingTasks.Count);
     p.LoadXml(TestData.ContentSimpleTools35);
     Assertion.AssertEquals(0, p.UsingTasks.Count);
     o = p.EvaluatedProperties;
     Assertion.AssertEquals(0, p.UsingTasks.Count);
 }
开发者ID:nikson,项目名称:msbuild,代码行数:11,代码来源:UsingTaskCollection_Tests.cs

示例10: AddNewUsingTaskFromInvalidAssemblyEvaluated

 public void AddNewUsingTaskFromInvalidAssemblyEvaluated()
 {
     Project p = new Project(new Engine());
     p.AddNewUsingTaskFromAssemblyFile("taskName", @"invalid|.dll");
     object o = p.EvaluatedItems; // force evaluation of imported projects.
 }
开发者ID:nikson,项目名称:msbuild,代码行数:6,代码来源:Project_Tests.cs

示例11: AddNewUsingTaskFromInvalidAssemblyNotEvaluated

 public void AddNewUsingTaskFromInvalidAssemblyNotEvaluated()
 {
     Project p = new Project(new Engine());
     p.AddNewUsingTaskFromAssemblyFile("taskName", @"invalid|.dll");
     Assertion.Assert("no exception", true);
 }
开发者ID:nikson,项目名称:msbuild,代码行数:6,代码来源:Project_Tests.cs

示例12: AddNewUsingTaskFromAssemblyFileUsingTasksCollectionGet

 public void AddNewUsingTaskFromAssemblyFileUsingTasksCollectionGet()
 {
     Project p = new Project(new Engine());
     p.AddNewUsingTaskFromAssemblyFile("UsingTaskName", @"c:\assembly.dll");
     object o = p.EvaluatedItems; // force evaluation of imported projects.
     Assertion.AssertEquals(true, p.IsDirty);
     XmlNodeList nl = CompatibilityTestHelpers.GetNodesWithName(p.Xml, "UsingTask");
     Assertion.AssertEquals(1, nl.Count);
     Assertion.AssertEquals("UsingTaskName", nl[0].Attributes["TaskName"].Value);
     Assertion.AssertEquals(@"c:\assembly.dll", nl[0].Attributes["AssemblyFile"].Value);
     Assertion.AssertEquals(2, nl[0].Attributes.Count); // no condition;
 }
开发者ID:nikson,项目名称:msbuild,代码行数:12,代码来源:Project_Tests.cs


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