public override void add(NovelElementIF novel) { if (novel.GetType().IsInstanceOfType(typeof(Page))) { throw new Exception("Page cannot contain Page"); } base.elements.Add(novel); }
public override void add(NovelElementIF novel) { if (novel.GetType() == typeof(LineOfText)) { throw new Exception("LineOfText cannot contain LineOfText"); } base.elements.Add(novel); }