本文整理汇总了C#中ProgressMonitor类的典型用法代码示例。如果您正苦于以下问题:C# ProgressMonitor类的具体用法?C# ProgressMonitor怎么用?C# ProgressMonitor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProgressMonitor类属于命名空间,在下文中一共展示了ProgressMonitor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SideBandInputStream
public SideBandInputStream(PacketLineIn aPckIn, Stream aIns, ProgressMonitor aProgress)
{
pckIn = aPckIn;
ins = aIns;
monitor = aProgress;
currentTask = "";
}
示例2: SideBandInputStream
public SideBandInputStream(PacketLineIn aPckIn, Stream aIns, ProgressMonitor aProgress)
{
pckIn = aPckIn;
ins = aIns;
monitor = aProgress;
currentTask = string.Empty;
progressBuffer = string.Empty;
}
示例3: AggregatedProgressMonitor
internal AggregatedProgressMonitor (ProgressMonitor leaderMonitor, CancellationTokenSource cancelSource, params ProgressMonitor[] followerMonitors)
{
CancellationTokenSource = cancelSource ?? new CancellationTokenSource ();
this.leaderMonitor = leaderMonitor;
AddFollowerMonitor (leaderMonitor, MonitorAction.All);
foreach (ProgressMonitor mon in followerMonitors)
AddFollowerMonitor (mon);
}
示例4: AggregatedProgressMonitor
internal AggregatedProgressMonitor (ProgressMonitor masterMonitor, CancellationTokenSource cancelSource, params ProgressMonitor[] slaveMonitors)
{
CancellationTokenSource = cancelSource ?? new CancellationTokenSource ();
this.masterMonitor = masterMonitor;
AddSlaveMonitor (masterMonitor, MonitorAction.All);
foreach (ProgressMonitor mon in slaveMonitors)
AddSlaveMonitor (mon);
}
示例5: ComputeRelativeTimesProgressMonitor
public ComputeRelativeTimesProgressMonitor(ProgressMonitor next, Action<string> writer = null)
{
if (writer == null)
writer = s => Debug.WriteLine(s);
this.next = next;
this.writer = writer;
}
示例6: SideBandInputStream
public SideBandInputStream(Stream @in, ProgressMonitor progress)
{
rawIn = @in;
pckIn = new PacketLineIn(rawIn);
monitor = progress;
currentTask = string.Empty;
progressBuffer = string.Empty;
}
示例7: execute
internal virtual void execute(ProgressMonitor monitor, FetchResult result)
{
_askFor.Clear();
_localUpdates.Clear();
_fetchHeadUpdates.Clear();
_packLocks.Clear();
try
{
executeImp(monitor, result);
}
finally
{
foreach (PackLock @lock in _packLocks)
{
@lock.Unlock();
}
}
}
示例8: execute
public PushResult execute(ProgressMonitor monitor)
{
monitor.BeginTask(PROGRESS_OPENING_CONNECTION, -1);
connection = transport.openPush();
try
{
monitor.EndTask();
Dictionary<string, RemoteRefUpdate> preprocessed = prepareRemoteUpdates();
if (transport.DryRun)
modifyUpdatesForDryRun();
else if (preprocessed.Count != 0)
connection.Push(monitor, preprocessed);
}
finally
{
connection.Close();
}
if (!transport.DryRun)
updateTrackingRefs();
return prepareOperationResult();
}
示例9: WriteCommands
private void WriteCommands(IEnumerable<RemoteRefUpdate> refUpdates, ProgressMonitor monitor)
{
string capabilities = EnableCapabilities();
foreach (RemoteRefUpdate rru in refUpdates)
{
if (!_capableDeleteRefs && rru.IsDelete)
{
rru.Status = RemoteRefUpdate.UpdateStatus.REJECTED_NODELETE;
continue;
}
var sb = new StringBuilder();
Ref advertisedRef = GetRef(rru.RemoteName);
ObjectId oldId = (advertisedRef == null ? ObjectId.ZeroId : advertisedRef.ObjectId);
sb.Append(oldId.Name);
sb.Append(' ');
sb.Append(rru.NewObjectId.Name);
sb.Append(' ');
sb.Append(rru.RemoteName);
if (!_sentCommand)
{
_sentCommand = true;
sb.Append(capabilities);
}
pckOut.WriteString(sb.ToString());
rru.Status = RemoteRefUpdate.UpdateStatus.AWAITING_REPORT;
if (!rru.IsDelete)
_shouldWritePack = true;
}
if (monitor.IsCancelled)
throw new TransportException(uri, "push cancelled");
pckOut.End();
outNeedsEnd = false;
}
示例10: Push
public void Push(ProgressMonitor monitor, IDictionary<string, RemoteRefUpdate> refUpdates)
{
markStartedOperation();
doPush(monitor, refUpdates);
}
示例11: push
public PushResult push(ProgressMonitor monitor, ICollection<RemoteRefUpdate> toPush)
{
if (toPush == null || toPush.Count == 0)
{
try
{
toPush = findRemoteRefUpdatesFor(_pushSpecs);
}
catch (IOException e)
{
throw new TransportException("Problem with resolving push ref specs locally: " + e.Message, e);
}
if (toPush.Count == 0)
{
throw new TransportException("Nothing to push");
}
}
var pushProcess = new PushProcess(this, toPush);
return pushProcess.execute(monitor);
}
示例12: execute
/// <summary>
/// Perform push operation between local and remote repository - set remote
/// refs appropriately, send needed objects and update local tracking refs.
/// <para />
/// When <seealso cref="Transport.DryRun"/> is true, result of this operation is
/// just estimation of real operation result, no real action is performed.
/// </summary>
/// <param name="monitor">
/// Progress monitor used for feedback about operation.
/// </param>
/// <returns> result of push operation with complete status description. </returns>
/// <exception cref="NotSupportedException">
/// When push operation is not supported by provided transport.
/// </exception>
/// <exception cref="TransportException">
/// When some error occurred during operation, like I/O, protocol
/// error, or local database consistency error.
/// </exception>
public PushResult execute(ProgressMonitor monitor)
{
if (monitor == null)
throw new ArgumentNullException("monitor");
monitor.BeginTask(PROGRESS_OPENING_CONNECTION, ProgressMonitor.UNKNOWN);
_connection = _transport.openPush();
try
{
monitor.EndTask();
IDictionary<string, RemoteRefUpdate> preprocessed = PrepareRemoteUpdates();
if (_transport.DryRun)
{
ModifyUpdatesForDryRun();
}
else if (preprocessed.Count != 0)
{
_connection.Push(monitor, preprocessed);
}
}
finally
{
_connection.Close();
}
if (!_transport.DryRun)
{
UpdateTrackingRefs();
}
return PrepareOperationResult();
}
示例13: FilteredProgressMonitor
public FilteredProgressMonitor (ProgressMonitor targetMonitor)
: this (targetMonitor, MonitorAction.WriteLog | MonitorAction.ReportError | MonitorAction.ReportWarning | MonitorAction.ReportSuccess | MonitorAction.Cancel | MonitorAction.SlaveCancel)
{
}
示例14: Fetch
public void Fetch(ProgressMonitor monitor, ICollection<Ref> want, IList<ObjectId> have)
{
markStartedOperation();
doFetch(monitor, want, have);
}
示例15: ResolveDeltas
private void ResolveDeltas(ProgressMonitor progress)
{
progress.BeginTask(PROGRESS_RESOLVE_DELTA, _deltaCount);
int last = _entryCount;
for (int i = 0; i < last; i++)
{
int before = _entryCount;
ResolveDeltas(_entries[i]);
progress.Update(_entryCount - before);
if (progress.IsCancelled)
{
throw new IOException("Download cancelled during indexing");
}
}
progress.EndTask();
}