예제 #1
0
        public static void PostCommand(this IApplicationShell appShell, Guid guid, int id)
        {
            var uiShell = appShell.GlobalServices.GetService <IVsUIShell>(typeof(SVsUIShell));
            var o       = new object();

            uiShell.PostExecCommand(ref guid, (uint)id, 0, ref o);
        }
예제 #2
0
 public SendToRemoteCommand(ConfiguredProject configuredProject, IRInteractiveWorkflowProvider interactiveWorkflowProvider, IApplicationShell appShell) :
     base(interactiveWorkflowProvider, appShell, new FileSystem())
 {
     _configuredProject           = configuredProject;
     _interactiveWorkflowProvider = interactiveWorkflowProvider;
     _appShell = appShell;
 }
예제 #3
0
 private async Task RMarkdownRenderAsync(IRSession session, IFileSystem fs, string inputFilePath, string outputFilePath, string format, int codePage, IApplicationShell appShell) {
     using (var fts = new DataTransferSession(session, fs)) {
         string currentStatusText = string.Empty;
         uint cookie = 0;
         IVsStatusbar statusBar = null;
         appShell.DispatchOnUIThread(() => {
             statusBar = appShell.GetGlobalService<IVsStatusbar>(typeof(SVsStatusbar));
             statusBar.GetText(out currentStatusText);
             statusBar.Progress(ref cookie, 1, "", 0, 0);
         });
         
         try {
             // TODO: progress and cancellation handling
             appShell.DispatchOnUIThread(() => { statusBar?.Progress(ref cookie, 1, Resources.Info_MarkdownSendingInputFile.FormatInvariant(Path.GetFileName(inputFilePath)), 0, 3); });
             var rmd = await fts.SendFileAsync(inputFilePath, true, null, CancellationToken.None);
             appShell.DispatchOnUIThread(() => { statusBar?.Progress(ref cookie, 1, Resources.Info_MarkdownPublishingFile.FormatInvariant(Path.GetFileName(inputFilePath)), 1, 3); });
             var publishResult = await session.EvaluateAsync<ulong>($"rtvs:::rmarkdown_publish(blob_id = {rmd.Id}, output_format = {format.ToRStringLiteral()}, encoding = 'cp{codePage}')", REvaluationKind.Normal);
             appShell.DispatchOnUIThread(() => { statusBar?.Progress(ref cookie, 1, Resources.Info_MarkdownGetOutputFile.FormatInvariant(Path.GetFileName(outputFilePath)), 2, 3); });
             await fts.FetchFileAsync(new RBlobInfo(publishResult), outputFilePath, true, null, CancellationToken.None);
             appShell.DispatchOnUIThread(() => { statusBar?.Progress(ref cookie, 1, Resources.Info_MarkdownPublishComplete.FormatInvariant(Path.GetFileName(outputFilePath)), 3, 3); });
         } finally {
             appShell.DispatchOnUIThread(() => {
                 statusBar?.Progress(ref cookie, 0, "", 0, 0);
                 statusBar?.SetText(currentStatusText);
             });
         }
     }
 }
예제 #4
0
 public static IntPtr GetDialogOwnerWindow(this IApplicationShell appShell)
 {
     IntPtr vsWindow;
     var uiShell = appShell.GetGlobalService<IVsUIShell>(typeof(SVsUIShell));
     uiShell.GetDialogOwnerHwnd(out vsWindow);
     return vsWindow;
 }
        public void When_application_context_is_started_it_will_initialized_all_the_module_loader()
        {
            MockRepository            mocks       = new MockRepository();
            IModuleLoader             mockLoader1 = mocks.DynamicMock <IModuleLoader>();
            IModuleLoader             mockLoader2 = mocks.DynamicMock <IModuleLoader>();
            IModuleLoader             mockLoader3 = mocks.DynamicMock <IModuleLoader>();
            IApplicationShell         stubShell   = mocks.Stub <IApplicationShell>();
            DefaultApplicationContext context     = mocks.PartialMock <DefaultApplicationContext>(
                stubShell,
                mocks.DynamicMock <ILayoutRegistry>(),
                new IModuleLoader[] { mockLoader1, mockLoader2, mockLoader3 });

            //we may have order dependnecies, let us verify
            //that it does this in order
            using (mocks.Record())
                using (mocks.Ordered())
                {
                    mockLoader1.Initialize(context, stubShell);
                    mockLoader2.Initialize(context, stubShell);
                    mockLoader3.Initialize(context, stubShell);
                }

            using (mocks.Playback())
            {
                context.Start();
            }
        }
