本文整理汇总了C#中IHandler.Last方法的典型用法代码示例。如果您正苦于以下问题:C# IHandler.Last方法的具体用法?C# IHandler.Last怎么用?C# IHandler.Last使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IHandler
的用法示例。
在下文中一共展示了IHandler.Last方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetMismatchMessage
private string GetMismatchMessage(IHandler[] handlers)
{
var message = new StringBuilder();
Debug.Assert(handlers.Length > 1, "handlers.Length > 1");
var root = handlers.First();
var last = handlers.Last();
message.AppendFormat("Component '{0}' with lifestyle {1} ", GetNameDescription(root.ComponentModel), root.ComponentModel.GetLifestyleDescription());
message.AppendFormat("depends on '{0}' with lifestyle {1}", GetNameDescription(last.ComponentModel), last.ComponentModel.GetLifestyleDescription());
for (var i = 1; i < handlers.Length - 1; i++)
{
var via = handlers[i];
message.AppendLine();
message.AppendFormat("\tvia '{0}' with lifestyle {1}", GetNameDescription(via.ComponentModel), via.ComponentModel.GetLifestyleDescription());
}
message.AppendLine();
message.AppendFormat(
"This kind of dependency is usually not desired and may lead to various kinds of bugs.");
return message.ToString();
}
示例2: MismatchedComponentView
private DebuggerViewItem MismatchedComponentView(IHandler[] handlers)
{
var item = GetItem(handlers);
var key = GetKey(handlers.Last());
var name = GetName(handlers, handlers.First());
return new DebuggerViewItem(name, key, item);
}
示例3: MismatchedComponentView
private object MismatchedComponentView(IHandler[] handlers)
{
return new DebuggerViewItemWithDetails(GetName(handlers, handlers.First()),
GetKey(handlers.Last()),
GetMismatchMessage(handlers),
Array.ConvertAll(handlers, h => ComponentDebuggerView.BuildFor(h)));
}