コード例 #1
0
        private void AddButton_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();

            dialog.InitialDirectory = MinecartProfile.modsDirName;
            dialog.Multiselect      = true;
            dialog.ShowDialog();
            foreach (var item in dialog.FileNames)
            {
                Mod mod = new Mod(item);
                if (profile.GetMod(item) == null)
                {
                    profile.mods.Add(mod);
                    ObjectsListBox.Items.Add(mod.Name);
                }
            }
            profile.SaveSettings();
        }
コード例 #2
0
 public MainWindow()
 {
     InitializeComponent();
     if (!MinecartProfile.Exists())
     {
         profile = new MinecartProfile();
     }
     profile                = MinecartProfile.LoadProfile();
     PathTextBox.Text       = profile.gamedir;
     PathTextBox.IsReadOnly = true;
     profile.SaveSettings();
     foreach (var pack in profile.modpacks)
     {
         ModpacksListBox.Items.Add(pack.Name);
     }
     EditModpackButton.IsEnabled = false;
     DeployButton.IsEnabled      = false;
 }
コード例 #3
0
 private void CheckPathButton_Click(object sender, RoutedEventArgs e)
 {
     profile.gamedir = PathTextBox.Text;
     profile.SaveSettings();
 }