예제 #6
0
 public LoadWorkspaceCommand(IApplicationShell appShell, IRInteractiveWorkflow interactiveWorkflow, IProjectServiceAccessor projectServiceAccessor) :
     base(RGuidList.RCmdSetGuid, RPackageCommandId.icmdLoadWorkspace) {
     _appShell = appShell;
     _interactiveWorkflow = interactiveWorkflow;
     _rSession = interactiveWorkflow.RSession;
     _projectServiceAccessor = projectServiceAccessor;
 }
예제 #7
0
 public SaveHistoryCommand(IApplicationShell appShell, ITextView textView, IRHistoryProvider historyProvider, IRInteractiveWorkflow interactiveWorkflow)
     : base(textView, RGuidList.RCmdSetGuid, RPackageCommandId.icmdSaveHistory, false)
 {
     _appShell            = appShell;
     _interactiveWorkflow = interactiveWorkflow;
     _history             = historyProvider.GetAssociatedRHistory(textView);
 }
예제 #8
0
 public SProcPublisherTest(PackageTestFilesFixture files)
 {
     _files       = files;
     _appShell    = Substitute.For <IApplicationShell>();
     _pss         = Substitute.For <IProjectSystemServices>();
     _dacServices = Substitute.For <IDacPackageServices>();
 }
예제 #9
0
 public PublishSProcCommand(IApplicationShell appShell, IProjectSystemServices pss, IFileSystem fs, IDacPackageServicesProvider dacServicesProvider, ISettingsStorage settings) {
     _appShell = appShell;
     _pss = pss;
     _fs = fs;
     _dacServicesProvider = dacServicesProvider;
     _settings = settings;
 }
예제 #10
0
 public static void Apply(IApplicationShell current)
 {
     OverrideBrushes();
     OverrideFontKeys();
     OverrideImageSources(current);
     OverrideStyleKeys();
 }
예제 #11
0
 public PreviewWordCommand(
     ITextView textView,
     IRInteractiveWorkflowProvider workflowProvider,
     IApplicationShell appShell,
     IProcessServices pss,
     IFileSystem fs) :
     base(textView, (int)MdPackageCommandId.icmdPreviewWord, workflowProvider, appShell, pss, fs) { }
예제 #12
0
        public GameConsole(Game game)
            : base(game)
        {
            appShell = (IApplicationShell)game;

            messages = new List <Message>();
        }
예제 #13
0
 public PublishSProcOptionsCommand(IApplicationShell appShell, IProjectSystemServices pss, IProjectConfigurationSettingsProvider pcsp, IDacPackageServicesProvider dacServicesProvider)
 {
     _appShell            = appShell;
     _pss                 = pss;
     _pcsp                = pcsp;
     _dacServicesProvider = dacServicesProvider;
 }
예제 #14
0
 public ApplicationView(IApplicationShell applicationShell)
 {
     this.InitializeComponent();
     this.DataContext = applicationShell;
     RadWindowInteropHelper.SetShowInTaskbar(this, true);
     RadWindowInteropHelper.SetTitle(this, this.Header.ToString());
 }
예제 #15
0
 public SProcPublisher(IApplicationShell appShell, IProjectSystemServices pss, IFileSystem fs, IDacPackageServices dacServices) {
     _appShell = appShell;
     _pss = pss;
     _fs = fs;
     _dacServices = dacServices;
     _outputWindow = new OutputWindowLogWriter(VSConstants.OutputWindowPaneGuid.BuildOutputPane_guid, string.Empty);
 }
예제 #16
0
 public PublishSProcCommand(IApplicationShell appShell, IProjectSystemServices pss, IFileSystem fs, IDacPackageServicesProvider dacServicesProvider)
 {
     _appShell            = appShell;
     _pss                 = pss;
     _fs                  = fs;
     _dacServicesProvider = dacServicesProvider;
 }
예제 #17
0
        public static async Task <SqlPublshOptionsDialog> CreateAsync(
            IApplicationShell appShell, IProjectSystemServices pss, IFileSystem fs, IProjectConfigurationSettingsProvider pcsp, ISettingsStorage settings)
        {
            var dialog = new SqlPublshOptionsDialog(appShell, pss, fs, pcsp, settings);
            await dialog.InitializeModelAsync();

            return(dialog);
        }
