コード例 #1
0
        public override void add(NovelElementIF novel)
        {
            if (novel.GetType().IsInstanceOfType(typeof(Page)))
            {
                throw new Exception("Page cannot contain Page");
            }

            base.elements.Add(novel);
        }
コード例 #2
0
        public override void add(NovelElementIF novel)
        {
            if (novel.GetType() == typeof(LineOfText))
            {
                throw new Exception("LineOfText cannot contain LineOfText");
            }

            base.elements.Add(novel);
        }