예제 #1
0
        private string GetDownloadFolderPath(string parentFolderPath)
        {
            var downloadFolderPath = _ioService.PathCombine(parentFolderPath, "Downloads");

            if (!_ioService.DirectoryExists(downloadFolderPath))
            {
                _ioService.CreateDirectory(downloadFolderPath);
            }
            return(downloadFolderPath);
        }
        public void Write(IEnumerable <DocumentMetadata> metadata, string fullName)
        {
            var invalid = string.IsNullOrWhiteSpace(fullName);

            if (invalid)
            {
                throw new ArgumentException($"'{fullName}' is not valid");
            }

            _ioService.CreateDirectory(_outputDirectory);

            var path = GetDerivedPath(fullName);
            var info = metadata.Select(m => new DocumentMetadataInfo
            {
                FullName           = m.FullName,
                ProjectDisplayName = m.ProjectNames.DisplayName,
                ProjectFullName    = m.ProjectNames.FullName
            });

            var json = JsonConvert.SerializeObject(info);

            using (var writer = _ioService.GetWriter(path))
            {
                writer.WriteLine(json);
            }
        }
예제 #3
0
        /// <inheritdoc />
        protected override void Execute(ApplicationDialogModel?viewModel, object?parameter)
        {
            if (!(viewModel?.Name is string applicationName))
            {
                return;
            }

            var directoryName = GetLogFolderPath(applicationName);

            if (!_ioService.DirectoryExists(directoryName))
            {
                _ioService.CreateDirectory(directoryName);
            }
            _uriService.OpenUri(directoryName);
        }