本文整理匯總了C#中System.Resolver.RequestBinding方法的典型用法代碼示例。如果您正苦於以下問題:C# Resolver.RequestBinding方法的具體用法?C# Resolver.RequestBinding怎麽用?C# Resolver.RequestBinding使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Resolver
的用法示例。
在下文中一共展示了Resolver.RequestBinding方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Resolve
public override void Resolve(Resolver resolver)
{
var parameters = method.GetParameters();
methodParameterBindings = new Binding[parameters.Length];
for (var i = 0; i < parameters.Length; ++i)
{
var key = Key.Get(parameters[i].ParameterType, parameters[i].GetQualifierName());
methodParameterBindings[i] = resolver.RequestBinding(key, target.GetType().FullName + "::" + method.Name);
}
}
示例2: Resolve
public override void Resolve(Resolver resolver)
{
var k = 0;
for (var i = 0; i < properties.Length; ++i)
{
if (propertyBindings[i] == null)
{
propertyBindings[i] = resolver.RequestBinding(keys[k], type.FullName + "." + properties[i].Name);
}
++k;
}
if (ctor != null)
{
for (var i = 0; i < paramterBindings.Length; ++i)
{
if (paramterBindings[i] == null)
{
paramterBindings[i] = resolver.RequestBinding(keys[k], type.FullName + "::.ctor");
}
++k;
}
}
if (baseType != null && baseTypeBinding == null)
{
baseTypeBinding = resolver.RequestBinding(keys[k], MembersKey, false);
}
}