using dnlib.DotNet;
namespace Confuser.Core.Project.Patterns {
///
/// A function that compare the module of definition.
///
public class ModuleFunction : PatternFunction {
internal const string FnName = "module";
///
public override string Name {
get { return FnName; }
}
///
public override int ArgumentCount {
get { return 1; }
}
///
public override object Evaluate(IDnlibDef definition) {
if (!(definition is IOwnerModule))
return false;
object name = Arguments[0].Evaluate(definition);
return ((IOwnerModule)definition).Module.Name == name.ToString();
}
}
}