示例#1
0
        private void AddButton_Click(object sender, EventArgs e)
        {
            Encounter encounter = new Encounter();

            using (EncounterForm child = new EncounterForm())
            {
                child.Setup(Context, Zone, encounter);

                if (child.ShowDialog() == DialogResult.OK)
                {
                    child.Apply();
                    Zone.Encounters.Add(encounter);

                    Context.UnsavedChanges = true;
                    Context.UpdateEncounters();
                }
            }
        }
示例#2
0
        private void Edit()
        {
            if (Options.SelectedIndex == -1)
            {
                return;
            }

            Encounter encounter = Zone.Encounters[Options.SelectedIndex];

            using (EncounterForm child = new EncounterForm())
            {
                child.Setup(Context, Zone, encounter);

                if (child.ShowDialog() == DialogResult.OK)
                {
                    child.Apply();
                    Context.UnsavedChanges = true;
                    Context.UpdateEncounters();
                }
            }
        }