コード例 #1
0
        private void Feature_RestoreDistro(object sender, EventArgs e)
        {
            using var dialog = new RestoreForm();

            if (dialog.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }

            var restoreRequest = dialog.ViewModel;

            if (restoreRequest == null)
            {
                return;
            }

            var process = WslHelpers.CreateImportDistroProcess(restoreRequest.NewName, restoreRequest.RestoreDirPath, restoreRequest.TarFilePath);

            process.Start();
            AppContext.RefreshDistroList();
        }
コード例 #2
0
        private void Feature_InstallDistro(object sender, EventArgs e)
        {
            using var dialog = new InstallForm();

            if (dialog.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }

            var installRequest = dialog.ViewModel;

            if (installRequest == null)
            {
                return;
            }

            var process = WslHelpers.CreateImportDistroProcess(installRequest.NewName, installRequest.InstallDirPath, installRequest.DownloadedTarFilePath);

            process.Start();
            AppContext.RefreshDistroList();
        }