public static void CopyWords(IWords source, IWords target) { if (!typeof(IWords).IsAssignableFrom(target.GetType())) { throw new ArgumentException("Target must implement IWords!"); } foreach (IWord word in source.Words) { IWord newWord = target.CreateWord(word.Word, word.Type, word.Default); target.AddWord(newWord); } }
public static void CopyWords(IWords source, IWords target) { if (!typeof(IWords).IsAssignableFrom(target.GetType())) throw new ArgumentException("Target must implement IWords!"); foreach (IWord word in source.Words) { IWord newWord = target.CreateWord(word.Word, word.Type, word.Default); target.AddWord(newWord); } }