private void AddModToView(Mod mod)
 {
     CheckBox cb = new CheckBox();
     cb.IsChecked = mod.enabled;
     cb.Content = mod.dllName;
     cb.Click += new RoutedEventHandler(CheckBox_CheckedChanged);
     ModListBox.Items.Add(cb);
 }
        private Mod AddModToModel(string file)
        {
            bool modAlreadyAdded = false;
            Mod mod = new Mod();
            mod.init(file);
            mod.enabled = true;
            //TODO check for duplicate mods
            foreach (Mod addedMod in this.settings.mods)
            {
                if (mod.dllName == addedMod.dllName)
                    modAlreadyAdded = true;
            }

            if (!modAlreadyAdded)
            {
                this.settings.mods.Add(mod);
                return mod;
            }
            else
            {
                return null;
            }
        }