void UpdateTags(List <Coordinates> coords, PositionsViewerView tagger, Widget widget)
 {
     if (coords.Count > 0)
     {
         Visible = true;
     }
     tagger.Coordinates = coords;
     widget.Visible     = coords.Count != 0;
 }
        public PlaysCoordinatesTagger()
        {
            this.Build();
            HeightRequest = 300;
            WidthRequest  = 500;

            field  = new PositionsViewerView(new WidgetWrapper(fieldDrawingarea));
            hfield = new PositionsViewerView(new WidgetWrapper(hfieldDrawingarea));
            goal   = new PositionsViewerView(new WidgetWrapper(goalDrawingarea));
        }
        public void TestAddProjectWithoutCoords()
        {
            var project = Utils.CreateProject(true);
            var view    = new PositionsViewerView(Mock.Of <IWidget> ())
            {
                Background = project.GetBackground(FieldPositionType.Field)
            };

            view.Project = project;

            Assert.AreEqual(0, view.Objects.Count);
        }
        public void TestAddProjectWithCoords()
        {
            var project = Utils.CreateProject(true);

            project.Timeline [0].EventType.TagFieldPosition = true;
            project.Timeline [0].AddDefaultPositions();
            var view = new PositionsViewerView(Mock.Of <IWidget> ())
            {
                Background = project.GetBackground(FieldPositionType.Field)
            };

            view.Project = project;

            Assert.AreEqual(1, view.Objects.Count);
        }
        public void TestAddCoordinates()
        {
            var coordinates = new List <Coordinates> ();
            var coord1      = new Coordinates();

            coord1.Points.Add(new Point(0, 0));
            var coord2 = new Coordinates();

            coord2.Points.Add(new Point(0, 0));
            coordinates.Add(coord1);
            coordinates.Add(coord2);

            var view = new PositionsViewerView(Mock.Of <IWidget> ())
            {
                Background = Utils.LoadImageFromFile()
            };

            view.Coordinates = coordinates;

            Assert.AreEqual(2, view.Objects.Count);
        }