• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ProgressMonitor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ProgressMonitor的典型用法代码示例。如果您正苦于以下问题:C# ProgressMonitor类的具体用法?C# ProgressMonitor怎么用?C# ProgressMonitor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ProgressMonitor类属于命名空间,在下文中一共展示了ProgressMonitor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SideBandInputStream

 public SideBandInputStream(PacketLineIn aPckIn, Stream aIns, ProgressMonitor aProgress)
 {
     pckIn = aPckIn;
     ins = aIns;
     monitor = aProgress;
     currentTask = "";
 }
开发者ID:ArildF,项目名称:GitSharp,代码行数:7,代码来源:SideBandInputStream.cs


示例2: SideBandInputStream

 public SideBandInputStream(PacketLineIn aPckIn, Stream aIns, ProgressMonitor aProgress)
 {
     pckIn = aPckIn;
     ins = aIns;
     monitor = aProgress;
     currentTask = string.Empty;
     progressBuffer = string.Empty;
 }
开发者ID:stschake,项目名称:GitSharp,代码行数:8,代码来源:SideBandInputStream.cs


示例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);
		}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:8,代码来源:AggregatedProgressMonitor.cs


示例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);
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:8,代码来源:AggregatedProgressMonitor.cs


示例5: ComputeRelativeTimesProgressMonitor

        public ComputeRelativeTimesProgressMonitor(ProgressMonitor next, Action<string> writer = null)
        {
            if (writer == null)
                writer = s => Debug.WriteLine(s);

            this.next = next;
            this.writer = writer;
        }
开发者ID:pescuma,项目名称:progressmonitor,代码行数:8,代码来源:ComputeRelativeTimesProgressMonitor.cs


示例6: SideBandInputStream

		public SideBandInputStream(Stream @in, ProgressMonitor progress)
		{
			rawIn = @in;
			pckIn = new PacketLineIn(rawIn);
			monitor = progress;
			currentTask = string.Empty;
			progressBuffer = string.Empty;
		}
开发者ID:dev218,项目名称:GitSharp,代码行数:8,代码来源:SideBandInputStream.cs


示例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();
                }
            }
        }
开发者ID:dev218,项目名称:GitSharp,代码行数:19,代码来源:FetchProcess.cs


示例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();
        }
开发者ID:mneedham,项目名称:GitSharp,代码行数:22,代码来源:PushProcess.cs


示例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;
        }
开发者ID:spraints,项目名称:GitSharp,代码行数:36,代码来源:BasePackPushConnection.cs


示例10: Push

 public void Push(ProgressMonitor monitor, IDictionary<string, RemoteRefUpdate> refUpdates)
 {
     markStartedOperation();
     doPush(monitor, refUpdates);
 }
开发者ID:spraints,项目名称:GitSharp,代码行数:5,代码来源:BasePackPushConnection.cs


示例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);
        }
开发者ID:deodelacruz,项目名称:GitSharp,代码行数:22,代码来源:Transport.cs


示例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();
        }
开发者ID:spraints,项目名称:GitSharp,代码行数:52,代码来源:PushProcess.cs


示例13: FilteredProgressMonitor

		public FilteredProgressMonitor (ProgressMonitor targetMonitor)
			: this (targetMonitor, MonitorAction.WriteLog | MonitorAction.ReportError | MonitorAction.ReportWarning | MonitorAction.ReportSuccess | MonitorAction.Cancel | MonitorAction.SlaveCancel)
		{
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:4,代码来源:FilteredProgressMonitor.cs


示例14: Fetch

 public void Fetch(ProgressMonitor monitor, ICollection<Ref> want, IList<ObjectId> have)
 {
     markStartedOperation();
     doFetch(monitor, want, have);
 }
开发者ID:dev218,项目名称:GitSharp,代码行数:5,代码来源:BaseFetchConnection.cs


示例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();
 }
开发者ID:georgeck,项目名称:GitSharp,代码行数:16,代码来源:IndexPack.cs


