Ejemplo n.º 1
0
 private void ProcessMenuCode(DataTable menuCodeDataTable)
 {
     foreach (DataRow dataRow in menuCodeDataTable.Rows)
     {
         // PROCEDURES
         FillMethods(dataRow, RegexManager.GetProcedureRegex(), 1, "Menu");
         // FUNCTIONS
         FillMethods(dataRow, RegexManager.GetFunctionRegex(), 2, "Menu");
     }
 }
Ejemplo n.º 2
0
        private void SearchDataTable(DataTable dataTable)
        {
            if (dataTable == null)
            {
                return;
            }

            bool isAtleastOneFileProcessed = false;

            foreach (DataRow dataRow in dataTable.Rows)
            {
                string fileName = dataRow[ProjectDetail.ColFileName].ConvertToString();
                string filePath = dataRow[ProjectDetail.ColFilePath].ConvertToString();

                if (Options.SearchInSelectedFiles)
                {
                    bool isFileFound = Options.FileDetails.FirstOrDefault(file => file.IsIncluded && file.FileName == fileName) != null;
                    if (!isFileFound)
                    {
                        continue;
                    }

                    isAtleastOneFileProcessed = true;
                }

                foreach (DataColumn dataColumn in dataTable.Columns)
                {
                    var columnValue = dataRow[dataColumn.ColumnName].ConvertToString();

                    if (columnValue == null)
                    {
                        continue;
                    }

                    if (IsSearchTextPresent(columnValue))
                    {
                        List <string> matchedContentList;
                        if (IsRegexMatchPresent(columnValue, RegexManager.GetProcedureRegex(), out matchedContentList))
                        {
                            foreach (string matchedContent in matchedContentList)
                            {
                                AddToResultsDataTable(dataColumn.ColumnName, matchedContent, fileName, filePath, dataRow);
                            }
                            //continue;
                        }
                        if (IsRegexMatchPresent(columnValue, RegexManager.GetFunctionRegex(), out matchedContentList))
                        {
                            foreach (string matchedContent in matchedContentList)
                            {
                                AddToResultsDataTable(dataColumn.ColumnName, matchedContent, fileName, filePath, dataRow);
                            }
                            //continue;
                        }
                        AddToResultsDataTable(dataColumn.ColumnName, columnValue, fileName, filePath, dataRow);
                    }
                }
            }

            if (Options.SearchInSelectedFiles && isAtleastOneFileProcessed == false)
            {
                var list = Options.FileDetails.Where(file => file.IsIncluded);
                if (list.Count() == 0)
                {
                    System.Diagnostics.Debugger.Break();
                }
            }
        }