/// <summary>Processes the specified progress window.</summary> /// <param name="progressIndicator">The progress window.</param> /// <param name="maxSuggestions">The max templates.</param> /// <param name="occurrances">The occurrances.</param> /// <param name="minPercentage">The min percentage.</param> 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(); }
/// <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(); }
/// <summary>Runs this instance.</summary> /// <param name="progressIndicator">The progress Indicator.</param> /// <param name="fileNames">The file Names.</param> public void Process(ProgressIndicator progressIndicator, IEnumerable<string> fileNames) { this.ProgressIndicator = progressIndicator; var fileName = Path.Combine(AutoTemplateManager.DataFolder, this.Solution.Name + ".xml"); if (fileNames == null) { this.Process(fileName); } else { this.Process(fileName, fileNames); } this.ProgressIndicator = null; }