Beispiel #1
0
        private void refresh()
        {
            bool oldHistory = doHistory;

            doHistory = false;
            name.DataBindings.Clear();
            name.DataBindings.Add("Text", race, "Name", true, DataSourceUpdateMode.OnPropertyChanged);
            flavour.DataBindings.Clear();
            NewlineFormatter.Add(flavour.DataBindings, "Text", race, "Flavour", true, DataSourceUpdateMode.OnPropertyChanged);
            source.DataBindings.Clear();
            source.DataBindings.Add("Text", race, "Source", true, DataSourceUpdateMode.OnPropertyChanged);
            description.DataBindings.Clear();
            NewlineFormatter.Add(description.DataBindings, "Text", race, "Description", true, DataSourceUpdateMode.OnPropertyChanged);
            features1.features        = race.Features;
            decriptions1.descriptions = race.Descriptions;
            preview.Navigate("about:blank");
            preview.Document.OpenNew(true);
            preview.Document.Write(race.ToHTML());
            ParentRace.DataBindings.Clear();
            ParentRace.DataBindings.Add("Text", race, "RaceName", true, DataSourceUpdateMode.OnPropertyChanged);
            ImageChanged?.Invoke(this, race.GetImage());
            preview.Refresh();
            source.AutoCompleteCustomSource.Clear();
            source.AutoCompleteCustomSource.AddRange(SourceManager.Sources.ToArray());
            onChange();
            doHistory = oldHistory;
        }
Beispiel #2
0
        private void subRaceList_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (subRaceList.SelectedItem == null)
            {
                return;
            }
            SubRace selected = Program.Context.GetSubRace((string)subRaceList.SelectedItem, null);

            if (selected != null)
            {
                preview.Navigate("about:blank");
                preview.Document.OpenNew(true);
                preview.Document.Write(selected.ToHTML());
                preview.Refresh();
            }
        }