示例#1
0
        public override CommandResult Invoke(Guid group, int id, object inputArg, ref object outputArg)
        {
            var initialPath = RToolsSettings.Current.WorkingDirectory != null?PathHelper.EnsureTrailingSlash(RToolsSettings.Current.WorkingDirectory) : null;

            var file = _appShell.BrowseForFileOpen(IntPtr.Zero, Resources.HistoryFileFilter, initialPath, Resources.LoadHistoryTitle);

            if (file != null)
            {
                _history.TryLoadFromFile(file);
            }

            return(CommandResult.Executed);
        }
示例#2
0
        protected override void Handle()
        {
            base.Handle();

            string filePath = _appShell.BrowseForFileOpen(
                IntPtr.Zero, Package.Resources.CsvFileFilter,
                title: Resources.ImportData_EnterTextFileTitle);

            if (!string.IsNullOrEmpty(filePath))
            {
                var dlg = new ImportDataWindow(filePath, null);
                dlg.ShowModal();
            }
        }
示例#3
0
        protected override void Handle()
        {
            var projectService    = _projectServiceAccessor.GetProjectService();
            var lastLoadedProject = projectService.LoadedUnconfiguredProjects.LastOrDefault();

            var initialPath = lastLoadedProject != null?lastLoadedProject.GetProjectDirectory() : Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

            var file = _appShell.BrowseForFileOpen(IntPtr.Zero, Resources.WorkspaceFileFilter, initialPath, Resources.LoadWorkspaceTitle);

            if (file == null)
            {
                return;
            }

            LoadWorkspace(_rSession, file).DoNotWait();
        }