public Meaning(string text, Graphics g, List <Meaning> current) : base(text, g) { var dup = current.FirstOrDefault(def => def.Text == Text); if (dup != null) { Next = dup.Next; dup.Next = this; } else { Next = this; } }
protected override void OnMouseDown(MouseEventArgs e) { if (e.Button == MouseButtons.Left) { var loc = e.Location; loc.Y -= AutoScrollPosition.Y; moving = WordBank.Meanings .FindContainer(loc, ShowCorrect || proceed); if (moving != null) { MouseMove += OnMouseMove; lastLoc = e.Location; } } base.OnMouseDown(e); }
public void Add() { if (bank.Count == 0) { return; } using (var g = MainWindow.Instance.CreateGraphics()) while (Words.Count != GroupSize && bank.Count != 0) { var word = bank.Next(); var meaning = new Meaning(word.Value, g, Meanings); Meanings.Add(meaning); Words.Add(new Word(word.Key, meaning, g)); } Reload(); }
public Word(string text, Meaning meaning, Graphics g) : base(text, g) { Meaning = meaning; }