PKStudio.PortingKitWrapper.SearchFiles C# (CSharp) Method

SearchFiles() private method

Serarchs files
private SearchFiles ( SearchWhere where, string what, bool MatchCase, bool MatchWholeWord ) : void
where SearchWhere
what string
MatchCase bool
MatchWholeWord bool
return void
        private void SearchFiles(SearchWhere where, string what, bool MatchCase, bool MatchWholeWord)
        {
            List<BuildFileWrapper> FilesList = new List<BuildFileWrapper>();

            List<LibraryWrapper> CheckedLibrariesList = new List<LibraryWrapper>();

            if ((where == SearchWhere.All) || (where == SearchWhere.PKDatabase))
            {
                foreach (LibraryWrapper LW in m_inv.Libraries)
                {
                    FilesList.Clear();

                    if (Solution != null)
                    {
                        if (Solution.IsReference(LW))
                        {
                            FilesList.AddRange(LW.FastCompileFiles);
                            FilesList.AddRange(LW.HeaderFiles);
                            FilesList.AddRange(LW.OtherFiles);
                            FilesList.AddRange(LW.SourceFiles);
                        }
                    }
                    else
                    {
                        FilesList.AddRange(LW.FastCompileFiles);
                        FilesList.AddRange(LW.HeaderFiles);
                        FilesList.AddRange(LW.OtherFiles);
                        FilesList.AddRange(LW.SourceFiles);
                    }

                    SearchResultsHolder.SearchComponentDescriptor LibraryDesc = new SearchResultsHolder.SearchComponentDescriptor(ComponentWrapper.GetComponentWrapper(LW));

                    foreach (BuildFileWrapper file in FilesList)
                    {
                        this.CheckFile(LibraryDesc, file, what, MatchCase, MatchWholeWord);
                    }
                }
            }

            if ((where == SearchWhere.All) || (where == SearchWhere.Solution))
            {
                if (Solution != null)
                {
                    foreach (ProjectWrapper PW in Solution.Projects)
                    {
                        foreach (ComponentWrapper CW in PW.Libraries)
                        {
                            LibraryWrapper LW = this.FindLibrary(CW.Guid);
                            if ((LW != null))// && (!Libs.Contains(LW)))
                            {

                                if (CheckedLibrariesList.Contains(LW)) continue;

                                CheckedLibrariesList.Add(LW);

                                FilesList.Clear();
                                FilesList.AddRange(LW.FastCompileFiles);
                                FilesList.AddRange(LW.HeaderFiles);
                                FilesList.AddRange(LW.OtherFiles);
                                FilesList.AddRange(LW.SourceFiles);

                                //SearchResultsHolder.ComponentDescriptor ProjectDesc = new SearchResultsHolder.ComponentDescriptor();
                                //ProjectDesc.Component = ComponentWrapper.GetComponentWrapper(PW);
                                //ProjectDesc.Parent = new SearchResultsHolder.ComponentDescriptor(null, ComponentWrapper.GetComponentWrapper(Solution));

                                //SearchResultsHolder.ComponentDescriptor LibraryDesc = new SearchResultsHolder.ComponentDescriptor(ProjectDesc, ComponentWrapper.GetComponentWrapper(LW));

                                SearchResultsHolder.SearchComponentDescriptor LibraryDesc = new SearchResultsHolder.SearchComponentDescriptor(new SearchResultsHolder.SearchComponentDescriptor(null, ComponentWrapper.GetComponentWrapper(Solution)), ComponentWrapper.GetComponentWrapper(LW));

                                if (!Solution.IsReference(LW))
                                {
                                    foreach (BuildFileWrapper file in FilesList)
                                    {
                                        this.CheckFile(LibraryDesc, file, what, MatchCase, MatchWholeWord);
                                    }
                                }
                            }
                        }
                    }
                }
            }




            //List<LibraryWrapper> Libs = new List<LibraryWrapper>();

            ////ProjectWrapper ParentProject = null;

            //switch (where)
            //{
            //    case SearchWhere.PKDatabase:
            //        Libs.AddRange(m_inv.Libraries);
            //        SearchFileInLibraryList(Libs, what, MatchCase, MatchWholeWord);
            //        break;
            //    case SearchWhere.Solution:
            //        if (Solution != null)
            //        {
            //            foreach (ProjectWrapper PW in Solution.Projects)
            //            {
            //                Libs.Clear();
            //                foreach (ComponentWrapper CW in PW.Libraries)
            //                {
            //                    LibraryWrapper LW = this.FindLibrary(CW);
            //                    if ((LW != null) && (!Libs.Contains(LW)))
            //                        Libs.Add(LW);
            //                }
            //                SearchFileInLibraryList(PW, Libs, what, MatchCase, MatchWholeWord);
            //            }
            //        }
            //        break;
            //}
        }
PortingKitWrapper