Exemplo n.º 1
0
        //---------------------------------------------------------------------------

        private void btCancelClick(object sender, EventArgs e)
        {       // Lade wieder das eingestellte Preismodell
            if (CraftCurrent != null)
            {
                Unit.xml_config.OpenConfig(Unit.xml_config.arMenuItems[Utils.ConvertTagToInt(CraftCurrent.Tag)].FileName);
            }
            TMCapView.UpdateColors(); // Stelle wieder die Farben zurück
            TMCapView.UpdateFormat(); // Stelle wieder Formatierung zurück
        }
Exemplo n.º 2
0
        //---------------------------------------------------------------------------

        private void btOkClick(object sender, EventArgs e)
        {
            Utils.SetRegistryInteger("UpdateMode", rgUpdateMode.ItemIndex);
            Utils.SetRegistryInteger("OverwriteItems", cbOverwriteItems.Checked ? 1 : 0);
            Utils.SetRegistryInteger("UseProxy", cbUseProxy.Checked ? 1 : 0);
            Utils.SetRegistryInteger("AlternateLogin", cbAlternateLogin.Checked ? 1 : 0);
            Utils.SetRegistryString("ProxyServer", edServer.Text);
            Utils.SetRegistryString("ProxyPort", edPort.Text);
            Utils.SetRegistryString("ProxyUser", edUser.Text);
            Utils.SetRegistryString("ProxyPasswd", edPasswd.Text);
            Utils.SetRegistryInteger("IPWorkaround", cbIPWorkaround.Checked ? 1 : 0);
            Utils.SetRegistryInteger("CalcTotalUtility", cbCalcTotalUtility.Checked ? 1 : 0);
            Utils.SetRegistryInteger("ItemPreview", cbItemPreview.Checked ? 1 : 0);
            Utils.SetRegistryInteger("WikiHelp", cbWikiHelp.Checked ? 1 : 0);
            Utils.SetRegistryInteger("LoadChars", cbLoadChars.Checked ? 1 : 0);
            Utils.SetRegistryInteger("CheckForUpdate", cbCheckForUpdate.Checked ? 1 : 0);
            Utils.SetRegistryInteger("ProcessPriority", cbProcess.Checked ? 1 : 0);
            Utils.SetRegistryInteger("UpdateIntervall", rgUpdateIntervall.ItemIndex);

            Utils.SetRegistryInteger("StatDisplayMode", rgStatDisplay.ItemIndex);
            Utils.SetRegistryString("StatDisplayFormula", edDisplayStatFormula.Text);
            Utils.SetRegistryInteger("StatDisplayFloorCol", (int)Utils.Color2Int(shFloorCol.BackColor));
            Utils.SetRegistryInteger("StatDisplayCapCol", (int)Utils.Color2Int(shCapCol.BackColor));
            Utils.SetRegistryInteger("StatDisplayCapIncCol", (int)Utils.Color2Int(shCapIncCol.BackColor));
            Utils.SetRegistryInteger("StatDisplayCapAddCol", (int)Utils.Color2Int(shCapAddCol.BackColor));
            Utils.SetRegistryInteger("StatDisplayCapSubCol", (int)Utils.Color2Int(shCapSubCol.BackColor));
            Utils.SetRegistryInteger("StatDisplayValueCol", (int)Utils.Color2Int(shValueCol.BackColor));
            Utils.SetRegistryInteger("StatDisplayValueAddCol", (int)Utils.Color2Int(shValueAddCol.BackColor));
            Utils.SetRegistryInteger("StatDisplayValueSubCol", (int)Utils.Color2Int(shValueSubCol.BackColor));
            Utils.SetRegistryInteger("StatDisplayTextCol", (int)Utils.Color2Int(shTextCol.BackColor));
            Utils.SetRegistryInteger("StatDisplayTextMouseOverColCol", (int)Utils.Color2Int(shTextMouseOverCol.BackColor));
            TMCapView.UpdateColors();
            TMCapView.UpdateFormat();

            // gewähltes Preismodell speichern
            Unit.xml_config.SavePriceModel(cbPriceModel.CurrentData);
            // Und zugehörigen Menüpunkt aktivieren
            if (CraftMenu != null)
            {
                TMainMenu.TTBXCustomItem item = (TMainMenu.TTBXCustomItem)Utils.FindTBXItem(CraftMenu, Unit.xml_config.arMenuItems[cbPriceModel.CurrentData].Name);
                Debug.Assert(item != null);
                Unit.frmMain.mnUserOptionClick(item, EventArgs.Empty);
            }

            //Speichern der Erweiterungen
            for (int ext = 0; ext < Unit.xml_config.nExtensions; ext++)
            {
                Utils.SetRegistryInteger(Unit.xml_config.arExtensions[ext].Name, cbAddons.GetItemChecked(ext) ? 1 : 0, "\\Extensions");
            }
        }