本文整理汇总了C#中ProgressMonitor.Start方法的典型用法代码示例。如果您正苦于以下问题:C# ProgressMonitor.Start方法的具体用法?C# ProgressMonitor.Start怎么用?C# ProgressMonitor.Start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProgressMonitor
的用法示例。
在下文中一共展示了ProgressMonitor.Start方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: index
public void index(ProgressMonitor progress)
{
progress.Start(2 /* tasks */);
try
{
try
{
ReadPackHeader();
_entries = new PackedObjectInfo[(int)_objectCount];
_baseById = new ObjectIdSubclassMap<DeltaChain>();
_baseByPos = new LongMap<UnresolvedDelta>();
progress.BeginTask(PROGRESS_DOWNLOAD, (int)_objectCount);
for (int done = 0; done < _objectCount; done++)
{
IndexOneObject();
progress.Update(1);
if (progress.IsCancelled)
{
throw new IOException("Download cancelled");
}
}
ReadPackFooter();
EndInput();
progress.EndTask();
if (_deltaCount > 0)
{
if (_packOut == null)
{
throw new IOException("need packOut");
}
ResolveDeltas(progress);
if (_entryCount < _objectCount)
{
if (!_fixThin)
{
throw new IOException("pack has " + (_objectCount - _entryCount) + " unresolved deltas");
}
FixThinPack(progress);
}
}
if (_packOut != null && (_keepEmpty || _entryCount > 0))
{
_packOut.Flush();
}
_packDigest = null;
_baseById = null;
_baseByPos = null;
if (_dstIdx != null && (_keepEmpty || _entryCount > 0))
{
WriteIdx();
}
}
finally
{
try
{
InflaterCache.Instance.release(_inflater);
}
finally
{
_inflater = null;
}
_windowCursor = WindowCursor.Release(_windowCursor);
progress.EndTask();
if (_packOut != null)
{
_packOut.Close();
}
}
if (_keepEmpty || _entryCount > 0)
{
if (_dstPack != null)
{
_dstPack.IsReadOnly = true;
}
if (_dstIdx != null)
{
_dstIdx.IsReadOnly = true;
}
}
}
catch (IOException)
{
if (_dstPack != null) _dstPack.Delete();
if (_dstIdx != null) _dstIdx.Delete();
throw;
}
}