本文整理汇总了C#中MonoDevelop.Projects.MSBuild.MSBuildProject.GetAllObjects方法的典型用法代码示例。如果您正苦于以下问题:C# MSBuildProject.GetAllObjects方法的具体用法?C# MSBuildProject.GetAllObjects怎么用?C# MSBuildProject.GetAllObjects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MonoDevelop.Projects.MSBuild.MSBuildProject
的用法示例。
在下文中一共展示了MSBuildProject.GetAllObjects方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetInsertBeforeObject
static MSBuildObject GetInsertBeforeObject (MSBuildProject project, ImportLocation importLocation)
{
if (importLocation == ImportLocation.Top) {
return project.GetAllObjects ().FirstOrDefault ();
}
// Return an unknown MSBuildItem instead of null so the MSBuildProject adds the import as the last
// child in the project.
return new MSBuildItem ();
}
示例2: AddPackagingPropsImport
void AddPackagingPropsImport (MSBuildProject msproject)
{
MSBuildObject insertBefore = msproject.GetAllObjects ().FirstOrDefault ();
msproject.AddNewImport (
@"$(NuGetAuthoringPath)\NuGet.Packaging.Authoring.props",
@"Exists('$(NuGetAuthoringPath)\NuGet.Packaging.Authoring.props')",
insertBefore);
}
示例3: StartWhitespaceForImportInsertedAsFirstChild
public void StartWhitespaceForImportInsertedAsFirstChild ()
{
string projectFile = Util.GetSampleProject ("ConsoleApp-VS2013", "ConsoleApplication.csproj");
var p = new MSBuildProject ();
p.Load (projectFile);
p.Evaluate ();
var firstChild = p.GetAllObjects ().First ();
MSBuildImport import = p.AddNewImport ("MyImport.targets", beforeObject: firstChild);
Assert.AreEqual (p.TextFormat.NewLine, p.StartWhitespace);
Assert.AreEqual (" ", import.StartWhitespace);
}