示例#1
0
        public BreakpointManager()
        {
            _settings = LoadSettings();

            _saveName      = _settings.SaveFile;
            _bpCells       = new ObservableCollection <Cells> {
            };
            _bpSearchCells = new ObservableCollection <Cells> {
            };


            AddShowAllToList();



            _bpClass = new ObservableCollection <Breakpoint> {
            };
            if (!LoadXML())
            {
                // error if xml loaded incorrectly

                MessageBox.Show("There was an error loading the data file", "Data file corrupt");
                Application.Current.Shutdown();
            }

            // listSearch is the itemsource for the for the breakpoint list on the main form.

            _listSearch = new ObservableCollection <Breakpoint>(_bpClass);

            // after this bool is true we know BPCells and BPClass is filled so can start checking if there is changes made to them.

            finishedLoading = true;
        }
 public settingsWindow(BreakpointManager bpm)
 {
     InitializeComponent();
     this.bpm          = bpm;
     editSettings      = this.bpm._settings;
     textSaveFile.Text = editSettings.SaveFile;
 }
示例#3
0
 static Initialization()
 {
     try
     {
         HarmonyPatches.HPatcher.Init();
         ClassInjector.Initialize();
         BPSettings.Init();
         SettingsMenu.Init();
         HunamoidRaceCheck.SearchMod();
         ClassInjector.EnableDevMode(Prefs.DevMode);
     }
     catch (Exception e)
     {
         Log.Error($"BadPeople: Failed to initialize: {e.Message}");
     }
 }
示例#4
0
        private void saveProgress()
        {
            BPSettings bp       = new BPSettings();
            var        set_path = ProjectConfig.projectPath + "//" + "settings.json";

            try
            {
                var se = bp.ReadSettings(set_path);
                var i  = se.FindIndex(x => x.property == "progress");
                se[i].value = ProjectConfig.projectSettings["progress"];
                using (StreamWriter file = File.CreateText(set_path))
                {
                    JsonSerializer serializer = new JsonSerializer();
                    serializer.Serialize(file, se);
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("Exception: " + e.Message);
            }
        }
示例#5
0
        private void ModifyBt_Click(object sender, EventArgs e)
        {
            BPSettings bps      = new BPSettings();
            var        set_path = ProjectConfig.projectPath + "//" + "settings.json";

            try
            {
                var se = bps.ReadSettings(set_path);
                var i  = se.FindIndex(x => x.property == "Title");
                se[i].value = projectName.Text;
                using (StreamWriter file = File.CreateText(set_path))
                {
                    JsonSerializer serializer = new JsonSerializer();
                    serializer.Serialize(file, se);
                }
                newName = projectName.Text;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Exception: " + ex.Message);
            }
        }