public void InsertLine(Line line)
        {
            var table = store.GetTable("lines");

            line.Id = NewId;
            table.GetOrInsertRecord(line.Id, line.ToDictionaryTest(), false, new DBError());
            DrawnLines.Add(line);
            store.Sync(null);
        }
        //Draw line logic. Checks if the dots are valid in order to draw line
        private bool DrawLine(Dot starterDot, Dot endingDot)
        {
            //Checks if the dots are within the board's bounds
            if (!IsWithinBounds(starterDot) && IsWithinBounds(endingDot))
            {
                return(false);
            }
            //Checks dot cross availiability
            var startpoint = Points.SingleOrDefault(p => p.Dot.Equals(starterDot));
            var endPoint   = Points.SingleOrDefault(p => p.Dot.Equals(endingDot));

            if (!(startpoint.Crosses == 0 || endPoint.Crosses == 0))
            {
                //Check if the dots are in the same line or row
                if ((Math.Abs(starterDot.X - endingDot.X) == 1 || Math.Abs(starterDot.Y - endingDot.Y) == 1) &&
                    !(Math.Abs(starterDot.X - endingDot.X) == 1 && Math.Abs(starterDot.Y - endingDot.Y) == 1))
                {
                    Line line = new Line {
                        StartDot = starterDot, EndDot = endingDot
                    };
                    //for foes we have yet to consider about (antiyagni)
                    if (!DrawnLines.Any(l => l.Equals(line) || l.Equals(line.AltLine())))
                    {
                        DrawnLines.Add(line);
                        Points.SingleOrDefault(p => p.Dot.Equals(starterDot)).Crosses--;
                        Points.SingleOrDefault(p => p.Dot.Equals(endingDot)).Crosses--;

                        //CheckBox(line);
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }