本文整理汇总了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);
}
示例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;
}
示例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);
}
示例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);
}
示例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++;
}
}
示例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++;
}
}
示例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++;
}
}
示例8: IsSynchronized
public void IsSynchronized()
{
Project p = new Project(new Engine());
p.AddNewUsingTaskFromAssemblyFile("TaskName", "AssemblyFile.dll");
Assertion.AssertEquals(false, p.UsingTasks.IsSynchronized);
}
示例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);
}
示例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.
}
示例11: AddNewUsingTaskFromInvalidAssemblyNotEvaluated
public void AddNewUsingTaskFromInvalidAssemblyNotEvaluated()
{
Project p = new Project(new Engine());
p.AddNewUsingTaskFromAssemblyFile("taskName", @"invalid|.dll");
Assertion.Assert("no exception", true);
}
示例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;
}