本文整理汇总了C#中IView.ShowProgress方法的典型用法代码示例。如果您正苦于以下问题:C# IView.ShowProgress方法的具体用法?C# IView.ShowProgress怎么用?C# IView.ShowProgress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IView
的用法示例。
在下文中一共展示了IView.ShowProgress方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessRequest
/// <summary>Processes the request.</summary>
/// <param name="targets">The targets.</param>
/// <param name="view">The view.</param>
/// <param name="success">The success.</param>
/// <param name="fail">The fail.</param>
private void ProcessRequest(IReadOnlyList<string> targets, IView view, ref int success, ref int fail)
{
var retry = false;
for (this.activeIndex = 0; this.activeIndex < targets.Count; this.activeIndex++)
{
var currentIndex = this.activeIndex;
try
{
var currentFile = targets[this.activeIndex];
var fileSizeLimit = 10 * 1024 * 1024;
var fileInfo = new FileInfo(currentFile);
if (!fileInfo.Exists || fileInfo.Length < fileSizeLimit)
{
continue;
}
if (retry)
{
retry = false;
}
else
{
this.activeController = new MainViewController(currentFile, view, new AggregateDb());
}
view.ShowProgress(this.activeIndex, targets.Count);
var entryResult = this.activeController.Query();
retry = this.activeIndex != currentIndex;
if (entryResult == Status.Success || entryResult == Status.Skipped)
{
success++;
}
else if (entryResult == Status.Failure)
{
fail++;
}
else if (entryResult == Status.Cancelled)
{
break; // Users cancel
}
}
catch (Exception ex)
{
fail++;
Trace.TraceError(ex.ToString());
}
}
}