Exemplo n.º 1
0
        private void MassReplace(object sender, RoutedEventArgs e)
        {
            List <uint> wemIds = new List <uint>();

            for (int i = 0; i < nbnk.DataIndex.wemList.Count; i++)
            {
                wemIds.Add(nbnk.DataIndex.wemList[i].id);
            }
            MassReplace mass = new MassReplace(wemIds, ImportPath);

            if (mass.ShowDialog() == true)
            {
                for (int i = 0; i < mass.holder.wems.Count; i++)
                {
                    int index  = nbnk.DataIndex.wemList.FindIndex(x => x.id == mass.holder.wems[i].replacingId);
                    Wem newWem = mass.holder.wems[i].wem;
                    if (index != -1)
                    {
                        newWem.id                     = nbnk.DataIndex.wemList[index].id;
                        newWem.languageEnum           = nbnk.DataIndex.wemList[index].languageEnum;
                        nbnk.DataIndex.wemList[index] = newWem;
                        PopulateTreeView(true);
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void Mass_Replace(object sender, RoutedEventArgs e)
        {
            if (viewModel.npck == null)
            {
                MessageBox.Show("NPCK not loaded.");
                return;
            }
            List <uint> wemIds = viewModel.GetWemIds();
            MassReplace mass   = new MassReplace(wemIds, ImportPath);

            if (mass.ShowDialog() == true)
            {
                viewModel.MassReplace(new List <ReplacingWem>(mass.holder.wems));
            }
        }