예제 #1
0
        private void MenuInstall_Click(object sender, RoutedEventArgs e)
        {
            List <string> pkgs = new List <string>();

            foreach (var item in PortsList.SelectedItems)
            {
                var port     = item as Port;
                var features = CheckedFeatures?.Where(feat => feat.CoreName == port.Name)
                               ?? Enumerable.Empty <FeatureParagraph>();
                if (features.Count() == 0)
                {
                    pkgs.Add($"{port.Name}:{CheckedTriplet}");
                }
                else
                {
                    var featstr = string.Join(",", features.Select(feat => feat.Name));
                    pkgs.Add($"{port.Name}[core,{featstr}]:{CheckedTriplet}");
                }
            }

            if (MessageBox.Show("Installing following packages:\n" + string.Join("\n", pkgs) + "\nAre you sure?", "Confirm",
                                MessageBoxButton.OKCancel,
                                MessageBoxImage.Question) == MessageBoxResult.OK)
            {
                // TODO: rebuild check. "--recursive" flag is needed for rebuild
                var code = ExecutionDialog.RunVcpkg("install " + string.Join(" ", pkgs), out string result, true);
            }
        }
예제 #2
0
 private void Feature_Unchecked(object sender, RoutedEventArgs e)
 => CheckedFeatures.Remove((sender as CheckBox).DataContext as FeatureParagraph);