Esempio n. 1
0
        /// <summary>
        /// Shows code browser window with provided filter selection.
        /// </summary>
        private bool ShowBrowser(CodeModelFilterFlags filter)
        {
            var fileName = _shellSelectionService.GetActiveFileName();

            if (string.IsNullOrEmpty(fileName))
            {
                return(false);
            }

            var languageSet = _languageService.GetExtensionLanguage(Path.GetExtension(fileName));

            if ((languageSet == null) || (languageSet.Type == LanguageType.Unknown))
            {
                _messageService.ShowError($"{this.Name} request cannot be processed.\r\n\r\nThis non-code file type is not supported.", false);
                return(true);
            }

            if (!_fileProcessor.IsDocumentValid(null, out _))
            {
                _messageService.ShowError($"{this.Name} request cannot be processed.\r\n\r\nFile code model cannot be determined.", false);
                return(true);
            }

            _dialogService.ShowDialog <CodeBrowserWindow, CodeBrowserViewModel>($"{this.Name}'s collecting file information...", filter);
            return(true);
        }