github.com/simonferquel/app@v0.6.1-0.20181012141724-68b7cccf26ac/integrations/visualstudio/dockerappvsix/SettingsDialog.xaml.cs (about)

     1  using Microsoft.VisualStudio.PlatformUI;
     2  using System;
     3  using System.Collections.Generic;
     4  using System.Linq;
     5  using System.Text;
     6  using System.Threading.Tasks;
     7  using System.Windows;
     8  using System.Windows.Controls;
     9  using System.Windows.Data;
    10  using System.Windows.Documents;
    11  using System.Windows.Input;
    12  using System.Windows.Media;
    13  using System.Windows.Media.Imaging;
    14  using System.Windows.Navigation;
    15  using System.Windows.Shapes;
    16  
    17  namespace dockerappvsix
    18  {
    19      /// <summary>
    20      /// Interaction logic for SettingsDialog.xaml
    21      /// </summary>
    22      public partial class SettingsDialog : DialogWindow
    23      {
    24          public SettingsDialog()
    25          {
    26              InitializeComponent();
    27          }
    28  
    29          public AppPackageSettings Settings
    30          {
    31              get
    32              {
    33                  return DataContext as AppPackageSettings;
    34              }
    35          }
    36  
    37          private void OkClick(object sender, RoutedEventArgs e)
    38          {
    39              DialogResult = true;
    40              Close();
    41          }
    42  
    43          private void CancelClick(object sender, RoutedEventArgs e)
    44          {
    45              DialogResult = false;
    46              Close();
    47          }
    48  
    49          private void OnBrowse(object sender, RoutedEventArgs e)
    50          {
    51              var baseFile = Settings.KubeConfig;
    52              var ofd = new Microsoft.Win32.OpenFileDialog();
    53              ofd.FileName = baseFile;
    54              if (ofd.ShowDialog() ?? false) {
    55                  Settings.KubeConfig = ofd.FileName;
    56              }
    57          }
    58      }
    59  }