예제 #18
0
 public LoadWorkspaceCommand(IApplicationShell appShell, IRInteractiveWorkflow interactiveWorkflow, IProjectServiceAccessor projectServiceAccessor) :
     base(RGuidList.RCmdSetGuid, RPackageCommandId.icmdLoadWorkspace)
 {
     _appShell               = appShell;
     _interactiveWorkflow    = interactiveWorkflow;
     _rSession               = interactiveWorkflow.RSession;
     _projectServiceAccessor = projectServiceAccessor;
 }
예제 #19
0
        private SqlPublshOptionsDialog(IApplicationShell appShell, IProjectSystemServices pss, IFileSystem fs, IProjectConfigurationSettingsProvider pcsp, ISettingsStorage settings) {
            _appShell = appShell;
            _pss = pss;
            _pcsp = pcsp;
            _settings = settings;

            Title = Package.Resources.SqlPublishDialog_Title;
        }
예제 #20
0
        private static void OverrideImageSources(IApplicationShell shell)
        {
            IVsImageService2 imageService = shell.GetGlobalService <IVsImageService2>(typeof(SVsImageService));

            ImageSources.Add      = GetImage(imageService, KnownMonikers.Add);
            ImageSources.Edit     = GetImage(imageService, KnownMonikers.Edit);
            ImageSources.Property = GetImage(imageService, KnownMonikers.Property);
        }
예제 #21
0
 public SProcPublisher(IApplicationShell appShell, IProjectSystemServices pss, IFileSystem fs, IDacPackageServices dacServices)
 {
     _appShell     = appShell;
     _pss          = pss;
     _fs           = fs;
     _dacServices  = dacServices;
     _outputWindow = new OutputWindowLogWriter(VSConstants.OutputWindowPaneGuid.BuildOutputPane_guid, string.Empty);
 }
예제 #22
0
        private SqlPublshOptionsDialog(IApplicationShell appShell, IProjectSystemServices pss, IFileSystem fs, IProjectConfigurationSettingsProvider pcsp)
        {
            _appShell = appShell;
            _pss      = pss;
            _pcsp     = pcsp;

            Title = Package.Resources.SqlPublishDialog_Title;
        }
예제 #23
0
 public PreviewWordCommand(
     ITextView textView,
     IRInteractiveWorkflowProvider workflowProvider,
     IApplicationShell appShell,
     IProcessServices pss,
     IFileSystem fs) :
     base(textView, (int)MdPackageCommandId.icmdPreviewWord, workflowProvider, appShell, pss, fs)
 {
 }
예제 #24
0
        public static async Task<SqlPublshOptionsDialog> CreateAsync(
            IApplicationShell appShell, IProjectSystemServices pss, IProjectConfigurationSettingsProvider pcsp, ISettingsStorage settings) {
            var dialog = await CreateAsync(appShell, pss, new FileSystem(), pcsp, settings);

            await appShell.SwitchToMainThreadAsync();
            dialog.InitializeComponent();
            dialog.InitializeUI();
            return dialog;
        }
예제 #25
0
 public PublishSProcOptionsCommand(IApplicationShell appShell, IProjectSystemServices pss, 
                                   IProjectConfigurationSettingsProvider pcsp, IDacPackageServicesProvider dacServicesProvider,
                                   ISettingsStorage settings) {
     _appShell = appShell;
     _pss = pss;
     _pcsp = pcsp;
     _dacServicesProvider = dacServicesProvider;
     _settings = settings;
 }
 public VsRInteractiveWindowComponentContainerFactory(
     Lazy <IVsInteractiveWindowFactory> vsInteractiveWindowFactory,
     IContentTypeRegistryService contentTypeRegistryService,
     IApplicationShell shell)
 {
     _vsInteractiveWindowFactoryLazy = vsInteractiveWindowFactory;
     _contentTypeRegistryService     = contentTypeRegistryService;
     _shell = shell;
 }
