private void ButtonSaveClick(object sender, EventArgs e)
 {
     foreach (var partlist in _tmpModParts)
     {
         foreach (var mod in _tmpMC.Mods)
         {
             if (mod.Name != partlist.Key) continue;
             mod.Parts = ParsePartList(partlist.Value);
             mod.Prefixes = ParsePrefixList(partlist.Value);
             break;
         }
     }
     MC = _tmpMC;
 }
        private void EditModDialogLoad(object sender, EventArgs e)
        {
            if (MC == null) return;

            _fb = new FolderBrowserDialog();

            _tmpMC = MC.Clone();
            _tmpModParts = new Dictionary<string, string>();

            ReloadData();
        }
 private void ButtonCancelClick(object sender, EventArgs e)
 {
     _tmpMC = null;
     _tmpModParts = null;
 }
 public ModCollectionParser(ModCollection mc)
 {
     Collection = mc;
     if (Collection == null) Collection = new ModCollection();
 }
 public ModCollectionParser()
 {
     Collection = new ModCollection();
 }
 public ModCollection Clone()
 {
     var tmpMC = new ModCollection();
     foreach (var m in Mods)
     {
         tmpMC.Mods.Add(m.Clone());
     }
     return tmpMC;
 }
        private void MainWindowLoad(object sender, EventArgs e)
        {
            // Load Settings
            if (Settings.Default.TreeLocation != null && File.Exists(Settings.Default.TreeLocation))
            {
                _treeFile = Settings.Default.TreeLocation;
                buttonTreeLoad.Text = _treeFile;
            }
            var versionNr = Assembly.GetEntryAssembly().GetName().Version;
            Text = string.Format("{0}{1}.{2}.{3}", Resources.GUI_TitleLabel, versionNr.Major, versionNr.Minor, versionNr.Build);

            // Initialise tree
            if (_treeFile != null) InitialiseTree();
            // Initialise mod collection
            _mcp = new ModCollectionParser(_mc);
            _mcp.Load();
            _mc = _mcp.Collection;

            ReloadCheckList();
        }
        private void EditModToolStripMenuItemClick(object sender, EventArgs e)
        {
            using (var dialog = new EditModDialog())
            {
                dialog.MC = _mc;

                var result = dialog.ShowDialog();

                switch (result)
                {
                    case DialogResult.OK:
                        _mc = dialog.MC;
                        _mcp.Collection = dialog.MC;
                        ReloadCheckList();
                        _mcp.Save();
                        break;
                }
            }
        }