public ExtractInterfaceOptionsResult GetExtractInterfaceOptions(ISyntaxFactsService syntaxFactsService, INotificationService notificationService, List <ISymbol> extractableMembers, string defaultInterfaceName, List <string> conflictingTypeNames, string defaultNamespace, string generatedNameTypeParameterSuffix, string languageName)
        {
            var dialog = new ExtractInterfaceDialog();

            try {
                dialog.Init(syntaxFactsService, notificationService, extractableMembers, defaultInterfaceName, conflictingTypeNames, defaultNamespace, generatedNameTypeParameterSuffix, languageName);
                bool performChange = dialog.Run() == Xwt.Command.Ok;
                if (!performChange)
                {
                    return(ExtractInterfaceOptionsResult.Cancelled);
                }

                return(new ExtractInterfaceOptionsResult(false, dialog.IncludedMembers, dialog.InterfaceName, dialog.FileName));
            } catch (Exception ex) {
                LoggingService.LogError("Error while signature changing.", ex);
                return(ExtractInterfaceOptionsResult.Cancelled);
            } finally {
                dialog.Dispose();
            }
        }
        public async Task <ExtractInterfaceOptionsResult> GetExtractInterfaceOptionsAsync(
            ISyntaxFactsService syntaxFactsService,
            INotificationService notificationService,
            List <ISymbol> extractableMembers,
            string defaultInterfaceName,
            List <string> conflictingTypeNames,
            string defaultNamespace,
            string generatedNameTypeParameterSuffix,
            string languageName)
        {
            await threadingContext.JoinableTaskFactory.SwitchToMainThreadAsync();

            var dialog = new ExtractInterfaceDialog();

            dialog.Init(
                syntaxFactsService,
                notificationService,
                extractableMembers,
                defaultInterfaceName,
                conflictingTypeNames,
                defaultNamespace,
                generatedNameTypeParameterSuffix,
                languageName);

            bool performChange = dialog.Run() == Xwt.Command.Ok;

            if (!performChange)
            {
                return(ExtractInterfaceOptionsResult.Cancelled);
            }

            return(new ExtractInterfaceOptionsResult(
                       false,
                       dialog.IncludedMembers.AsImmutable(),
                       dialog.InterfaceName,
                       dialog.FileName,
                       dialog.UseSameFile
                                        ? ExtractInterfaceOptionsResult.ExtractLocation.SameFile
                                        : ExtractInterfaceOptionsResult.ExtractLocation.NewFile
                       ));
        }