예제 #27
0
        public SettingsPageControl(IProjectConfigurationSettingsProvider settingsProvider, IApplicationShell appShell, IFileSystem fs) {
            Check.ArgumentNull(nameof(settingsProvider), settingsProvider);
            Check.ArgumentNull(nameof(appShell), appShell);
            Check.ArgumentNull(nameof(fs), fs);

            _settingsProvider = settingsProvider;
            _appShell = appShell;
            _fs = fs;
            InitializeComponent();
        }
예제 #28
0
 public async Task PublishAsync(IRSession session, IApplicationShell appShell,  IFileSystem fs, string inputFilePath, string outputFilePath, PublishFormat publishFormat, Encoding encoding) {
     try {
         await RMarkdownRenderAsync(session, fs, inputFilePath, outputFilePath, GetDocumentTypeString(publishFormat), encoding.CodePage, appShell);
     } catch (IOException ex) {
         await appShell.ShowErrorMessageAsync(ex.Message);
     } catch (RException ex) {
         await appShell.ShowErrorMessageAsync(ex.Message);
     } catch (OperationCanceledException) {
     } 
 }
예제 #29
0
 public DefaultApplicationContext(
     IApplicationShell shell,
     ILayoutRegistry layouts,
     IModuleLoader[] loaders
     )
 {
     this.shell   = shell;
     this.layouts = layouts;
     this.loaders = loaders;
 }
		public DefaultApplicationContext(
			IApplicationShell shell,
            ILayoutRegistry layouts,
			IModuleLoader[] loaders
			)
		{
			this.shell = shell;
            this.layouts = layouts;
			this.loaders = loaders;
		}
예제 #31
0
            public void Constructor_WhenCalled_ShouldInitializeTheMandatoryBadWordList()
            {
                // Arrange
                IApplicationShell subject = fixture.Create <BadWordConsoleApplication>();

                // Act
                subject.Run(ignoreFiltering);

                // Assert
                badWordResolverMock.Verify(x => x.AddBadWords(It.Is <BadWord[]>(badwords => CheckMandatoryBadWordsContained(badwords))), Times.Once);
            }
예제 #32
0
            public void Run_WhenCalledWithFiltering_ShouldCallBadWordFilter()
            {
                // Arrange
                IApplicationShell subject = fixture.Create <BadWordConsoleApplication>();

                // Act
                subject.Run(ignoreFiltering: false);

                // Assert
                badWordResolverMock.Verify(x => x.Filter(It.IsAny <string>()), Times.Once);
            }
예제 #33
0
        public SettingsPageControl(IProjectConfigurationSettingsProvider settingsProvider, IApplicationShell appShell, IFileSystem fs)
        {
            Check.ArgumentNull(nameof(settingsProvider), settingsProvider);
            Check.ArgumentNull(nameof(appShell), appShell);
            Check.ArgumentNull(nameof(fs), fs);

            _settingsProvider = settingsProvider;
            _appShell         = appShell;
            _fs = fs;
            InitializeComponent();
        }
예제 #34
0
            public void Run_WhenCalledWithFilteringTurnedOff_ShouldNotUtiliseBadWordFilter()
            {
                // Arrange
                IApplicationShell subject = fixture.Create <BadWordConsoleApplication>();

                // Act
                subject.Run(ignoreFiltering: true);

                // Assert
                badWordResolverMock.Verify(x => x.Filter(It.IsAny <string>()), Times.Never);
            }
예제 #35
0
        public static async Task <SqlPublshOptionsDialog> CreateAsync(
            IApplicationShell appShell, IProjectSystemServices pss, IProjectConfigurationSettingsProvider pcsp, ISettingsStorage settings)
        {
            var dialog = await CreateAsync(appShell, pss, new FileSystem(), pcsp, settings);

            await appShell.SwitchToMainThreadAsync();

            dialog.InitializeComponent();
            dialog.InitializeUI();
            return(dialog);
        }
예제 #36
0
 public PreviewHtmlCommand(
     ITextView textView,
     IRInteractiveWorkflowProvider workflowProvider,
     IApplicationShell appShell,
     IProcessServices pss,
     IFileSystem fs,
     IWebBrowserServices wbs)
     : base(textView, (int)MdPackageCommandId.icmdPreviewHtml,
           workflowProvider, appShell, pss, fs) {
     _wbs = wbs;
 }
