本文整理汇总了C#中MonoDevelop.Projects.MSBuild.MSBuildEvaluationContext.EvaluateParameters方法的典型用法代码示例。如果您正苦于以下问题:C# MSBuildEvaluationContext.EvaluateParameters方法的具体用法?C# MSBuildEvaluationContext.EvaluateParameters怎么用?C# MSBuildEvaluationContext.EvaluateParameters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MonoDevelop.Projects.MSBuild.MSBuildEvaluationContext
的用法示例。
在下文中一共展示了MSBuildEvaluationContext.EvaluateParameters方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseTransformExpression
static bool ParseTransformExpression (MSBuildEvaluationContext context, string include, out string itemName, out string expression, out string itemFunction, out object [] itemFunctionArgs)
{
// This method parses the transforms and extracts: the name of the item list to transform, the whole transform expression (or null if there isn't). If the expression can be
// parsed as an item funciton, then it returns the function name and the list of arguments. Otherwise those parameters are null.
expression = null;
itemFunction = null;
itemFunctionArgs = null;
int i = include.IndexOf ("->", StringComparison.Ordinal);
if (i == -1) {
itemName = include.Trim ();
return itemName.Length > 0;
}
itemName = include.Substring (0, i).Trim ();
if (itemName.Length == 0)
return false;
expression = include.Substring (i + 2).Trim ();
if (expression.Length > 1 && expression[0]=='\'' && expression[expression.Length - 1] == '\'') {
expression = expression.Substring (1, expression.Length - 2);
return true;
}
i = expression.IndexOf ('(');
if (i == -1)
return true;
var func = expression.Substring (0, i).Trim ();
if (knownItemFunctions.Contains (func)) {
itemFunction = func;
i++;
context.EvaluateParameters (expression, ref i, out itemFunctionArgs);
return true;
}
return true;
}