public virtual void ProcessModel(IKernel kernel, ComponentModel model)
{
if (model == null)
{
throw new ArgumentNullException("model");
}
if (model.Configuration == null || model.Implementation == null)
{
return;
}
var methodsNode = model.Configuration.Children[ObtainNodeName()];
if (methodsNode == null)
{
return;
}
EnsureHasReferenceToConverter(kernel);
foreach (var methodNode in methodsNode.Children)
{
var name = methodNode.Name;
if ("method".Equals(name))
{
name = methodNode.Attributes["name"];
}
AssertNameIsNotNull(name, model);
var metaModel = new MethodMetaModel(methodNode);
if (IsValidMeta(model, metaModel))
{
if (ShouldUseMetaModel)
{
// model.MethodMetaModels.Add( metaModel );
}
var signature = methodNode.Attributes["signature"];
var methods = GetMethods(model.Implementation, name, signature);
if (methods.Count == 0)
{
var message = String.Format("The class {0} has tried to expose configuration for " +
"a method named {1} which could not be found.", model.Implementation.FullName, name);
throw new Exception(message);
}
ProcessMeta(model, methods, metaModel);
if (ShouldUseMetaModel)
{
// RegisterMethodsForFastAccess(methods, signature, metaModel, model);
}
}
}
}