예제 #37
0
 public async Task PublishAsync(IRSession session, IApplicationShell appShell, IFileSystem fs, string inputFilePath, string outputFilePath, PublishFormat publishFormat, Encoding encoding)
 {
     try {
         await RMarkdownRenderAsync(session, fs, inputFilePath, outputFilePath, GetDocumentTypeString(publishFormat), encoding.CodePage, appShell);
     } catch (IOException ex) {
         await appShell.ShowErrorMessageAsync(ex.Message);
     } catch (RException ex) {
         await appShell.ShowErrorMessageAsync(ex.Message);
     } catch (OperationCanceledException) {
     }
 }
예제 #38
0
 public static Font GetUiFont(this IApplicationShell appShell)
 {
     var fontSvc = appShell.GetGlobalService<IUIHostLocale2>(typeof(SUIHostLocale));
     if (fontSvc != null) {
         var logFont = new UIDLGLOGFONT[1];
         int hr = fontSvc.GetDialogFont(logFont);
         if (hr == VSConstants.S_OK && logFont[0].lfFaceName != null) {
             return IdeUtilities.FontFromUiDialogFont(logFont[0]);
         }
     }
     return null;
 }
예제 #39
0
 public PreviewHtmlCommand(
     ITextView textView,
     IRInteractiveWorkflowProvider workflowProvider,
     IApplicationShell appShell,
     IProcessServices pss,
     IFileSystem fs,
     IWebBrowserServices wbs)
     : base(textView, (int)MdPackageCommandId.icmdPreviewHtml,
            workflowProvider, appShell, pss, fs)
 {
     _wbs = wbs;
 }
예제 #40
0
        public MainWindow(IApplicationShell shell)
        {
            Content = shell;

            CanClose = (() => true);
            Closing += (s, e) => e.Cancel = !CanClose();
            ;

            WindowStartupLocation = WindowStartupLocation.CenterOwner;
            WindowState = WindowState.Maximized;
            Height = 800;
            Width = 1200;
        }
예제 #41
0
        public MainWindow(IApplicationShell shell)
        {
            Content = shell;

            CanClose = (() => true);
            Closing += (s, e) => e.Cancel = !CanClose();

            Closed += (s, e) => Application.Current.Shutdown();

            WindowStartupLocation = WindowStartupLocation.CenterOwner;
            WindowState           = WindowState.Maximized;
            Height = 800;
            Width  = 1200;
        }
예제 #42
0
        public PreviewCommand(ITextView textView, int id,
            IRInteractiveWorkflowProvider workflowProvider,
            IApplicationShell appShell,
            IProcessServices pss,
            IFileSystem fs)
            : base(textView, new CommandId[] { new CommandId(MdPackageCommandId.MdCmdSetGuid, id) }, false) {
            _workflowProvider = workflowProvider;
            AppShell = appShell;
            _pss = pss;
            _fs = fs;

            IEnumerable<Lazy<IMarkdownFlavorPublishHandler>> handlers = AppShell.ExportProvider.GetExports<IMarkdownFlavorPublishHandler>();
            foreach (var h in handlers) {
                _flavorHandlers[h.Value.Flavor] = h.Value;
            }
        }
예제 #43
0
파일: CsvAppFileIO.cs 프로젝트: jflam/RTVS
        public static async Task OpenDataCsvApp(IREvaluationResultInfo result, IApplicationShell appShell, IFileSystem fileSystem, IProcessServices processServices)
        {
            await appShell.SwitchToMainThreadAsync();

            if (Interlocked.Exchange(ref _busy, 1) > 0)
            {
                return;
            }

            var workflow = appShell.ExportProvider.GetExportedValue <IRInteractiveWorkflowProvider>().GetOrCreate();
            var session  = workflow.RSession;

            var folder = GetTempCsvFilesFolder();

            if (!Directory.Exists(folder))
            {
                Directory.CreateDirectory(folder);
            }

            var pss          = appShell.ExportProvider.GetExportedValue <IProjectSystemServices>();
            var variableName = result.Name ?? _variableNameReplacement;
            var csvFileName  = MakeCsvFileName(appShell, pss, variableName);

            var file = pss.GetUniqueFileName(folder, csvFileName, "csv", appendUnderscore: true);

            string currentStatusText;
            var    statusBar = appShell.GetGlobalService <IVsStatusbar>(typeof(SVsStatusbar));

            statusBar.GetText(out currentStatusText);

            try {
                statusBar.SetText(Resources.Status_WritingCSV);
                appShell.ProgressDialog.Show(async(p, ct) => await CreateCsvAndStartProcess(result, session, file, fileSystem, p), Resources.Status_WritingCSV, 100, 500);
                if (fileSystem.FileExists(file))
                {
                    processServices.Start(file);
                }
            } catch (Win32Exception ex) {
                appShell.ShowErrorMessage(string.Format(CultureInfo.InvariantCulture, Resources.Error_CannotOpenCsv, ex.Message));
            } catch (IOException ex) {
                appShell.ShowErrorMessage(string.Format(CultureInfo.InvariantCulture, Resources.Error_CannotOpenCsv, ex.Message));
            } finally {
                statusBar.SetText(currentStatusText);
            }

            Interlocked.Exchange(ref _busy, 0);
        }
