Exemple #1
0
        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;
            }
        }
Exemple #2
0
        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);
        }
Exemple #3
0
Fichier : Bank.cs Projet : kreed/qz
        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();
        }
Exemple #4
0
 public Word(string text, Meaning meaning, Graphics g)
     : base(text, g)
 {
     Meaning = meaning;
 }