Example #1
0
		void OnProgress(FSProgressInfo fsProgressInfo)
		{
			Description = fsProgressInfo.Comment;
			if (fsProgressInfo.PercentComplete >= 0)
			{
				Percent = fsProgressInfo.PercentComplete;
			}

			if (fsProgressInfo.Stage == -100)
				CancelText = "Остановить";

			if (fsProgressInfo.Stage > 0)
			{
				int stageNo = fsProgressInfo.Stage / (256 * 256);
				int stageCount = fsProgressInfo.Stage - stageNo * 256 * 256;
			}
		}
		public bool Progress(int stage, string comment, int percentComplete, int bytesRW)
		{
			if (IsSuspended)
				return true;

			try
			{
				bool continueProgress = ContinueProgress;
				ContinueProgress = true;
				var fsProgressInfo = new FSProgressInfo()
				{
					Stage = stage,
					Comment = comment,
					PercentComplete = percentComplete,
					BytesRW = bytesRW
				};
				CallbackManager.Add(new FSAgentCallbac() { FSProgressInfo = fsProgressInfo });
				return continueProgress;
			}
			catch (Exception e)
			{
				Logger.Error(e, "Исключение при вызове NativeFiresecClient.Progress");
				return false;
			}
		}
Example #3
0
		public void Progress(FSProgressInfo fsProgressInfo)
		{
			ApplicationService.Invoke(() => OnProgress(fsProgressInfo));
		}