Exemplo n.º 1
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="ProgressInfo{TMessage}"/> class.
 /// </summary>
 /// <param name="progress">
 ///     The progress operation represented by this information object.
 /// </param>
 /// <param name="blocksUi">
 ///     <see langword="true"/> if the operation is supposed to block the UI from user interaction.
 /// </param>
 public ProgressInfo(
     HierarchicalProgress <TMessage> progress,
     bool blocksUi)
 {
     this.Progress     = progress;
     this.isBlockingUi = blocksUi;
 }
Exemplo n.º 2
0
        /// <summary>
        ///     Creates and registers a child long running operation in order to provide feedback to the user.
        /// </summary>
        /// <param name="blocksUi">
        ///     <see langword="true"/> if the UI should be blocked while this child operation is active.
        /// </param>
        /// <returns>
        ///     A <see cref="IProgress{IProgressReport}"/> object which allows manipulation of the progress of the operation.
        /// </returns>
        public virtual IHierarchicalProgress <IProgressReport <TMessage> > CreateProgress(bool blocksUi)
        {
            var childProgress = new HierarchicalProgress <TMessage>(this.OnReport, this.UnregisterProgress, this.ProgressReportFactory);
            var progressInfo  = new ProgressInfo <TMessage>(childProgress, blocksUi);

            this.childProgressInfos.Add(progressInfo);
            this.activeChildProgressInfos.Add(progressInfo);
            return(childProgress);
        }