private void DownloadHTMLViewerBtnClicked()

in Tools/Apps/Microsoft.PowerApps.Tools.AppChangeFinder/ChangeFinderViewModel.cs [396:431]


        private void DownloadHTMLViewerBtnClicked(object obj)
        {
            //Validation
            if(ScreenList?.Count == 0)
            {
                MessageBoxButton button = MessageBoxButton.OK;
                System.Windows.MessageBox.Show("No result to save!", "Message", button);
                return;
            }
            string fileName = "AppChangeFinder";
            if (!string.IsNullOrEmpty(PathTxtBox))
            {
                string[] pathboxArray = PathTxtBox.Split('\\');
                fileName = PathTxtBox.Split('\\')[pathboxArray.Length - 1];
                fileName = fileName.Replace(".msapp", "");
            }
            fileName += "_CodeReview_" + DateTime.Now.ToString("MM_dd_yyyy");
            SaveFileDialog sfd = new SaveFileDialog
            {
                DefaultExt = ".htm",
                FileName = fileName,
                Filter = "HTML File (.html)|*.html|HTM Files(.htm)| *.htm"
            };
            if (sfd.ShowDialog() == DialogResult.OK && sfd.FileName.Length > 0)
            {
                File.WriteAllText(sfd.FileName, CovertToHTMLTable().ToString());

                if (!string.IsNullOrEmpty(sfd.FileName))
                {
                    //NavigationWindow window = new NavigationWindow();
                    //window.Source = new Uri(sfd.FileName);
                    //window.Show();
                    System.Diagnostics.Process.Start(sfd.FileName);
                }
            }
        }