private void itemCopy_Click(object sender, RoutedEventArgs e) { item_template o = itemList.SelectedItem as item_template; if (o == null) { return; } item_template n = WorldWorker.GetItemTemplate(o.entry); WorldWorker.SetEntityState(n, System.Data.EntityState.Added); n.entry = WorldWorker.GenerateNextItemEntry(); LegacyToolBox.Data.SaveItemTemplate(n); }