public dynamic GetBlockData(SlideBlock block) { var index = Array.IndexOf(Slide.Blocks, block); if (index < 0) throw new ArgumentException("No block " + block + " in slide " + Slide); return BlockData[index]; }
public QuizInfoModel(QuizModel model, SlideBlock currentBlock, int index, QuizState quizState) { QuizModel = model; CurrentBlock = currentBlock; BlockIndex = index; QuizState = quizState; }
public static string Text(this SlideBlock block) { var md = block as MdBlock; if (md != null) { return(md.Markdown); } var code = block as CodeBlock; if (code != null) { return(code.Code); } throw new Exception(block.ToString()); }
public override bool HasEqualStructureWith(SlideBlock other) { var block = other as MatchingBlock; if (block == null) return false; if (Matches.Length != block.Matches.Length) return false; var idsSet = Matches.Select(m => m.Id).ToImmutableHashSet(); var blockIdsSet = block.Matches.Select(m => m.Id).ToImmutableHashSet(); return idsSet.SetEquals(blockIdsSet); }
public override bool HasEqualStructureWith(SlideBlock other) { var block = other as OrderingBlock; if (block == null) return false; return Items.SequenceEqual(block.Items); }
public override bool HasEqualStructureWith(SlideBlock other) { return other is FillInBlock; }
public override bool HasEqualStructureWith(SlideBlock other) { var block = other as IsTrueBlock; if (block == null) return false; return Answer == block.Answer; }
public override bool HasEqualStructureWith(SlideBlock other) { var block = other as ChoiceBlock; if (block == null) return false; if (Items.Length != block.Items.Length || Multiple != block.Multiple) return false; var idsSet = Items.Select(i => i.Id).ToImmutableHashSet(); var blockIdsSet = block.Items.Select(i => i.Id).ToImmutableHashSet(); return idsSet.SetEquals(blockIdsSet); }
public abstract bool HasEqualStructureWith(SlideBlock other);
public SlideBlockDiff(SlideBlock original, SlideBlock changed) { OriginalSlideBlock = original; ChangedSlideBlock = changed; }
public Lesson(string title, string id, SlideBlock[] blocks) { Title = title; Id = id; Blocks = blocks; }
public static bool IsCode(this SlideBlock block) { return(block is CodeBlock); }