Beispiel #1
0
        public void AddBasecampsLayer()
        {
            var basecamp = layerHelper.FindLayer(Constants.BasecampsLayer) as BasecampLayer;

            if (basecamp == null)
            {
                return;
            }
            basecampsOnOff = new LayerControlOnOff(basecamp, true);

            if (!IsLayerAlreadyLoaded(layerWrapper.Children, Constants.BasecampsLayer))
            {
                layerWrapper.Children.Add(basecampsOnOff);
            }
        }
Beispiel #2
0
        public void SetLayerHelper(LayerHelper layerHelper)
        {
            this.layerHelper = layerHelper;

            var hexLayer = layerHelper.FindLayer(Constants.Hexagonlayername);

            if (hexLayer == null)
            {
                return;
            }

            hexagonOnOff = new LayerControlOnOff(hexLayer, true);
            hexagonOnOff.VisibilityChanged += hexagonLayerOnOff_VisibilityChanged;
            layerWrapper.Children.Add(hexagonOnOff);
        }
Beispiel #3
0
        public void AddRegionLawLayer()
        {
            var lawLayer = layerHelper.FindLayer(Current.Instance.Earthwatcher.PlayingRegion + Constants.RegionLawLayerName) as TileLayer;

            if (lawLayer == null)
            {
                if (forestLawOnOff != null)
                {
                    forestLawOnOff.Opacity = 0;
                    forestLawOnOff.setLayer(null);
                }
                return;
            }

            if (forestLawOnOff == null)
            {
                forestLawOnOff = new LayerControlOnOff(lawLayer, false);
                if (!IsLayerAlreadyLoaded(layerWrapper.Children, Current.Instance.Earthwatcher.PlayingRegion + Constants.RegionLawLayerName))
                {
                    layerWrapper.Children.Add(forestLawOnOff);
                }
            }
            else
            {
                forestLawOnOff.Opacity = 1;
                forestLawOnOff.setLayer(lawLayer);

                if (!IsLayerAlreadyLoaded(layerWrapper.Children, Current.Instance.Earthwatcher.PlayingRegion + Constants.RegionLawLayerName))
                {
                    layerWrapper.Children.Add(forestLawOnOff);
                }
            }
            //lawLayer.Loaded += lawLayer_Loaded;
            //lawLayer.Loading += lawLayer_Loading;
            //forestLawOnOff.VisibilityChanged += lawLayerOnOff_VisibilityChanged;
        }
        public void AddArgentineLawLayer()
        {
            var lawLayer = layerHelper.FindLayer(Constants.ArgentineLawlayername) as ArgentineLawLayer;
            if (lawLayer == null)
                return;

            lawLayer.Loaded += lawLayer_Loaded;
            lawLayer.Loading += lawLayer_Loading;
            forestLawOnOff = new LayerControlOnOff(lawLayer, false);
            forestLawOnOff.VisibilityChanged += lawLayerOnOff_VisibilityChanged;

            if (!IsLayerAlreadyLoaded(layerWrapper.Children, Constants.ArgentineLawlayername))
                layerWrapper.Children.Add(forestLawOnOff);
        }
        public void SetLayerHelper(LayerHelper layerHelper)
        {
            this.layerHelper = layerHelper;

            var hexLayer = layerHelper.FindLayer(Constants.Hexagonlayername);
            if (hexLayer == null)
                return;

            hexagonOnOff = new LayerControlOnOff(hexLayer, true);
            hexagonOnOff.VisibilityChanged += hexagonLayerOnOff_VisibilityChanged;
            layerWrapper.Children.Add(hexagonOnOff);
        }
        public void AddBasecampsLayer()
        {
            var basecamp = layerHelper.FindLayer(Constants.BasecampsLayer) as BasecampLayer;
            if (basecamp == null)
                return;
            basecampsOnOff = new LayerControlOnOff(basecamp, true);

            if (!IsLayerAlreadyLoaded(layerWrapper.Children, Constants.BasecampsLayer))
                layerWrapper.Children.Add(basecampsOnOff);
        }
        public void AddRegionLawLayer()
        {
            var lawLayer = layerHelper.FindLayer(Current.Instance.Earthwatcher.PlayingRegion + Constants.RegionLawLayerName) as TileLayer;
            if (lawLayer == null)
            {
                if(forestLawOnOff != null)
                {
                    forestLawOnOff.Opacity = 0;
                    forestLawOnOff.setLayer(null);
                }
                return;
            }

            if (forestLawOnOff == null)
            {
                forestLawOnOff = new LayerControlOnOff(lawLayer, false);
                if (!IsLayerAlreadyLoaded(layerWrapper.Children, Current.Instance.Earthwatcher.PlayingRegion + Constants.RegionLawLayerName))
                    layerWrapper.Children.Add(forestLawOnOff);
            }
            else
            {
                forestLawOnOff.Opacity = 1;
                forestLawOnOff.setLayer(lawLayer);

                if (!IsLayerAlreadyLoaded(layerWrapper.Children, Current.Instance.Earthwatcher.PlayingRegion + Constants.RegionLawLayerName))
                    layerWrapper.Children.Add(forestLawOnOff);

            }
            //lawLayer.Loaded += lawLayer_Loaded;
            //lawLayer.Loading += lawLayer_Loading;
            //forestLawOnOff.VisibilityChanged += lawLayerOnOff_VisibilityChanged;
        }