Exemple #1
0
        private void RunCustomNavigation(string methodFqn)
        {
            var typeName   = PsiNavigationHelper.GetLongNameFromFqn(methodFqn);
            var methodName = PsiNavigationHelper.GetShortNameFromFqn(methodFqn);
            var customType = Type.GetType(typeName);

            if (customType == null)
            {
                throw new ApplicationException("Unknown custom navigation class. Try reinstalling the plugin.");
            }
            var navMethod = customType.GetMethod(methodName);

            if (navMethod == null)
            {
                throw new ApplicationException("Unknown custom navigation method. Try reinstalling the plugin.");
            }
            var parameterArray = new object[] { _solution, _editorManager, _documentManager };
            var customInst     = Activator.CreateInstance(customType, parameterArray);

            _shellLocks.ExecuteOrQueueReadLock(_lifetime, "Navigate",
                                               () => { _psiFiles.CommitAllDocumentsAsync(() => { navMethod.Invoke(customInst, null); }); });
        }