private void OnFileFolderBrowserCommandClick(object window) { var selectPathDialog = dialogFactory.GetSelectPathDialog(DirectoryItemType.File, methodFolderPath); var selectPathDialogResult = selectPathDialog.ShowDialog(); if (selectPathDialogResult.DialogOperationResult == true) { FileAttributes attributes = File.GetAttributes(selectPathDialogResult.SelectedFullPath); if (attributes.HasFlag(FileAttributes.Directory)) { this.CodeItemPath = selectPathDialogResult.SelectedFullPath; } else { this.CodeItemPath = Path.GetDirectoryName(selectPathDialogResult.SelectedFullPath); this.FileName = Path.GetFileNameWithoutExtension(selectPathDialogResult.SelectedFullPath); } } }