示例#1
0
        public override CommandResult Invoke(Guid group, int id, object inputArg, ref object outputArg)
        {
            var settings    = _interactiveWorkflow.Shell.GetService <IRSettings>();
            var initialPath = settings.WorkingDirectory != null?PathHelper.EnsureTrailingSlash(settings.WorkingDirectory) : null;

            var file = _interactiveWorkflow.Shell.FileDialog().ShowOpenFileDialog(Resources.HistoryFileFilter, initialPath, Resources.LoadHistoryTitle);

            if (file != null)
            {
                _history.TryLoadFromFile(file);
            }
            return(CommandResult.Executed);
        }
示例#2
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.FileDialog.ShowOpenFileDialog(Resources.HistoryFileFilter, initialPath, Resources.LoadHistoryTitle);

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

            return(CommandResult.Executed);
        }
示例#3
0
        internal string GetFullPathName(string friendlyName)
        {
            string folder = friendlyName;

            if (friendlyName == null)
            {
                return(folder);
            }

            if (!friendlyName.StartsWithIgnoreCase("~"))
            {
                return(folder);
            }

            if (friendlyName.EqualsIgnoreCase("~"))
            {
                return(UserDirectory);
            }

            return(PathHelper.MakeRooted(PathHelper.EnsureTrailingSlash(UserDirectory), friendlyName.Substring(2)));
        }