<commit_before>﻿// This file is licensed to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.ComponentModel;
using System.Threading.Tasks;

namespace Spines.Utility
{
  /// <summary>
  /// Runs an asynchronous operation and exposes the status through properties.
  /// </summary>
  /// <typeparam name="TResult">The type of the result of the asynchronous operation.</typeparam>
  public class BindableTask<TResult> : INotifyPropertyChanged
  {
    /// <summary>
    /// Creates a new instance of BindableTask and awaits the completion of the task.
    /// </summary>
    /// <param name="task">The asynchronous operation.</param>
    public BindableTask(Task<TResult> task)
    {
      Validate.NotNull(task, nameof(task));
      _task = task;
      if (!task.IsCompleted)
      {
        Completion = WatchTaskAsync(task);
      }
    }

    /// <summary>
    /// Exposes the asynchronous operation.<commit_msg>Bugfix<commit_after>﻿// This file is licensed to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.ComponentModel;
using System.Threading.Tasks;

namespace Spines.Utility
{
  /// <summary>
  /// Runs an asynchronous operation and exposes the status through properties.
  /// </summary>
  /// <typeparam name="TResult">The type of the result of the asynchronous operation.</typeparam>
  public class BindableTask<TResult> : INotifyPropertyChanged
  {
    /// <summary>
    /// Creates a new instance of BindableTask and awaits the completion of the task.
    /// </summary>
    /// <param name="task">The asynchronous operation.</param>
    public BindableTask(Task<TResult> task)
    {
      Validate.NotNull(task, nameof(task));
      _task = task;
      Completion = WatchTaskAsync(task);
    }

    /// <summary>
    /// Exposes the asynchronous operation.
{'fraction_non_alphanumeric': 0.11240721102863202, 'fraction_numerical': 0.0, 'mean_word_length': 2.9978813559322033, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3008170', 'n_tokens_mistral': 527, 'n_tokens_neox': 513, 'n_words': 175}