本文整理汇总了C#中NGit.ProgressMonitor.Start方法的典型用法代码示例。如果您正苦于以下问题:C# ProgressMonitor.Start方法的具体用法?C# ProgressMonitor.Start怎么用?C# ProgressMonitor.Start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NGit.ProgressMonitor
的用法示例。
在下文中一共展示了ProgressMonitor.Start方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Parse
/// <summary>Parse the pack stream.</summary>
/// <remarks>Parse the pack stream.</remarks>
/// <param name="receiving">
/// receives progress feedback during the initial receiving
/// objects phase. If null,
/// <see cref="NGit.NullProgressMonitor">NGit.NullProgressMonitor</see>
/// will be
/// used.
/// </param>
/// <param name="resolving">receives progress feedback during the resolving objects phase.
/// </param>
/// <returns>
/// the pack lock, if one was requested by setting
/// <see cref="SetLockMessage(string)">SetLockMessage(string)</see>
/// .
/// </returns>
/// <exception cref="System.IO.IOException">the stream is malformed, or contains corrupt objects.
/// </exception>
public virtual PackLock Parse(ProgressMonitor receiving, ProgressMonitor resolving
)
{
if (receiving == null)
{
receiving = NullProgressMonitor.INSTANCE;
}
if (resolving == null)
{
resolving = NullProgressMonitor.INSTANCE;
}
if (receiving == resolving)
{
receiving.Start(2);
}
try
{
ReadPackHeader();
entries = new PackedObjectInfo[(int)objectCount];
baseById = new ObjectIdOwnerMap<PackParser.DeltaChain>();
baseByPos = new LongMap<PackParser.UnresolvedDelta>();
deferredCheckBlobs = new BlockList<PackedObjectInfo>();
receiving.BeginTask(JGitText.Get().receivingObjects, (int)objectCount);
try
{
for (int done = 0; done < objectCount; done++)
{
IndexOneObject();
receiving.Update(1);
if (receiving.IsCancelled())
{
throw new IOException(JGitText.Get().downloadCancelled);
}
}
ReadPackFooter();
EndInput();
}
finally
{
receiving.EndTask();
}
if (!deferredCheckBlobs.IsEmpty())
{
DoDeferredCheckBlobs();
}
if (deltaCount > 0)
{
if (resolving is BatchingProgressMonitor)
{
((BatchingProgressMonitor)resolving).SetDelayStart(1000, TimeUnit.MILLISECONDS);
}
resolving.BeginTask(JGitText.Get().resolvingDeltas, deltaCount);
ResolveDeltas(resolving);
if (entryCount < objectCount)
{
if (!IsAllowThin())
{
throw new IOException(MessageFormat.Format(JGitText.Get().packHasUnresolvedDeltas
, Sharpen.Extensions.ValueOf(objectCount - entryCount)));
}
ResolveDeltasWithExternalBases(resolving);
if (entryCount < objectCount)
{
throw new IOException(MessageFormat.Format(JGitText.Get().packHasUnresolvedDeltas
, Sharpen.Extensions.ValueOf(objectCount - entryCount)));
}
}
resolving.EndTask();
}
packDigest = null;
baseById = null;
baseByPos = null;
}
finally
{
try
{
if (readCurs != null)
{
readCurs.Release();
}
}
//.........这里部分代码省略.........
示例2: Index
/// <summary>Consume data from the input stream until the packfile is indexed.</summary>
/// <remarks>Consume data from the input stream until the packfile is indexed.</remarks>
/// <param name="progress">progress feedback</param>
/// <exception cref="System.IO.IOException">System.IO.IOException</exception>
public virtual void Index(ProgressMonitor progress)
{
progress.Start(2);
try
{
try
{
ReadPackHeader();
entries = new PackedObjectInfo[(int)objectCount];
baseById = new ObjectIdSubclassMap<IndexPack.DeltaChain>();
baseByPos = new LongMap<IndexPack.UnresolvedDelta>();
deferredCheckBlobs = new AList<PackedObjectInfo>();
progress.BeginTask(JGitText.Get().receivingObjects, (int)objectCount);
for (int done = 0; done < objectCount; done++)
{
IndexOneObject();
progress.Update(1);
if (progress.IsCancelled())
{
throw new IOException(JGitText.Get().downloadCancelled);
}
}
ReadPackFooter();
EndInput();
if (!deferredCheckBlobs.IsEmpty())
{
DoDeferredCheckBlobs();
}
progress.EndTask();
if (deltaCount > 0)
{
if (packOut == null)
{
throw new IOException(JGitText.Get().needPackOut);
}
ResolveDeltas(progress);
if (entryCount < objectCount)
{
if (!fixThin)
{
throw new IOException(MessageFormat.Format(JGitText.Get().packHasUnresolvedDeltas
, (objectCount - entryCount)));
}
FixThinPack(progress);
}
}
if (packOut != null && (keepEmpty || entryCount > 0))
{
packOut.GetChannel().Force(true);
}
packDigest = null;
baseById = null;
baseByPos = null;
if (dstIdx != null && (keepEmpty || entryCount > 0))
{
WriteIdx();
}
}
finally
{
try
{
if (readCurs != null)
{
readCurs.Release();
}
}
finally
{
readCurs = null;
}
try
{
inflater.Release();
}
finally
{
inflater = null;
objectDatabase.Close();
}
progress.EndTask();
if (packOut != null)
{
packOut.Close();
}
}
if (keepEmpty || entryCount > 0)
{
if (dstPack != null)
{
dstPack.SetReadOnly();
}
if (dstIdx != null)
{
dstIdx.SetReadOnly();
}
//.........这里部分代码省略.........