IEnumerator DoRegistryInspect() { //some dialog //open search mSearchKeyword = null; mSearchModalParms[SearchModal.parmTitle] = M8.Localize.Get(registrySearchTitleRef); mSearchModalParms[SearchModal.parmCallback] = (SearchModal.CommitCallback)OnSearchProceed; M8.ModalManager.main.Open(searchModal, mSearchModalParms); //wait for search while (M8.ModalManager.main.isBusy || M8.ModalManager.main.IsInStack(searchModal)) { yield return(null); } if (mSearchKeyword) { var searchProgressTitle = string.Format(M8.Localize.Get(registrySearchProgressTitleFormatRef), mSearchKeyword.key); //do progress yield return(StartCoroutine(DoSearchProgress(searchProgressTitle, searchProgressDelay))); //check if there is match if (mSearchKeyword.CheckResultSearch(SearchType.Registry)) { //open registry log modal M8.ModalManager.main.Open(registryModal, null); while (M8.ModalManager.main.isBusy || M8.ModalManager.main.IsInStack(registryModal)) { yield return(null); } //some dialog } else //show no match message { MessageModal.Open(searchProgressTitle, M8.Localize.Get(searchNoMatchTextRef)); while (M8.ModalManager.main.isBusy || M8.ModalManager.main.IsInStack(MessageModal.modal)) { yield return(null); } } //return to search StartCoroutine(DoRegistryInspect()); } }
IEnumerator DoFileInspect() { //some dialog //open search mSearchKeyword = null; mSearchModalParms[SearchModal.parmTitle] = M8.Localize.Get(fileInspectSearchTitleRef); mSearchModalParms[SearchModal.parmCallback] = (SearchModal.CommitCallback)OnSearchProceed; M8.ModalManager.main.Open(searchModal, mSearchModalParms); //wait for search while (M8.ModalManager.main.isBusy || M8.ModalManager.main.IsInStack(searchModal)) { yield return(null); } if (mSearchKeyword) { var searchProgressTitle = string.Format(M8.Localize.Get(fileInspectSearchProgressTitleFormatRef), mSearchKeyword.key); //do progress yield return(StartCoroutine(DoSearchProgress(searchProgressTitle, searchProgressDelay))); //check if there is match if (mSearchKeyword.CheckResultSearch(SearchType.File)) { //show search result mSearchResultIndex = -1; mSearchResultParms[SearchResultModal.parmSearchType] = SearchType.File; mSearchResultParms[SearchResultModal.parmSearchKeywordData] = mSearchKeyword; mSearchResultParms[SearchResultModal.parmProceedCallback] = (SearchResultModal.ProceedCallback)OnSearchResultProceed; M8.ModalManager.main.Open(searchResultModal, mSearchResultParms); //wait for search result while (M8.ModalManager.main.isBusy || M8.ModalManager.main.IsInStack(searchResultModal)) { yield return(null); } if (mSearchResultIndex != -1) { //open file inspect modal mFileInspectParms[FileInspectModal.parmSearchKeywordData] = mSearchKeyword; mFileInspectParms[FileInspectModal.parmSearchKeywordResultIndex] = mSearchResultIndex; M8.ModalManager.main.Open(fileInspectModal, mFileInspectParms); while (M8.ModalManager.main.isBusy || M8.ModalManager.main.IsInStack(fileInspectModal)) { yield return(null); } //some dialog } } else //show no match message { MessageModal.Open(searchProgressTitle, M8.Localize.Get(searchNoMatchTextRef)); while (M8.ModalManager.main.isBusy || M8.ModalManager.main.IsInStack(MessageModal.modal)) { yield return(null); } } //return to search StartCoroutine(DoFileInspect()); } }