Exemplo n.º 1
0
        public void AddToCanvas(Canvas canvas)
        {
            canvas.Children.Add(Rectangle);
            Canvas.SetLeft(Rectangle, MapObjectMetrics.XOfCanvas);
            Canvas.SetTop(Rectangle, MapObjectMetrics.YOfCanvas);
            canvas.Children.Add(MapObjectDoor.GetDoor());
            canvas.Children.Add(MapObjectNameTextBlock);

            if (MapObjectEntity.GetType() == typeof(Building))
            {
                ((Building)MapObjectEntity).AddBuildinLayersButtonsToCanvas(canvas);
            }
        }
Exemplo n.º 2
0
        public MapObject(MapObjectEntity mapObjectEntity, MapObjectMetrics mapObjectMetrics, MapObjectDoor mapObjectDoor)
        {
            MapObjectEntity = mapObjectEntity;

            if (MapObjectEntity.GetType() == typeof(Building))
            {
                ((Building)MapObjectEntity).BuildingLayersButtons.MapObjectMetrics = mapObjectMetrics;
            }

            MapObjectMetrics = mapObjectMetrics;

            MapObjectDoor = mapObjectDoor;
            MapObjectDoor.MapObjectMetrics = mapObjectMetrics;

            RectangleInitialization();
            if (mapObjectEntity.MapObjectType.TypeOfMapObject == TypeOfMapObject.ROAD)
            {
                LineInitialization();
            }
            PositionObjectNameTextBlock();
        }