示例16: DownloadPack

 public void DownloadPack(ProgressMonitor monitor)
 {
     Stream s = _connection.open("pack/" + PackName);
     IndexPack ip = IndexPack.Create(_local, s);
     ip.setFixThin(false);
     ip.setObjectChecker(_objCheck);
     ip.index(monitor);
     PackLock keep = ip.renameAndOpenPack(_lockMessage);
     if (keep != null)
     {
         _packLocks.Add(keep);
     }
 }
开发者ID:HackerBaloo,项目名称:GitSharp,代码行数:13,代码来源:WalkFetchConnection.cs


示例17: OpenIndex

            public void OpenIndex(ProgressMonitor pm)
            {
                if (Index != null) return;

                try
                {
                    Index = PackIndex.Open(TmpIdx);
                    return;
                }
                catch (FileNotFoundException)
                {

                }

                Stream s = _connection.open("pack/" + _idxName);
                pm.BeginTask("Get " + _idxName.Slice(0, 12) + "..idx", s.Length < 0 ? -1 : (int)(s.Length / 1024));
                try
                {
                    var fos = new FileStream(TmpIdx.ToString(), System.IO.FileMode.Open, FileAccess.ReadWrite);
                    try
                    {
                        var buf = new byte[2048];
                        int cnt;
                        while (!pm.IsCancelled && (cnt = s.Read(buf, 0, buf.Length)) >= 0)
                        {
                            fos.Write(buf, 0, cnt);
                            pm.Update(cnt / 1024);
                        }
                    }
                    finally
                    {
                        fos.Close();
                    }
                }
                catch (IOException)
                {
                    TmpIdx.Delete();
                    throw;
                }
                finally
                {
                    s.Close();
                }
                pm.EndTask();

                if (pm.IsCancelled)
                {
                    TmpIdx.Delete();
                    return;
                }

                try
                {
                    Index = PackIndex.Open(TmpIdx);
                }
                catch (IOException)
                {
                    TmpIdx.Delete();
                    throw;
                }
            }
开发者ID:HackerBaloo,项目名称:GitSharp,代码行数:61,代码来源:WalkFetchConnection.cs


示例18: doFetch

 /// <summary>
 /// Implementation of <see cref="Fetch"/>
 /// without checking for multiple fetch.
 /// </summary>
 /// <param name="monitor">as in <see cref="Fetch"/></param>
 /// <param name="want">as in <see cref="Fetch"/></param>
 /// <param name="have">as in <see cref="Fetch"/></param>
 protected abstract void doFetch(ProgressMonitor monitor, ICollection<Ref> want, IList<ObjectId> have);
开发者ID:dev218,项目名称:GitSharp,代码行数:8,代码来源:BaseFetchConnection.cs


示例19: writePack

        private void writePack(IDictionary<string, RemoteRefUpdate> refUpdates, ProgressMonitor monitor)
        {
            PackWriter writer = new PackWriter(local, monitor);
            List<ObjectId> remoteObjects = new List<ObjectId>(Refs.Count);
            List<ObjectId> newObjects = new List<ObjectId>(refUpdates.Count);

            foreach (Ref r in Refs)
                remoteObjects.Add(r.ObjectId);

            remoteObjects.AddRange(additionalHaves);
            foreach (RemoteRefUpdate r in refUpdates.Values)
            {
                if (!ObjectId.ZeroId.Equals(r.NewObjectId))
                    newObjects.Add(r.NewObjectId);
            }

            writer.Thin = _thinPack;
            writer.DeltaBaseAsOffset = _capableOfsDelta;
            writer.preparePack(newObjects, remoteObjects);
            writer.writePack(stream);
        }
开发者ID:HackerBaloo,项目名称:GitSharp,代码行数:21,代码来源:BasePackPushConnection.cs


示例20: sideband

 public Stream sideband(ProgressMonitor pm)
 {
     return new SideBandInputStream(this, ins, pm);
 }
开发者ID:georgeck,项目名称:GitSharp,代码行数:4,代码来源:PacketLineIn.cs



注:本文中的ProgressMonitor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Project类代码示例发布时间:2022-05-24
下一篇:
C# ProgressIndicator类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap