PredictiveCodeSuggestions.AutoTemplates.AutoTemplateBuilder.Process C# (CSharp) Method

Process() public method

Processes the specified progress window.
public Process ( [ progressIndicator, int maxSuggestions, int occurrances, int minPercentage ) : void
progressIndicator [ The progress window.
maxSuggestions int The max templates.
occurrances int The occurrances.
minPercentage int The min percentage.
return void
    public void Process([CanBeNull] ProgressIndicator progressIndicator, int maxSuggestions, int occurrances, int minPercentage)
    {
      this.ProgressIndicator = progressIndicator;
      this.MaxSuggestions = maxSuggestions;
      this.Occurances = occurrances;
      this.MinPercentage = minPercentage;

      if (this.MaxSuggestions < 1)
      {
        this.MaxSuggestions = 1;
      }

      var indicator = this.ProgressIndicator;
      if (indicator != null)
      {
        indicator.Task = "Loading data files...";
        indicator.Text = string.Empty;
      }

      this.LoadDataFiles();

      if (indicator != null)
      {
        indicator.Task = "Building suggestions...";
        indicator.Text = string.Format("0 of {0}", this.templates.Count);
      }

      this.Build();
    }

Usage Example

    /// <summary>
    /// Builds the templates.
    /// </summary>
    /// <param name="progressIndicator">The progress indicator.</param>
    private void BuildTemplates(ProgressIndicator progressIndicator)
    {
      var service = Shell.Instance.GetComponent<AutoTemplatesService>();
      var settings = service.GetSettings();

      var builder = new AutoTemplateBuilder();
      builder.Process(progressIndicator, settings.GetMaxTemplates(), settings.GetOccurances(), settings.GetMinPercentage());

      AutoTemplateManager.Invalidate();
    }
All Usage Examples Of PredictiveCodeSuggestions.AutoTemplates.AutoTemplateBuilder::Process