This is what I did for my custom macro
public static string ResolveCustomMacro(MacroResolver sender, string expression, out bool match)
{
match = false;
string result = "";
// Add your custom macro evaluation
//If the macro uses parameters...
if (sender.CurrentParameters.Length > 0)
{
//Add all the parsed parameters and values to a collection to make them easier to access
Dictionary<string, string> parameters = new Dictionary<string, string>();
for (int index = 0; index < sender.CurrentParameters.GetLength(1); index++)
{
parameters.Add(sender.CurrentParameters[index, 0], sender.CurrentParameters[index, 1]);
}
switch (expression.ToLower().Split('|')[0])
{
case "MacroName":
match = true;
result = //Do Stuff;
break;
}
}
//No Params in the macro
else
{}
return result;
}
You probably don't need the Dictionary stuff, but I thought it was easier to access the parameters that way. You could just access them by index from sender.CurrentParameters, but you have to know which ones correspond to which.