예제 #44
0
        public ProjectSettingsControlTest(PackageTestFilesFixture files) {
            _files = files;
            _appShell = Substitute.For<IApplicationShell>();
            _fs = Substitute.For<IFileSystem>();

            _access = Substitute.For<IProjectConfigurationSettingsAccess>();
            _access.Settings.Returns(_coll);

            _csp = Substitute.For<IProjectConfigurationSettingsProvider>();
            _csp.OpenProjectSettingsAccessAsync(null, null).ReturnsForAnyArgs(Task.FromResult(_access));

            _unconfiguredProject = Substitute.For<UnconfiguredProject>();
            _unconfiguredProject.FullPath.Returns(@"C:\file.rproj");

            _properties = Substitute.For<IRProjectProperties>();
            _properties.GetSettingsFileAsync().Returns(Task.FromResult<string>(null));
        }
예제 #45
0
        public ProjectSettingsControlTest(PackageTestFilesFixture files)
        {
            _files    = files;
            _appShell = Substitute.For <IApplicationShell>();
            _fs       = Substitute.For <IFileSystem>();

            _access = Substitute.For <IProjectConfigurationSettingsAccess>();
            _access.Settings.Returns(_coll);

            _csp = Substitute.For <IProjectConfigurationSettingsProvider>();
            _csp.OpenProjectSettingsAccessAsync(null, null).ReturnsForAnyArgs(Task.FromResult(_access));

            _unconfiguredProject = Substitute.For <UnconfiguredProject>();
            _unconfiguredProject.FullPath.Returns(@"C:\file.rproj");

            _properties = Substitute.For <IRProjectProperties>();
            _properties.GetSettingsFileAsync().Returns(Task.FromResult <string>(null));
        }
        public VsRInteractiveWorkflowProvider(IConnectionManagerProvider connectionsProvider
            , IRHistoryProvider historyProvider
            , IRPackageManagerProvider packagesProvider
            , IRPlotManagerProvider plotsProvider
            , IActiveWpfTextViewTracker activeTextViewTracker
            , IDebuggerModeTracker debuggerModeTracker
            , IApplicationShell shell
            , IRSettings settings) {

            _connectionsProvider = connectionsProvider;
            _historyProvider = historyProvider;
            _packagesProvider = packagesProvider;
            _plotsProvider = plotsProvider;
            _activeTextViewTracker = activeTextViewTracker;
            _debuggerModeTracker = debuggerModeTracker;
            _shell = shell;
            _settings = settings;

            _shell.Terminating += OnApplicationTerminating;
        }
예제 #47
0
        public static async Task OpenDataCsvApp(IREvaluationResultInfo result, IApplicationShell appShell, IFileSystem fileSystem, IProcessServices processServices) {
            await appShell.SwitchToMainThreadAsync();

            if (Interlocked.Exchange(ref _busy, 1) > 0) {
                return;
            }

            var workflow = appShell.ExportProvider.GetExportedValue<IRInteractiveWorkflowProvider>().GetOrCreate();
            var session = workflow.RSession;

            var folder = GetTempCsvFilesFolder();
            if (!Directory.Exists(folder)) {
                Directory.CreateDirectory(folder);
            }

            var pss = appShell.ExportProvider.GetExportedValue<IProjectSystemServices>();
            var variableName = result.Name ?? _variableNameReplacement;
            var csvFileName = MakeCsvFileName(appShell, pss, variableName);

            var file = pss.GetUniqueFileName(folder, csvFileName, "csv", appendUnderscore: true);

            string currentStatusText;
            var statusBar = appShell.GetGlobalService<IVsStatusbar>(typeof(SVsStatusbar));
            statusBar.GetText(out currentStatusText);

            try {
                statusBar.SetText(Resources.Status_WritingCSV);
                appShell.ProgressDialog.Show(async (p, ct) => await CreateCsvAndStartProcess(result, session, file, fileSystem, p, ct), Resources.Status_WritingCSV, 100, 500);
                if (fileSystem.FileExists(file)) {
                    processServices.Start(file);
                }
            } catch (Exception ex) when (ex is Win32Exception || ex is IOException || ex is UnauthorizedAccessException) {
                appShell.ShowErrorMessage(string.Format(CultureInfo.InvariantCulture, Resources.Error_CannotOpenCsv, ex.Message));
            } finally {
                statusBar.SetText(currentStatusText);
            }

            Interlocked.Exchange(ref _busy, 0);
        }
