/// <summary>
 /// Creates a new event arguments instance.
 /// </summary>
 /// <param name="item">The progress item.</param>
 /// <param name="progress">The progress info.</param>
 /// <param name="oldLegend">The old legend.</param>
 /// <param name="newLegend">The new legend.</param>
 public ProgressItemLegendSetEventArgs(ProgressItem item, ProgressInfo progress, ProgressLegend oldLegend, ProgressLegend newLegend)
     : base(item)
 {
     this.Progress = progress;
     this.OldLegend = oldLegend;
     this.NewLegend = newLegend;
 }
Пример #2
0
 /// <summary>
 /// Creates a new progress info with the specified legend.
 /// </summary>
 /// <param name="legend">The progress legend.</param>
 public ProgressInfo(ProgressLegend legend)
 {
     // Set the legend.
     this.legend = legend;
     // Set the legend event handlers.
     this.legend.ItemChanged += this.OnLegendItemChanged;
     this.legend.ItemsChanged += this.OnLegendItemsChanged;
     // Initialize the progress.
     this.OnInitialize();
 }
Пример #3
0
 /// <summary>
 /// Creates a new progress list box item with the specified text and progress legend.
 /// </summary>
 /// <param name="text">The item text.</param>
 /// <param name="legend">The progress legend.</param>
 public ProgressItem(string text, ProgressLegend legend)
 {
     // Set the text.
     this.text = text;
     // Create the progress information.
     this.progress = new ProgressInfo(legend);
     // Set the progress event handlers.
     this.progress.LevelChanged += this.OnProgressLevelChanged;
     this.progress.DefaultChanged += this.OnProgressDefaultChanged;
     this.progress.CountChanged += this.OnProgressCountChanged;
     this.progress.LegendSet += this.OnProgressLegendSet;
     this.progress.LegendChanged += this.OnProgressLegendChanged;
 }
 /// <summary>
 /// Creates a new event arguments instance.
 /// </summary>
 /// <param name="progress">The progress info.</param>
 /// <param name="legend">The progress legend.</param>
 public ProgressLegendChangedEventArgs(ProgressInfo progress, ProgressLegend legend)
     : base(progress)
 {
     this.Legend = legend;
 }
 /// <summary>
 /// Creates a new event arguments instance.
 /// </summary>
 /// <param name="legend">The progress legend.</param>
 /// <param name="item">The progress legend item.</param>
 public ProgressLegendItemChangedEventArgs(ProgressLegend legend, ProgressLegendItem item)
     : base(legend)
 {
     this.Item = item;
 }
Пример #6
0
        /// <summary>
        /// An event handler called when a new progress legend has been set.
        /// </summary>
        /// <param name="oldLegend">The old legend.</param>
        /// <param name="newLegend">The new legend.</param>
        private void OnLegendSet(ProgressLegend oldLegend, ProgressLegend newLegend)
        {
            // Remove the old legend event handlers.
            if (oldLegend != null)
            {
                oldLegend.ItemsChanged -= this.OnLegendItemsChanged;
                oldLegend.ItemChanged -= this.OnLegendItemChanged;
            }
            // Add the new legend event handlers.
            if (newLegend != null)
            {
                newLegend.ItemsChanged += this.OnLegendItemsChanged;
                newLegend.ItemChanged += this.OnLegendItemChanged;
            }

            // Raise the event.
            if (null != this.LegendSet) this.LegendSet(this, new ProgressLegendSetEventArgs(this, oldLegend, newLegend));
        }
 /// <summary>
 /// Creates a new event arguments instance.
 /// </summary>
 /// <param name="progress">The progress info.</param>
 /// <param name="oldLegend">The old progress legend.</param>
 /// <param name="newLegend">The new progress legend.</param>
 public ProgressLegendSetEventArgs(ProgressInfo progress, ProgressLegend oldLegend, ProgressLegend newLegend)
     : base(progress)
 {
     this.OldLegend = oldLegend;
     this.NewLegend = newLegend;
 }
 /// <summary>
 /// Creates a new event arguments instance.
 /// </summary>
 /// <param name="item">The progress item.</param>
 /// <param name="progress">The progress info.</param>
 /// <param name="legend">The legend.</param>
 public ProgressItemLegendChangedEventArgs(ProgressItem item, ProgressInfo progress, ProgressLegend legend)
     : base(item)
 {
     this.Progress = progress;
     this.Legend = legend;
 }
 /// <summary>
 /// Creates a new event arguments instance.
 /// </summary>
 /// <param name="legend">The progress legend.</param>
 public ProgressLegendEventArgs(ProgressLegend legend)
 {
     this.Legend = legend;
 }