private async void FindUsages(string procedureName)
        {
            this.uxGrid.Visible = false;

            this.uxProgress.Value = 0;
            this.uxProgress.Visible = true;

            var parameterDetector = new ParameterDetector(DatabaseSingleton.Instance);
            parameterDetector.DetectParametersForProcedure(procedureName);

            this.SetupGrid(parameterDetector);

            var foundUsages = await DatabaseSingleton.Instance.ListUsages(procedureName);

            this.uxProgress.Maximum = foundUsages.Count();

            foreach (var parser in foundUsages.Select(usage => new StoredProcedureParser(DatabaseSingleton.Instance, usage, parameterDetector)))
            {
                foreach (var row in await parser.DetectUsages(procedureName))
                {
                    this.AddRowToGrid(row);
                }

                this.uxProgress.Value += 1;
            }

            this.uxDetect.Enabled = true;
            this.uxStoredProcedures.Enabled = true;
            this.uxProgress.Visible = false;
            this.uxGrid.Visible = true;
        }
        private void SetupGrid(ParameterDetector parameterDetector)
        {
            this.uxGrid.Columns.Clear();

            foreach (var parameter in parameterDetector.Parameters)
            {
                this.uxGrid.Columns.Add(parameter, parameter);
            }
        }
 public StoredProcedureParser(IRepository repository, string procedureToParse, ParameterDetector parameterDetector)
 {
     this.Repository = repository;
     this.ProcedureToParse = procedureToParse;
     this.ParameterDetector = parameterDetector;
 }