本文整理汇总了C#中IRequest.FormatActivationPath方法的典型用法代码示例。如果您正苦于以下问题:C# IRequest.FormatActivationPath方法的具体用法?C# IRequest.FormatActivationPath怎么用?C# IRequest.FormatActivationPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRequest
的用法示例。
在下文中一共展示了IRequest.FormatActivationPath方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CouldNotResolvePropertyForValueInjection
/// <summary>
/// Generates a message saying that the specified property could not be resolved on the specified request.
/// </summary>
/// <param name="request">The request.</param>
/// <param name="propertyName">The property name.</param>
/// <returns>The exception message.</returns>
public static string CouldNotResolvePropertyForValueInjection(IRequest request, string propertyName)
{
using (var sw = new StringWriter())
{
sw.WriteLine("Error activating {0}", request.Service.Format());
sw.WriteLine("No matching property {0}.", propertyName);
sw.WriteLine("Activation path:");
sw.WriteLine(request.FormatActivationPath());
sw.WriteLine("Suggestions:");
sw.WriteLine(" 1) Ensure that you have the correct property name.");
return sw.ToString();
}
}
示例2: CouldNotUniquelyResolveBinding
public static string CouldNotUniquelyResolveBinding(IRequest request)
{
using (var sw = new StringWriter())
{
sw.WriteLine("Error activating {0}", request.Service.Format());
sw.WriteLine("More than one matching bindings are available.");
sw.WriteLine("Activation path:");
sw.WriteLine(request.FormatActivationPath());
sw.WriteLine("Suggestions:");
sw.WriteLine(" 1) Ensure that you have defined a binding for {0} only once.", request.Service.Format());
return sw.ToString();
}
}
示例3: CouldNotFindScope
/// <summary>
/// Generates a message saying that the binding could not be resolved due to unknown scope
/// </summary>
/// <param name="request">The request.</param>
/// <param name="scopeName">Scope name</param>
/// <returns>The exception message.</returns>
public static string CouldNotFindScope(IRequest request, string scopeName)
{
using (var sw = new StringWriter())
{
sw.WriteLine("Error activating {0}", request.Service.Format());
sw.WriteLine("The scope {0} is not known in the current context.", scopeName);
sw.WriteLine("No matching scopes are available, and the type is declared InNamedScope({0}).", scopeName);
sw.WriteLine("Activation path:");
sw.WriteLine(request.FormatActivationPath());
sw.WriteLine("Suggestions:");
sw.WriteLine(" 1) Ensure that you have defined the scope {0}.", scopeName);
sw.WriteLine(" 2) Ensure you have a parent resolution that defines the scope.");
sw.WriteLine(" 3) If you are using factory methods or late resolution, check that the correct IResolutionRoot is being used.");
return sw.ToString();
}
}
示例4: CouldNotResolveBinding
public static string CouldNotResolveBinding(IRequest request)
{
using (var sw = new StringWriter())
{
sw.WriteLine("Error activating {0}", request.Service.Format());
sw.WriteLine("No matching bindings are available, and the type is not self-bindable.");
sw.WriteLine("Activation path:");
sw.WriteLine(request.FormatActivationPath());
sw.WriteLine("Suggestions:");
sw.WriteLine(" 1) Ensure that you have defined a binding for {0}.", request.Service.Format());
sw.WriteLine(" 2) If the binding was defined in a module, ensure that the module has been loaded into the kernel.");
sw.WriteLine(" 3) Ensure you have not accidentally created more than one kernel.");
#if !SILVERLIGHT
sw.WriteLine(" 4) If you are using automatic module loading, ensure the search path and filters are correct.");
#endif
return sw.ToString();
}
}
示例5: CouldNotUniquelyResolveBinding
/// <summary>
/// Generates a message saying that the binding could not be uniquely resolved.
/// </summary>
/// <param name="request">The request.</param>
/// <param name="formattedMatchingBindings">The matching bindings, already formatted as strings</param>
/// <returns>The exception message.</returns>
public static string CouldNotUniquelyResolveBinding(IRequest request, string[] formattedMatchingBindings)
{
using (var sw = new StringWriter())
{
sw.WriteLine("Error activating {0}", request.Service.Format());
sw.WriteLine("More than one matching bindings are available.");
sw.WriteLine("Matching bindings:");
for (int i = 0; i < formattedMatchingBindings.Length; i++)
{
sw.WriteLine(" {0}) {1}", i + 1, formattedMatchingBindings[i]);
}
sw.WriteLine("Activation path:");
sw.WriteLine(request.FormatActivationPath());
sw.WriteLine("Suggestions:");
sw.WriteLine(" 1) Ensure that you have defined a binding for {0} only once.", request.Service.Format());
return sw.ToString();
}
}