Esempio n. 1
0
        private async Task <OpenWithDialogResult> ShowOpenWithDialogAsync(string fullPath)
        {
            var fileExtension       = _pathService.GetExtension(fullPath);
            var selectedApplication = _openWithApplicationService.GetSelectedApplication(fileExtension);
            var parameter           = new OpenWithNavigationParameter(fileExtension, selectedApplication);

            return(await _dialogService.ShowDialogAsync <OpenWithDialogResult, OpenWithNavigationParameter>(
                       nameof(OpenWithDialogViewModel), parameter));
        }
Esempio n. 2
0
        public void Open(string resource)
        {
            var extension           = _pathService.GetExtension(resource);
            var selectedApplication = _openWithApplicationService.GetSelectedApplication(extension);

            if (selectedApplication is null)
            {
                _resourceOpeningService.Open(resource);
            }
            else
            {
                _resourceOpeningService.OpenWith(selectedApplication.ExecutePath, selectedApplication.Arguments,
                                                 resource);
            }
        }