예제 #48
0
 public VsFileDialog(IApplicationShell shell) {
     _shell = shell;
 }
예제 #49
0
 public SourceFilesCommand(ConfiguredProject configuredProject, IRInteractiveWorkflowProvider interactiveWorkflowProvider, IApplicationShell appShell) :
     base(interactiveWorkflowProvider, appShell, new FileSystem()) {
     _configuredProject = configuredProject;
     _interactiveWorkflowProvider = interactiveWorkflowProvider;
     _appShell = appShell;
 }
예제 #50
0
		public void Initialize(IApplicationContext context, IApplicationShell shell)
		{
			throw new NotImplementedException();
		}
예제 #51
0
 public SaveHistoryCommand(IApplicationShell appShell, ITextView textView, IRHistoryProvider historyProvider, IRInteractiveWorkflow interactiveWorkflow)
     : base(textView, RGuidList.RCmdSetGuid, RPackageCommandId.icmdSaveHistory, false) {
     _appShell = appShell;
     _interactiveWorkflow = interactiveWorkflow;
     _history = historyProvider.GetAssociatedRHistory(textView);
 }
예제 #52
0
		public void Initialize(IApplicationContext context, IApplicationShell shell)
		{
			shell.AddMenuItems(menuItemDatas);
		}
예제 #53
0
 public CommandTest() {
     _appShell = Substitute.For<IApplicationShell>();
     _pss = Substitute.For<IProjectSystemServices>();
 }
		public void Initialize(IApplicationContext context, IApplicationShell shell)
		{
			context.Layouts.AddView(mainContent);
		}
예제 #55
0
 public HideAllPlotWindowsCommand(IApplicationShell appShell) :
     base(RGuidList.RCmdSetGuid, RPackageCommandId.icmdPlotWindowsHideAll) {
     _appShell = appShell;
     _shell = appShell.GetGlobalService<IVsUIShell4>(typeof(SVsUIShell));
 }
예제 #56
0
 public ImportDataSetTextFileCommand(IApplicationShell appShell, IRSession session) :
     base(session, RGuidList.RCmdSetGuid, RPackageCommandId.icmdImportDatasetTextFile) {
     _appShell = appShell;
 }
예제 #57
0
 public static async Task<SqlPublshOptionsDialog> CreateAsync(
     IApplicationShell appShell, IProjectSystemServices pss, IFileSystem fs, IProjectConfigurationSettingsProvider pcsp, ISettingsStorage settings) {
     var dialog = new SqlPublshOptionsDialog(appShell, pss, fs, pcsp, settings);
     await dialog.InitializeModelAsync();
     return dialog;
 }
예제 #58
0
 public AddDsnCommand(IApplicationShell appShell, IRInteractiveWorkflow workflow) :
     base(RPackageCommandId.icmdAddDsn, workflow) {
     _appShell = appShell;
 }
예제 #59
0
 public PublishSProcCommand(IApplicationShell appShell, IProjectSystemServices pss, IDacPackageServicesProvider dacServicesProvider, ISettingsStorage settings) :
     this(appShell, pss, new FileSystem(), dacServicesProvider, settings) {
 }
예제 #60
0
 protected SendFileCommandBase(IRInteractiveWorkflowProvider interactiveWorkflowProvider, IApplicationShell appShell, IFileSystem fs) {
     _interactiveWorkflowProvider = interactiveWorkflowProvider;
     _appShell = appShell;
     _fs = fs;
 }