コード例 #1
0
        private void lvContextShortName_Edit(object sender, RoutedEventArgs e)
        {
            if (Database is null || lvShortCarNames.SelectedIndex == -1)
            {
                return;
            }

            var entryLong  = Database.NameTrees[0].Entries[lvShortCarNames.SelectedIndex];
            var entryShort = Database.NameTrees[1].Entries[lvShortCarNames.SelectedIndex];
            var dialog     = new NDB0EntryEditWindow(entryLong, entryShort);

            dialog.ShowDialog();
            if (dialog.Saved)
            {
                entryLong.FullName  = entryLong.Name;
                entryShort.FullName = entryShort.Name;
                UpdateNamesList();
            }
        }
コード例 #2
0
        private void lvContextTrack_AddNew(object sender, RoutedEventArgs e)
        {
            if (Database is null)
            {
                return;
            }

            var entryL = new NDB0Entry();
            var entryS = new NDB0Entry();
            var dialog = new NDB0EntryEditWindow(entryL, entryS);

            dialog.ShowDialog();
            if (dialog.Saved)
            {
                Database.NameTrees[0].Add(entryL);
                Database.NameTrees[1].Add(entryS);

                UpdateNamesList();
            }
        }