本文整理匯總了C#中MonoDevelop.Projects.MSBuild.MSBuildEvaluationContext.EvaluateMember方法的典型用法代碼示例。如果您正苦於以下問題:C# MSBuildEvaluationContext.EvaluateMember方法的具體用法?C# MSBuildEvaluationContext.EvaluateMember怎麽用?C# MSBuildEvaluationContext.EvaluateMember使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MonoDevelop.Projects.MSBuild.MSBuildEvaluationContext
的用法示例。
在下文中一共展示了MSBuildEvaluationContext.EvaluateMember方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ExecuteTransformIncludeItemFunction
static bool ExecuteTransformIncludeItemFunction (MSBuildEvaluationContext context, MSBuildItemEvaluated item, string itemFunction, object [] itemFunctionArgs, out string evaluatedInclude, out bool skip)
{
evaluatedInclude = null;
skip = false;
switch (itemFunction) {
case "DirectoryName":
var path = MSBuildProjectService.FromMSBuildPath (context.Project.BaseDirectory, item.Include);
evaluatedInclude = Path.GetDirectoryName (path);
return true;
case "Metadata":
if (itemFunctionArgs.Length != 1)
return false;
var p = item.Metadata.GetProperty (itemFunctionArgs [0].ToString ());
if (p == null) {
skip = true;
return true;
} else {
evaluatedInclude = p.Value;
return true;
}
}
if (knownStringItemFunctions.Contains (itemFunction)) {
object res;
if (context.EvaluateMember (itemFunction, typeof (string), itemFunction, item.Include, itemFunctionArgs, out res)) {
evaluatedInclude = res.ToString ();
return true;
}
}
return false;
}